Documentation
¶
Index ¶
- func MockAuthCall(t *testing.T, clientID string, clientSecret string, testAccessToken string) httpmock.Responder
- func MockAuthCallCounter(t *testing.T, clientID, clientSecret, testAccessToken string, expiresIn int, ...) httpmock.Responder
- func MockAuthCallWithValidation(t *testing.T, clientID, clientSecret, testAccessToken string, ...) httpmock.Responder
- func MockAuthErrorResponse(statusCode int, errorCode, errorDescription string) httpmock.Responder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockAuthCall ¶
func MockAuthCallCounter ¶
func MockAuthCallCounter(t *testing.T, clientID, clientSecret, testAccessToken string, expiresIn int, callCount *int) httpmock.Responder
MockAuthCallCounter creates a mock responder that counts how many times the token endpoint is called. This is useful for testing token caching behavior.
func MockAuthCallWithValidation ¶
func MockAuthCallWithValidation(t *testing.T, clientID, clientSecret, testAccessToken string, expectedScopes []string, expiresIn int) httpmock.Responder
MockAuthCallWithValidation creates a mock responder that validates the OAuth2 client credentials request format according to RFC 6749 section 4.4. It validates: - Authorization header (Basic auth with client_id:client_secret) - Content-Type header (application/x-www-form-urlencoded) - Request body contains grant_type=client_credentials - Request body contains expected scopes (if provided)
func MockAuthErrorResponse ¶
MockAuthErrorResponse creates a mock responder that returns an OAuth2 error response. This is used to test error handling for authz provider error responses (400, 401, 429, 5xx).
Types ¶
This section is empty.