Package authtest implements authentication related test helpers.
Defaults for FakeTokenGenerator.
FakeTokenGenerator implements localauth.TokenGenerator by returning fake data.
Useful for integration tests that involve local auth server.
Each GenerateToken call returns a token "fake_token_<N>", where N starts from 0 and incremented for each call. If KeepRecord is true, each generated token is recorded along with a list of scopes that were used to generate it. Use TokenScopes() to see what scopes have been used to generate a particular token.
GenerateToken is part of TokenGenerator interface.
GetEmail is part of TokenGenerator interface.
TokenScopes returns scopes that were used to generate given fake token.
Returns nil for unknown tokens or if KeepRecord is false and tokens weren't recorded.