github

package
v0.0.0-...-7f11b89 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DisplayName = "GitHub"
View Source
const ProviderName = "github"

Variables

View Source
var Scopes = []string{"read:org"}

Functions

func NewTeamVerifier

func NewTeamVerifier(
	teams []Team,
	gitHubClient Client,
) verifier.Verifier

func NewUserVerifier

func NewUserVerifier(
	users []string,
	gitHubClient Client,
) verifier.Verifier

Types

type Client

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

func NewClient

func NewClient(baseURL string) Client

type GitHubProvider

type GitHubProvider struct {
	*oauth2.Config
	verifier.Verifier
}

func (GitHubProvider) PreTokenClient

func (GitHubProvider) PreTokenClient() (*http.Client, error)

type GithubTeamProvider

type GithubTeamProvider struct{}

func (GithubTeamProvider) ProviderConfigured

func (GithubTeamProvider) ProviderConfigured(team db.Team) bool

func (GithubTeamProvider) ProviderConstructor

func (GithubTeamProvider) ProviderConstructor(
	team db.SavedTeam,
	redirectURL string,
) (provider.Provider, bool)

type OrganizationTeams

type OrganizationTeams map[string][]string

type OrganizationVerifier

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

func NewOrganizationVerifier

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

func (OrganizationVerifier) Verify

func (verifier OrganizationVerifier) Verify(logger lager.Logger, httpClient *http.Client) (bool, error)

type Team

type Team struct {
	Name         string
	Organization string
}

func DBTeamsToGitHubTeams

func DBTeamsToGitHubTeams(dbteams []db.GitHubTeam) []Team

type TeamVerifier

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

func (TeamVerifier) Verify

func (verifier TeamVerifier) Verify(logger lager.Logger, httpClient *http.Client) (bool, error)

type UserVerifier

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

func (UserVerifier) Verify

func (verifier UserVerifier) Verify(logger lager.Logger, httpClient *http.Client) (bool, error)

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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