Documentation ¶
Index ¶
- func FormValueRequestWithJSONResponse(t *testing.T, server *httptest.Server, method string, ...) map[string]interface{}
- func GetFormValueRequestWithJSONResponse(t *testing.T, server *httptest.Server, ...) map[string]interface{}
- func PostFormValueRequestWithJSONResponse(t *testing.T, server *httptest.Server, ...) map[string]interface{}
- func ProtectedResourceErrorTest(t *testing.T, server *httptest.Server, method string, ...)
- func ProtectedResourceSuccessTest(t *testing.T, server *httptest.Server, method string, ...)
- func TokenEndpointErrorTest(t *testing.T, server *httptest.Server, ...)
- func TokenEndpointSuccessTest(t *testing.T, server *httptest.Server, ...)
- type AbsentMatcher
- type Int64Matcher
- type Int64RangeMatcher
- type Matcher
- type RegexMatcher
- type StrMatcher
- type TestAuthInfo
- type TestAuthSession
- func (s *TestAuthSession) GetAuthId() int64
- func (s *TestAuthSession) GetAuthTime() int64
- func (s *TestAuthSession) GetCode() string
- func (s *TestAuthSession) GetCodeVerifier() string
- func (s *TestAuthSession) GetCreatedAt() int64
- func (s *TestAuthSession) GetExpiresIn() int64
- func (s *TestAuthSession) GetIdTokenExpiresIn() int64
- func (s *TestAuthSession) GetNonce() string
- func (s *TestAuthSession) GetRedirectURI() string
- type TestClient
- func (c *TestClient) AllowToUseGrantType(gt string)
- func (c *TestClient) CanUseFlow(flowType flow.FlowType) bool
- func (c *TestClient) CanUseGrantType(gt string) bool
- func (c *TestClient) CanUseRedirectURI(url string) bool
- func (c *TestClient) CanUseScope(flowType flow.FlowType, scope string) bool
- func (c *TestClient) GetAssertionKey(alg, kid string) interface{}
- func (c *TestClient) GetId() string
- func (c *TestClient) GetIdTokenAlg() string
- func (c *TestClient) GetIdTokenKey() interface{}
- func (c *TestClient) GetIdTokenKeyId() string
- func (c *TestClient) GetNoConsentPromptPolicy() prompt.NoConsentPromptPolicy
- func (c *TestClient) GetNonePromptPolicy() prompt.NonePromptPolicy
- func (c *TestClient) GetOwnerUserId() int64
- func (c *TestClient) MatchSecret(secret string) bool
- type TestOAuthToken
- func (t *TestOAuthToken) GetAccessToken() string
- func (t *TestOAuthToken) GetAccessTokenExpiresIn() int64
- func (t *TestOAuthToken) GetAuthId() int64
- func (t *TestOAuthToken) GetCreatedAt() int64
- func (t *TestOAuthToken) GetRefreshToken() string
- func (t *TestOAuthToken) GetRefreshTokenExpiresIn() int64
- func (t *TestOAuthToken) GetRefreshedAt() int64
- type TestStore
- func (s *TestStore) ClearAll()
- func (s *TestStore) ClearAuthData()
- func (s *TestStore) CreateAuthSession(info bridge.AuthInfo, session *authorization.Session) *bridge.Error
- func (s *TestStore) CreateNewClient(ownerId int64, id, secret, redirectURI string) *TestClient
- func (s *TestStore) CreateNewUser(name, pass string) *TestUser
- func (s *TestStore) CreateOAuthToken(info bridge.AuthInfo, onTokenEndpoint bool) (bridge.OAuthToken, *bridge.Error)
- func (s *TestStore) CreateOrUpdateAuthInfo(uid int64, clientId, scope string) (bridge.AuthInfo, *bridge.Error)
- func (s *TestStore) DisableSession(sess bridge.AuthSession) *bridge.Error
- func (s *TestStore) FindActiveAuthInfoById(id int64) (bridge.AuthInfo, *bridge.Error)
- func (s *TestStore) FindAuthInfoByUserIdAndClientId(uid int64, cid string) (bridge.AuthInfo, *bridge.Error)
- func (s *TestStore) FindAuthSessionByCode(code string) (bridge.AuthSession, *bridge.Error)
- func (s *TestStore) FindClientById(cid string) (bridge.Client, *bridge.Error)
- func (s *TestStore) FindOAuthTokenByAccessToken(token string) (bridge.OAuthToken, *bridge.Error)
- func (s *TestStore) FindOAuthTokenByRefreshToken(token string) (bridge.OAuthToken, *bridge.Error)
- func (s *TestStore) FindUserId(username, password string) (int64, *bridge.Error)
- func (s *TestStore) FindUserIdBySubject(sub string) (int64, *bridge.Error)
- func (s *TestStore) Issuer() string
- func (s *TestStore) RecordAssertionClaims(sub, jti string, iat, exp int64) *bridge.Error
- func (s *TestStore) RefreshAccessToken(info bridge.AuthInfo, old bridge.OAuthToken) (bridge.OAuthToken, *bridge.Error)
- type TestUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TokenEndpointErrorTest ¶
Types ¶
type AbsentMatcher ¶
type AbsentMatcher struct { }
func NewAbsentMatcher ¶
func NewAbsentMatcher() *AbsentMatcher
func (*AbsentMatcher) Match ¶
func (m *AbsentMatcher) Match(v interface{}) bool
func (*AbsentMatcher) RequireAbsent ¶
func (m *AbsentMatcher) RequireAbsent() bool
func (*AbsentMatcher) WantValue ¶
func (m *AbsentMatcher) WantValue() string
type Int64Matcher ¶
type Int64Matcher struct {
// contains filtered or unexported fields
}
func NewInt64Matcher ¶
func NewInt64Matcher(v int64) *Int64Matcher
func (*Int64Matcher) Match ¶
func (m *Int64Matcher) Match(v interface{}) bool
func (*Int64Matcher) RequireAbsent ¶
func (m *Int64Matcher) RequireAbsent() bool
func (*Int64Matcher) WantValue ¶
func (m *Int64Matcher) WantValue() string
type Int64RangeMatcher ¶
type Int64RangeMatcher struct {
// contains filtered or unexported fields
}
func NewInt64RangeMatcher ¶
func NewInt64RangeMatcher(from, to int64) *Int64RangeMatcher
func (*Int64RangeMatcher) Match ¶
func (m *Int64RangeMatcher) Match(v interface{}) bool
func (*Int64RangeMatcher) RequireAbsent ¶
func (m *Int64RangeMatcher) RequireAbsent() bool
func (*Int64RangeMatcher) WantValue ¶
func (m *Int64RangeMatcher) WantValue() string
type RegexMatcher ¶
type RegexMatcher struct {
// contains filtered or unexported fields
}
func NewRegexMatcher ¶
func NewRegexMatcher(v string) *RegexMatcher
func (*RegexMatcher) Match ¶
func (m *RegexMatcher) Match(v interface{}) bool
func (*RegexMatcher) RequireAbsent ¶
func (m *RegexMatcher) RequireAbsent() bool
func (*RegexMatcher) WantValue ¶
func (m *RegexMatcher) WantValue() string
type StrMatcher ¶
type StrMatcher struct {
// contains filtered or unexported fields
}
func NewStrMatcher ¶
func NewStrMatcher(v string) *StrMatcher
func (*StrMatcher) Match ¶
func (m *StrMatcher) Match(v interface{}) bool
func (*StrMatcher) RequireAbsent ¶
func (m *StrMatcher) RequireAbsent() bool
func (*StrMatcher) WantValue ¶
func (m *StrMatcher) WantValue() string
type TestAuthInfo ¶
type TestAuthInfo struct { Enabled bool // contains filtered or unexported fields }
func (*TestAuthInfo) GetAuthorizedAt ¶
func (i *TestAuthInfo) GetAuthorizedAt() int64
func (*TestAuthInfo) GetClientId ¶
func (i *TestAuthInfo) GetClientId() string
func (*TestAuthInfo) GetId ¶
func (i *TestAuthInfo) GetId() int64
func (*TestAuthInfo) GetScope ¶
func (i *TestAuthInfo) GetScope() string
func (*TestAuthInfo) GetSubject ¶
func (i *TestAuthInfo) GetSubject() string
func (*TestAuthInfo) GetUserId ¶
func (i *TestAuthInfo) GetUserId() int64
func (*TestAuthInfo) IsActive ¶
func (i *TestAuthInfo) IsActive() bool
type TestAuthSession ¶
type TestAuthSession struct { Enabled bool // contains filtered or unexported fields }
func (*TestAuthSession) GetAuthId ¶
func (s *TestAuthSession) GetAuthId() int64
func (*TestAuthSession) GetAuthTime ¶
func (s *TestAuthSession) GetAuthTime() int64
func (*TestAuthSession) GetCode ¶
func (s *TestAuthSession) GetCode() string
func (*TestAuthSession) GetCodeVerifier ¶
func (s *TestAuthSession) GetCodeVerifier() string
func (*TestAuthSession) GetCreatedAt ¶
func (s *TestAuthSession) GetCreatedAt() int64
func (*TestAuthSession) GetExpiresIn ¶
func (s *TestAuthSession) GetExpiresIn() int64
func (*TestAuthSession) GetIdTokenExpiresIn ¶
func (s *TestAuthSession) GetIdTokenExpiresIn() int64
func (*TestAuthSession) GetNonce ¶
func (s *TestAuthSession) GetNonce() string
func (*TestAuthSession) GetRedirectURI ¶
func (s *TestAuthSession) GetRedirectURI() string
type TestClient ¶
type TestClient struct { Enabled bool // contains filtered or unexported fields }
func NewTestClient ¶
func NewTestClient(ownerId int64, id, secret, redirectURI, alg string, key interface{}, keyId string) *TestClient
func (*TestClient) AllowToUseGrantType ¶
func (c *TestClient) AllowToUseGrantType(gt string)
func (*TestClient) CanUseFlow ¶
func (c *TestClient) CanUseFlow(flowType flow.FlowType) bool
func (*TestClient) CanUseGrantType ¶
func (c *TestClient) CanUseGrantType(gt string) bool
func (*TestClient) CanUseRedirectURI ¶
func (c *TestClient) CanUseRedirectURI(url string) bool
func (*TestClient) CanUseScope ¶
func (c *TestClient) CanUseScope(flowType flow.FlowType, scope string) bool
func (*TestClient) GetAssertionKey ¶
func (c *TestClient) GetAssertionKey(alg, kid string) interface{}
func (*TestClient) GetId ¶
func (c *TestClient) GetId() string
func (*TestClient) GetIdTokenAlg ¶
func (c *TestClient) GetIdTokenAlg() string
func (*TestClient) GetIdTokenKey ¶
func (c *TestClient) GetIdTokenKey() interface{}
func (*TestClient) GetIdTokenKeyId ¶
func (c *TestClient) GetIdTokenKeyId() string
func (*TestClient) GetNoConsentPromptPolicy ¶
func (c *TestClient) GetNoConsentPromptPolicy() prompt.NoConsentPromptPolicy
func (*TestClient) GetNonePromptPolicy ¶
func (c *TestClient) GetNonePromptPolicy() prompt.NonePromptPolicy
func (*TestClient) GetOwnerUserId ¶
func (c *TestClient) GetOwnerUserId() int64
func (*TestClient) MatchSecret ¶
func (c *TestClient) MatchSecret(secret string) bool
type TestOAuthToken ¶
type TestOAuthToken struct {
// contains filtered or unexported fields
}
func NewTestOAuthToken ¶
func (*TestOAuthToken) GetAccessToken ¶
func (t *TestOAuthToken) GetAccessToken() string
func (*TestOAuthToken) GetAccessTokenExpiresIn ¶
func (t *TestOAuthToken) GetAccessTokenExpiresIn() int64
func (*TestOAuthToken) GetAuthId ¶
func (t *TestOAuthToken) GetAuthId() int64
func (*TestOAuthToken) GetCreatedAt ¶
func (t *TestOAuthToken) GetCreatedAt() int64
func (*TestOAuthToken) GetRefreshToken ¶
func (t *TestOAuthToken) GetRefreshToken() string
func (*TestOAuthToken) GetRefreshTokenExpiresIn ¶
func (t *TestOAuthToken) GetRefreshTokenExpiresIn() int64
func (*TestOAuthToken) GetRefreshedAt ¶
func (t *TestOAuthToken) GetRefreshedAt() int64
type TestStore ¶
type TestStore struct {
// contains filtered or unexported fields
}
func NewTestStore ¶
func NewTestStore() *TestStore
func (*TestStore) ClearAuthData ¶
func (s *TestStore) ClearAuthData()
func (*TestStore) CreateAuthSession ¶
func (*TestStore) CreateNewClient ¶
func (s *TestStore) CreateNewClient(ownerId int64, id, secret, redirectURI string) *TestClient
func (*TestStore) CreateNewUser ¶
func (*TestStore) CreateOAuthToken ¶
func (*TestStore) CreateOrUpdateAuthInfo ¶
func (*TestStore) DisableSession ¶
func (s *TestStore) DisableSession(sess bridge.AuthSession) *bridge.Error
func (*TestStore) FindActiveAuthInfoById ¶
func (*TestStore) FindAuthInfoByUserIdAndClientId ¶
func (*TestStore) FindAuthSessionByCode ¶
func (*TestStore) FindClientById ¶
func (*TestStore) FindOAuthTokenByAccessToken ¶
func (*TestStore) FindOAuthTokenByRefreshToken ¶
func (*TestStore) FindUserId ¶
func (*TestStore) FindUserIdBySubject ¶
func (*TestStore) RecordAssertionClaims ¶
func (*TestStore) RefreshAccessToken ¶
func (s *TestStore) RefreshAccessToken(info bridge.AuthInfo, old bridge.OAuthToken) (bridge.OAuthToken, *bridge.Error)
Click to show internal directories.
Click to hide internal directories.