Documentation ¶
Index ¶
- Variables
- type AuthorizationServer
- func (ms *AuthorizationServer) BlockAccessTokenRequest(block bool)
- func (ms *AuthorizationServer) BlockFederatedTokenRequest(block bool)
- func (ms *AuthorizationServer) EnableDynamicAccessToken(enable bool)
- func (ms *AuthorizationServer) NumGetAccessTokenCalls() int
- func (ms *AuthorizationServer) NumGetFederatedTokenCalls() int
- func (ms *AuthorizationServer) SetAccessToken(token string)
- func (ms *AuthorizationServer) SetGenAcsTokenError(err error)
- func (ms *AuthorizationServer) SetGenFedTokenError(err error)
- func (ms *AuthorizationServer) SetTokenLifeTime(d int)
- func (ms *AuthorizationServer) Start(port int) error
- func (ms *AuthorizationServer) Stop() error
- type Config
- type Duration
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FakeFederatedToken = "FakeFederatedToken" FakeAccessToken = "FakeAccessToken" FakeTrustDomain = "FakeTrustDomain" // FakeSubjectToken is a fake JWT token without signing, anyone can change it if needed by base64 decoding or using online tool like https://jwt.io/. FakeSubjectToken = "" // nolint: lll /* 751-byte string literal not displayed */ FakeProjectNum = "1234567" FakeGKEClusterURL = "https://container.googleapis.com/v1/projects/fakeproject/locations/fakelocation/clusters/fakecluster" FakeExpiresInSeconds = 3600 )
Functions ¶
This section is empty.
Types ¶
type AuthorizationServer ¶
AuthorizationServer mocks google secure token server. nolint: maligned
func StartNewServer ¶
func StartNewServer(t *testing.T, conf Config) (*AuthorizationServer, error)
StartNewServer creates a mock server and starts it. The server listens on port for requests. If port is 0, a randomly chosen port is in use.
func (*AuthorizationServer) BlockAccessTokenRequest ¶
func (ms *AuthorizationServer) BlockAccessTokenRequest(block bool)
func (*AuthorizationServer) BlockFederatedTokenRequest ¶
func (ms *AuthorizationServer) BlockFederatedTokenRequest(block bool)
func (*AuthorizationServer) EnableDynamicAccessToken ¶
func (ms *AuthorizationServer) EnableDynamicAccessToken(enable bool)
SetAccessToken sets the issued access token to token
func (*AuthorizationServer) NumGetAccessTokenCalls ¶
func (ms *AuthorizationServer) NumGetAccessTokenCalls() int
func (*AuthorizationServer) NumGetFederatedTokenCalls ¶
func (ms *AuthorizationServer) NumGetFederatedTokenCalls() int
func (*AuthorizationServer) SetAccessToken ¶
func (ms *AuthorizationServer) SetAccessToken(token string)
SetAccessToken sets the issued access token to token
func (*AuthorizationServer) SetGenAcsTokenError ¶
func (ms *AuthorizationServer) SetGenAcsTokenError(err error)
func (*AuthorizationServer) SetGenFedTokenError ¶
func (ms *AuthorizationServer) SetGenFedTokenError(err error)
func (*AuthorizationServer) SetTokenLifeTime ¶
func (ms *AuthorizationServer) SetTokenLifeTime(d int)
SetTokenLifeTime sets life time of issued access token to d seconds
func (*AuthorizationServer) Start ¶
func (ms *AuthorizationServer) Start(port int) error
Start starts the mock server.
func (*AuthorizationServer) Stop ¶
func (ms *AuthorizationServer) Stop() error
Stop stops he mock server.
Click to show internal directories.
Click to hide internal directories.