{"modulePath":"github.com/hellofresh/janus","version":"v0.0.0-20230925145208-ce8de8183c67","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\n## Types\n\n```go\ntype Client interface {\n\tCurrentUser(*http.Client) (*github.User, error)\n\tOrganizations(*http.Client) ([]string, error)\n\tTeams(*http.Client) (OrganizationTeams, error)\n}\n```\nClient contains the methods that abstract an API\n\n```go\nfunc NewClient() Client\n```\nNewClient creates a new instance of client\n\n```go\ntype OrganizationTeams map[string][]string\n```\nOrganizationTeams is a map of organization names and teams\n\n```go\ntype OrganizationVerifier struct {\n\t// contains filtered or unexported fields\n}\n```\nOrganizationVerifier checks if the current user belongs any of the defined organizations\n\n```go\nfunc NewOrganizationVerifier(organizations []string, gitHubClient Client) *OrganizationVerifier\n```\nNewOrganizationVerifier creates a new instance of OrganizationVerifier\n\n```go\nfunc (v *OrganizationVerifier) Verify(r *http.Request, httpClient *http.Client) (bool, error)\n```\nVerify makes a check and return a boolean if the check was successful or not\n\n```go\ntype Provider struct {\n\tprovider.Verifier\n\t// contains filtered or unexported fields\n}\n```\nProvider abstracts the authentication for github\n\n```go\nfunc (gp *Provider) Build(config config.Credentials) provider.Provider\n```\nBuild acts like the constructor for a provider\n\n```go\nfunc (gp *Provider) GetClaims(httpClient *http.Client) (jwt.MapClaims, error)\n```\nGetClaims returns a JWT Map Claim\n\n```go\ntype Team struct {\n\tName         string\n\tOrganization string\n}\n```\nTeam represents a github team within the organization\n\n```go\ntype TeamVerifier struct {\n\t// contains filtered or unexported fields\n}\n```\nTeamVerifier checks if the current user belongs any of the defined teams\n\n```go\nfunc NewTeamVerifier(teams []Team, gitHubClient Client) *TeamVerifier\n```\nNewTeamVerifier creates a new instance of TeamVerifier\n\n```go\nfunc (v *TeamVerifier) Verify(r *http.Request, httpClient *http.Client) (bool, error)\n```\nVerify makes a check and return a boolean if the check was successful or not\n\n","path":"github.com/hellofresh/janus/pkg/jwt/github","name":"github","synopsis":"","isRedistributable":true}
