github

package
v0.0.0-...-665d5c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2018 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	CurrentUser(*http.Client) (*github.User, error)
	Organizations(*http.Client) ([]string, error)
	Teams(*http.Client) (OrganizationTeams, error)
}

Client contains the methods that abstract an API

func NewClient

func NewClient() Client

NewClient creates a new instance of client

type OrganizationTeams

type OrganizationTeams map[string][]string

OrganizationTeams is a map of organization names and teams

type OrganizationVerifier

type OrganizationVerifier struct {
	// contains filtered or unexported fields
}

OrganizationVerifier checks if the current user belongs any of the defined organizations

func NewOrganizationVerifier

func NewOrganizationVerifier(organizations []string, gitHubClient Client) *OrganizationVerifier

NewOrganizationVerifier creates a new instance of OrganizationVerifier

func (*OrganizationVerifier) Verify

func (v *OrganizationVerifier) Verify(r *http.Request, httpClient *http.Client) (bool, error)

Verify makes a check and return a boolean if the check was successful or not

type Provider

type Provider struct {
	provider.Verifier
	// contains filtered or unexported fields
}

Provider abstracts the authentication for github

func (*Provider) Build

func (gp *Provider) Build(config config.Credentials) provider.Provider

Build acts like the constructor for a provider

func (*Provider) GetClaims

func (gp *Provider) GetClaims(httpClient *http.Client) (jwt.MapClaims, error)

GetClaims returns a JWT Map Claim

type Team

type Team struct {
	Name         string
	Organization string
}

Team represents a github team within the organization

type TeamVerifier

type TeamVerifier struct {
	// contains filtered or unexported fields
}

TeamVerifier checks if the current user belongs any of the defined teams

func NewTeamVerifier

func NewTeamVerifier(teams []Team, gitHubClient Client) *TeamVerifier

NewTeamVerifier creates a new instance of TeamVerifier

func (*TeamVerifier) Verify

func (v *TeamVerifier) Verify(r *http.Request, httpClient *http.Client) (bool, error)

Verify makes a check and return a boolean if the check was successful or not

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL