genericoauth

package
v3.3.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2017 License: Apache-2.0 Imports: 16 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

View Source
const ProviderName = "oauth"

Variables

This section is empty.

Functions

func NewScopeVerifier

func NewScopeVerifier(
	scope string,
) verifier.Verifier

Types

type ConfigOverride

type ConfigOverride struct {
	oauth2.Config
	AuthURLParams map[string]string
}

type GenericOAuthConfig

type GenericOAuthConfig struct {
	DisplayName  string `json:"display_name"      long:"display-name"    description:"Name for this auth method on the web UI."`
	ClientID     string `json:"client_id"         long:"client-id"       description:"Application client ID for enabling generic OAuth."`
	ClientSecret string `json:"client_secret"     long:"client-secret"   description:"Application client secret for enabling generic OAuth."`

	AuthURL       string            `json:"auth_url,omitempty"          long:"auth-url"        description:"Generic OAuth provider AuthURL endpoint."`
	AuthURLParams map[string]string `` /* 160-byte string literal not displayed */
	Scope         string            `json:"scope,omitempty"             long:"scope"           description:"Optional scope required to authorize user"`
	TokenURL      string            `json:"token_url,omitempty"         long:"token-url"       description:"Generic OAuth provider TokenURL endpoint."`
}

func (*GenericOAuthConfig) AuthMethod

func (config *GenericOAuthConfig) AuthMethod(oauthBaseURL string, teamName string) atc.AuthMethod

func (*GenericOAuthConfig) IsConfigured

func (config *GenericOAuthConfig) IsConfigured() bool

func (*GenericOAuthConfig) Validate

func (config *GenericOAuthConfig) Validate() error

type GenericOAuthToken

type GenericOAuthToken struct {
	Scopes []string `json:"scope"`
}

type GenericTeamProvider

type GenericTeamProvider struct{}

func (GenericTeamProvider) AddAuthGroup

func (GenericTeamProvider) AddAuthGroup(group *flags.Group) provider.AuthConfig

func (GenericTeamProvider) ProviderConstructor

func (GenericTeamProvider) ProviderConstructor(
	config provider.AuthConfig,
	redirectURL string,
) (provider.Provider, bool)

func (GenericTeamProvider) UnmarshalConfig

func (GenericTeamProvider) UnmarshalConfig(config *json.RawMessage) (provider.AuthConfig, error)

type NoopVerifier

type NoopVerifier struct{}

func (NoopVerifier) Verify

func (v NoopVerifier) Verify(logger lager.Logger, client *http.Client) (bool, error)

type Provider

type Provider struct {
	verifier.Verifier
	Config ConfigOverride
}

func (Provider) AuthCodeURL

func (provider Provider) AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string

func (Provider) Client

func (provider Provider) Client(ctx context.Context, t *oauth2.Token) *http.Client

func (Provider) Exchange

func (provider Provider) Exchange(ctx context.Context, code string) (*oauth2.Token, error)

func (Provider) PreTokenClient

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

type ScopeVerifier

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

func (ScopeVerifier) Verify

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

Jump to

Keyboard shortcuts

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