Documentation
¶
Index ¶
Constants ¶
View Source
const UPLOAD_USER_EMAIL = "upload"
Variables ¶
This section is empty.
Functions ¶
func FakeOauthConfig ¶
Types ¶
type Authenticator ¶
type Authenticator interface {
// AuthenticateRequest takes an HTTP request and
// attempts to authenticate it.
// It returns the email address of the authenticated
// user, or an error.
// TODO: maybe this should be Authenticate(string) (string, error)
// Taking the Authorization header and returning the email address
AuthenticateRequest(*http.Request) (string, error)
}
type FakeAuthenticator ¶
func (FakeAuthenticator) AuthenticateRequest ¶
func (f FakeAuthenticator) AuthenticateRequest(r *http.Request) (string, error)
type FakeOAuthClient ¶
type FakeOAuthClient struct {
MockAuthCodeURL func(string, ...oauth2.AuthCodeOption) string
MockExchange func(context.Context, string) (*oauth2.Token, error)
}
func (*FakeOAuthClient) AuthCodeURL ¶
func (c *FakeOAuthClient) AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string
type GoogleAuthenticator ¶
type GoogleAuthenticator struct {
OAuthClient OAuthClient
TrustedUserEmailDomain string
}
func (GoogleAuthenticator) AuthenticateRequest ¶
func (g GoogleAuthenticator) AuthenticateRequest(r *http.Request) (string, error)
type GoogleOAuthClient ¶
func (GoogleOAuthClient) LookupAccessToken ¶
func (g GoogleOAuthClient) LookupAccessToken(refreshToken string) (string, error)
type IntegrationTestOAuthClient ¶
type IntegrationTestOAuthClient struct{}
IntegrationTestOAuthClient is used for integration tests
func (IntegrationTestOAuthClient) LookupAccessToken ¶
func (f IntegrationTestOAuthClient) LookupAccessToken(accessToken string) (string, error)
type OAuthClient ¶
Click to show internal directories.
Click to hide internal directories.