Documentation ¶
Overview ¶
Package signintest provides shared test code for testing signing in with Google accounts.
Index ¶
Constants ¶
const ClientID = "insecure_test_client_id"
ClientID is a fake OAuth client ID to be used with googlesignin.Authenticator in tests.
Variables ¶
This section is empty.
Functions ¶
func InsecureKeys ¶
InsecureKeys returns a key set containing an insecure test key. Should only be used in tests.
Types ¶
type RequestAuthenticator ¶
type RequestAuthenticator struct {
// contains filtered or unexported fields
}
RequestAuthenticator makes requests authenticated for test purposes.
func InsecureTestAuthenticator ¶
func InsecureTestAuthenticator(authenticator *googlesignin.Authenticator) *RequestAuthenticator
InsecureTestAuthenticator modifies the Authenticator accept insecure test keys, returning a RequestAuthenticator that can be use to make authorized *http.Request objects. You must use signintest.ClientID as the OAuth client ID when creating authenticator.
func (*RequestAuthenticator) InsecureMakeAuthenticated ¶
func (r *RequestAuthenticator) InsecureMakeAuthenticated( request *http.Request, email string, ) *http.Request
InsecureMakeAuthenticated makes request an authenticated request, using the insecure test keys. It will then be accepted by handlers that use MustGetEmail