oauth

package
v0.1.113 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package oauth contains test fixtures for OAuth authentication testing.

The fixtures in this directory provide sample data for testing OAuth flows:

  • valid_token.json: A sample valid OAuth token response
  • expired_token.json: A sample expired OAuth token for testing expiry handling
  • metadata.json: Sample OAuth 2.1 authorization server metadata
  • www_authenticate.txt: Example WWW-Authenticate headers for testing auth challenges

These fixtures can be loaded in tests using:

import "embed"

//go:embed valid_token.json
var ValidTokenFixture []byte

Package oauth provides embedded test fixtures for OAuth testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetadataFixture

type MetadataFixture struct {
	Issuer                            string   `json:"issuer"`
	AuthorizationEndpoint             string   `json:"authorization_endpoint"`
	TokenEndpoint                     string   `json:"token_endpoint"`
	UserinfoEndpoint                  string   `json:"userinfo_endpoint"`
	JwksURI                           string   `json:"jwks_uri"`
	ResponseTypesSupported            []string `json:"response_types_supported"`
	GrantTypesSupported               []string `json:"grant_types_supported"`
	TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"`
	ScopesSupported                   []string `json:"scopes_supported"`
	CodeChallengeMethodsSupported     []string `json:"code_challenge_methods_supported"`
	SubjectTypesSupported             []string `json:"subject_types_supported"`
	IDTokenSigningAlgValuesSupported  []string `json:"id_token_signing_alg_values_supported"`
}

MetadataFixture represents an OAuth server metadata fixture.

type TokenFixture

type TokenFixture struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	Scope        string `json:"scope"`
	IssuedAt     string `json:"issued_at"`
	ExpiresAt    string `json:"expires_at"`
}

TokenFixture represents an OAuth token fixture.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL