oauthserver

package
v0.1.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientSecretHasher

type ClientSecretHasher struct{ Vault *secure.Vault }

func (ClientSecretHasher) Compare

func (h ClientSecretHasher) Compare(_ context.Context, hash, data []byte) error

func (ClientSecretHasher) Hash

func (h ClientSecretHasher) Hash(_ context.Context, data []byte) ([]byte, error)

type Provider

type Provider struct {
	OAuth  fosite.OAuth2Provider
	Store  *Store
	KID    string
	Issuer string
}

func NewProvider

func NewProvider(ctx context.Context, app *platform.App, applicationID uuid.UUID) (*Provider, error)

type Session

type Session struct {
	AccessClaims  *jwt.JWTClaims                 `json:"access_claims"`
	IDClaims      *jwt.IDTokenClaims             `json:"id_claims"`
	AccessHeaders *jwt.Headers                   `json:"access_headers"`
	IDHeaders     *jwt.Headers                   `json:"id_headers"`
	ExpiresAt     map[fosite.TokenType]time.Time `json:"expires_at"`
	Username      string                         `json:"username"`
	Subject       string                         `json:"subject"`
}

Session carries both OAuth access-token and OpenID Connect ID-token claims. Keeping one serializable type lets Fosite safely restore a grant on any pod.

func NewSession

func NewSession(subject, username, kid string, now time.Time) *Session

func (*Session) Clone

func (s *Session) Clone() fosite.Session

func (*Session) GetExpiresAt

func (s *Session) GetExpiresAt(kind fosite.TokenType) time.Time

func (*Session) GetExtraClaims

func (s *Session) GetExtraClaims() map[string]interface{}

func (*Session) GetJWTClaims

func (s *Session) GetJWTClaims() jwt.JWTClaimsContainer

func (*Session) GetJWTHeader

func (s *Session) GetJWTHeader() *jwt.Headers

func (*Session) GetSubject

func (s *Session) GetSubject() string

func (*Session) GetUsername

func (s *Session) GetUsername() string

func (*Session) IDTokenClaims

func (s *Session) IDTokenClaims() *jwt.IDTokenClaims

func (*Session) IDTokenHeaders

func (s *Session) IDTokenHeaders() *jwt.Headers

func (*Session) SetExpiresAt

func (s *Session) SetExpiresAt(kind fosite.TokenType, expiresAt time.Time)

type Store

type Store struct {
	DB            *pgxpool.Pool
	Vault         *secure.Vault
	ApplicationID uuid.UUID
}

func (*Store) ClientAssertionJWTValid

func (s *Store) ClientAssertionJWTValid(ctx context.Context, jti string) error

func (*Store) CreateAccessTokenSession

func (s *Store) CreateAccessTokenSession(ctx context.Context, signature string, request fosite.Requester) error

func (*Store) CreateAuthorizeCodeSession

func (s *Store) CreateAuthorizeCodeSession(ctx context.Context, signature string, request fosite.Requester) error

func (*Store) CreateOpenIDConnectSession

func (s *Store) CreateOpenIDConnectSession(ctx context.Context, signature string, request fosite.Requester) error

func (*Store) CreatePKCERequestSession

func (s *Store) CreatePKCERequestSession(ctx context.Context, signature string, request fosite.Requester) error

func (*Store) CreateRefreshTokenSession

func (s *Store) CreateRefreshTokenSession(ctx context.Context, signature, accessSignature string, request fosite.Requester) error

func (*Store) DeleteAccessTokenSession

func (s *Store) DeleteAccessTokenSession(ctx context.Context, signature string) error

func (*Store) DeleteOpenIDConnectSession

func (s *Store) DeleteOpenIDConnectSession(ctx context.Context, signature string) error

func (*Store) DeletePKCERequestSession

func (s *Store) DeletePKCERequestSession(ctx context.Context, signature string) error

func (*Store) DeleteRefreshTokenSession

func (s *Store) DeleteRefreshTokenSession(ctx context.Context, signature string) error

func (*Store) GetAccessTokenSession

func (s *Store) GetAccessTokenSession(ctx context.Context, signature string, _ fosite.Session) (fosite.Requester, error)

func (*Store) GetAuthorizeCodeSession

func (s *Store) GetAuthorizeCodeSession(ctx context.Context, signature string, _ fosite.Session) (fosite.Requester, error)

func (*Store) GetClient

func (s *Store) GetClient(ctx context.Context, clientID string) (fosite.Client, error)

func (*Store) GetOpenIDConnectSession

func (s *Store) GetOpenIDConnectSession(ctx context.Context, signature string, _ fosite.Requester) (fosite.Requester, error)

func (*Store) GetPKCERequestSession

func (s *Store) GetPKCERequestSession(ctx context.Context, signature string, _ fosite.Session) (fosite.Requester, error)

func (*Store) GetRefreshTokenSession

func (s *Store) GetRefreshTokenSession(ctx context.Context, signature string, _ fosite.Session) (fosite.Requester, error)

func (*Store) InvalidateAuthorizeCodeSession

func (s *Store) InvalidateAuthorizeCodeSession(ctx context.Context, signature string) error

func (*Store) RevokeAccessToken

func (s *Store) RevokeAccessToken(ctx context.Context, requestID string) error

func (*Store) RevokeRefreshToken

func (s *Store) RevokeRefreshToken(ctx context.Context, requestID string) error

func (*Store) RotateRefreshToken

func (s *Store) RotateRefreshToken(ctx context.Context, requestID, _ string) error

func (*Store) SetClientAssertionJWT

func (s *Store) SetClientAssertionJWT(ctx context.Context, jti string, expiresAt time.Time) error

Jump to

Keyboard shortcuts

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