api

package
v0.0.0-...-ce03e45 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: MIT Imports: 48 Imported by: 0

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.3.1-0.20240709092903-309b11f85c73 DO NOT EDIT.

Package api is a generated GoMock package.

Index

Constants

View Source
const (
	BasicAuthScopes  = "basicAuth.Scopes"
	BearerAuthScopes = "bearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func AccessLogger

func AccessLogger(next http.Handler) http.Handler

func ConfigureDatastore

func ConfigureDatastore(ctx context.Context, cfg *config.Config, opt *option.Option) error

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func InitAuthentication

func InitAuthentication(opt *option.Option)

func InitAuthorizationGet

func InitAuthorizationGet(opt *option.Option)

func InitConfiguration

func InitConfiguration()

func InitConsent

func InitConsent(opt *option.Option)

func InitHandler

func InitHandler(opt *option.Option)

func InitHealthCheck

func InitHealthCheck(opt *option.Option)

func InitJwks

func InitJwks()

func InitRegistration

func InitRegistration(opt *option.Option)

func InitToken

func InitToken(opt *option.Option)

func InitUserInfo

func InitUserInfo(opt *option.Option)

func LogError

func LogError(r *http.Request, err error, msg *string)

func LogInfo

func LogInfo(r *http.Request, msg *string)

func MuxWithOptions

func MuxWithOptions(hi HandlerInterface, option *ChiServerOptions, appOption *option.Option) (*chi.Mux, error)

MuxWithOptions creates http.Handler with additional options

func NewMux

func NewMux(ctx context.Context, cfg *config.Config, logger *zerolog.Logger) (http.Handler, func(), error)

func NewOIDCRequestParamValidator

func NewOIDCRequestParamValidator() (*validator.Validate, error)

func NewOapiAuthentication

func NewOapiAuthentication(opt *option.Option) openapi3filter.AuthenticationFunc

func NewOapiErrorHandler

func NewOapiErrorHandler() nethttpmiddleware.ErrorHandler

func NewOption

func NewOption() (*option.Option, error)

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func Redirect

func Redirect(w http.ResponseWriter, r *http.Request, path string, code int)

func RespondAuthorizationRequestError

func RespondAuthorizationRequestError(w http.ResponseWriter, r *http.Request, redirectUri, state string, err xerr.OIDCError)

func RespondJSON

func RespondJSON(w http.ResponseWriter, r *http.Request, statusCode int, headers map[string]string, body any)

func RespondJSON200

func RespondJSON200(w http.ResponseWriter, r *http.Request)

func RespondJSON400

func RespondJSON400(w http.ResponseWriter, r *http.Request, summary xerr.PublicError, details []string, err error)

func RespondJSON401

func RespondJSON401(w http.ResponseWriter, r *http.Request, summary xerr.PublicError, details []string, err error)

func RespondJSON404

func RespondJSON404(w http.ResponseWriter)

func RespondJSON500

func RespondJSON500(w http.ResponseWriter, r *http.Request, err error)

func RespondJSON503

func RespondJSON503(w http.ResponseWriter, r *http.Request, err error)

func RespondServerError

func RespondServerError(w http.ResponseWriter, r *http.Request, err error)

func RespondTokenRequestError

func RespondTokenRequestError(w http.ResponseWriter, r *http.Request, err xerr.OIDCError)

func SecretKey

func SecretKey(email string) (string, error)

Types

type AccessTokenKey

type AccessTokenKey struct{}

type AccessTokenParser

type AccessTokenParser interface {
	ParseAccessToken(token string) (jwt.Token, error)
}

type AuthCodeRevoker

type AuthCodeRevoker interface {
	RevokeAuthCode(ctx context.Context, code string, clientID typedef.ClientID) error
}

type AuthenticateJSONBody

type AuthenticateJSONBody struct {
	Name     string `json:"name" validate:"required"`
	Password string `json:"password" validate:"required"`
}

AuthenticateJSONBody defines parameters for Authenticate.

type AuthenticateJSONRequestBody

type AuthenticateJSONRequestBody AuthenticateJSONBody

AuthenticateJSONRequestBody defines body for Authenticate for application/json ContentType.

type AuthenticateParams

type AuthenticateParams struct {
	// Sid Session ID
	Sid *SessionId `form:"sid,omitempty" json:"-" url:"sid"`
}

AuthenticateParams defines parameters for Authenticate.

type Authentication

type Authentication struct {
	// contains filtered or unexported fields
}

func (*Authentication) ServeHTTP

func (ah *Authentication) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Authenticator

type Authenticator interface {
	ConsentVerifier
	PasswordVerifier
}

type AuthorizationGet

type AuthorizationGet struct {
	// contains filtered or unexported fields
}

func (*AuthorizationGet) ServeHTTP

func (a *AuthorizationGet) ServeHTTP(w http.ResponseWriter, r *http.Request)

type AuthorizeParams

type AuthorizeParams struct {
	// ClientID Represents "client_id" parameter
	ClientID ClientID `form:"client_id" json:"client_id" schema:"client_id" url:"client_id" validate:"required,alphanum"`

	// Nonce Represents "nonce" parameter
	Nonce Nonce `form:"nonce" json:"nonce" schema:"nonce" url:"nonce" validate:"required,alphanum"`

	// RedirectURI Represents "redirect_uri" parameter
	RedirectURI RedirectURI `form:"redirect_uri" json:"redirect_uri" schema:"redirect_uri" url:"redirect_uri" validate:"required,url_encoded"`

	// ResponseType Represents "response_type" parameter
	ResponseType ResponseType `` /* 128-byte string literal not displayed */

	// Scope Represents "scope" parameter
	Scope Scope `form:"scope" json:"scope" schema:"scope" url:"scope" validate:"required,scope-validator"`

	// State Represents "state" parameter
	State State `form:"state" json:"state" schema:"state" url:"state" validate:"required,alphanum"`

	// Display Represents "display" parameter
	Display *Display `form:"display,omitempty" json:"display,omitempty" schema:"display" url:"display" validate:"display-validator"`

	// MaxAge Represents "max_age" parameter
	MaxAge *MaxAge `form:"max_age,omitempty" json:"max_age,omitempty" schema:"max_age" url:"max_age" validate:"numeric"`

	// Prompt Represents "prompt" parameter
	Prompt *Prompt `form:"prompt,omitempty" json:"prompt,omitempty" schema:"prompt" url:"prompt" validate:"prompt-validator"`

	// Sid Session ID
	Sid *SessionId `form:"sid,omitempty" json:"-" url:"sid"`
}

AuthorizeParams defines parameters for Authorize.

type AuthorizePost

type AuthorizePost struct {
	// contains filtered or unexported fields
}

func NewAuthorizePost

func NewAuthorizePost() *AuthorizePost

func (*AuthorizePost) ServeHTTP

func (p *AuthorizePost) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Authorizer

type Authorizer interface {
	Authorize(ctx context.Context, clientID typedef.ClientID, redirectURI, state string) (*url.URL, string, error)
	RequestFingerprintSaver
}

type CacheStatusChecker

type CacheStatusChecker interface {
	CheckCacheStatus(ctx context.Context) error
}

type ChiServerOptions

type ChiServerOptions struct {
	BaseRouter       *chi.Mux
	Middlewares      *MiddlewareFuncMap
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type ClientID

type ClientID = typedef.ClientID

ClientID defines model for ClientID.

type Code

type Code = string

Code defines model for Code.

type Configuration

type Configuration struct{}

func (*Configuration) ServeHTTP

func (c *Configuration) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ConfigurationResponse

type ConfigurationResponse struct {
	AuthorizationEndpoint             string                              `json:"authorization_endpoint"`
	DisplayValuesSupported            []DisplayValuesSupported            `json:"display_values_supported"`
	IDTokenSigningAlgValuesSupported  []IDTokenSigningAlgValuesSupported  `json:"id_token_signing_alg_values_supported"`
	Issuer                            string                              `json:"issuer"`
	JWKsURI                           string                              `json:"jwks_uri"`
	ResponseTypesSupported            []ResponseTypesSupported            `json:"response_types_supported"`
	ScopesSupported                   []ScopesSupported                   `json:"scopes_supported"`
	SubjectTypesSupported             []SubjectTypesSupported             `json:"subject_types_supported"`
	TokenEndpoint                     string                              `json:"token_endpoint"`
	TokenEndpointAuthMethodsSupported []TokenEndpointAuthMethodsSupported `json:"token_endpoint_auth_methods_supported"`
	UILocalesSupported                []UILocalesSupported                `json:"ui_locales_supported"`
	UserInfoEndpoint                  string                              `json:"userinfo_endpoint"`
}

ConfigurationResponse Represents the configuration information of OpenID Provider.

type Consent struct {
	// contains filtered or unexported fields
}

func (*Consent) ServeHTTP

func (ch *Consent) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ConsentAcceptor

type ConsentAcceptor interface {
	AcceptConsent(ctx context.Context, userID typedef.UserID, clientID typedef.ClientID) error
}

type ConsentParams

type ConsentParams struct {
	// Sid Session ID
	Sid *SessionId `form:"sid,omitempty" json:"-" url:"sid"`
}

ConsentParams defines parameters for Consent.

type ConsentVerifier

type ConsentVerifier interface {
	VerifyConsent(ctx context.Context, userID typedef.UserID, clientID typedef.ClientID) (bool, error)
}

type CredentialValidator

type CredentialValidator interface {
	ValidateCredential(ctx context.Context, clientID typedef.ClientID, clientSecret string) error
}

type DBStatusChecker

type DBStatusChecker interface {
	CheckDBStatus(ctx context.Context) error
}

type Display

type Display = string

Display defines model for Display.

type DisplayValuesSupported

type DisplayValuesSupported string

DisplayValuesSupported defines model for ConfigurationResponse.display_values_supported.

const (
	Page DisplayValuesSupported = "page"
)

Defines values for DisplayValuesSupported.

type ErrorResponse

type ErrorResponse struct {
	Details *[]string        `json:"details,omitempty"`
	Status  uint64           `json:"status"`
	Summary xerr.PublicError `json:"summary"`
}

ErrorResponse Represents error response

type GrantType

type GrantType = typedef.GrantType

GrantType defines model for GrantType.

type HandlerImpl

type HandlerImpl struct{}

func (*HandlerImpl) Authenticate

func (_ *HandlerImpl) Authenticate(w http.ResponseWriter, r *http.Request)

func (*HandlerImpl) Authorize

func (_ *HandlerImpl) Authorize(w http.ResponseWriter, r *http.Request)

func (*HandlerImpl) CheckHealth

func (_ *HandlerImpl) CheckHealth(w http.ResponseWriter, r *http.Request)

func (*HandlerImpl) Configuration

func (_ *HandlerImpl) Configuration(w http.ResponseWriter, r *http.Request)

func (*HandlerImpl) Consent

func (_ *HandlerImpl) Consent(w http.ResponseWriter, r *http.Request)

func (*HandlerImpl) Jwks

func (_ *HandlerImpl) Jwks(w http.ResponseWriter, r *http.Request)

func (*HandlerImpl) Register

func (_ *HandlerImpl) Register(w http.ResponseWriter, r *http.Request)

func (*HandlerImpl) Token

func (_ *HandlerImpl) Token(w http.ResponseWriter, r *http.Request)

func (*HandlerImpl) UserInfo

func (_ *HandlerImpl) UserInfo(w http.ResponseWriter, r *http.Request)

type HandlerInterface

type HandlerInterface interface {

	// GET: /.well-known/openid-configuration
	Configuration(w http.ResponseWriter, r *http.Request)

	// GET: /authorization
	Authorize(w http.ResponseWriter, r *http.Request)

	// GET: /health
	CheckHealth(w http.ResponseWriter, r *http.Request)

	// GET: /jwks
	Jwks(w http.ResponseWriter, r *http.Request)

	// POST: /token
	Token(w http.ResponseWriter, r *http.Request)

	// POST: /user/authentication
	Authenticate(w http.ResponseWriter, r *http.Request)

	// POST: /user/consent
	Consent(w http.ResponseWriter, r *http.Request)

	// POST: /user/registration
	Register(w http.ResponseWriter, r *http.Request)

	// GET: /userinfo
	UserInfo(w http.ResponseWriter, r *http.Request)
}

HandlerInterface represents all server handlers.

type HandlerInterfaceWrapper

type HandlerInterfaceWrapper struct {
	Handler          HandlerInterface
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

HandlerInterfaceWrapper converts contexts to parameters.

type Health

type Health struct {
	Status uint64 `json:"status"`
}

Health Represents the status of service.

type HealthCheck

type HealthCheck struct {
	// contains filtered or unexported fields
}

func (*HealthCheck) ServeHTTP

func (c *HealthCheck) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HealthChecker

type HealthChecker interface {
	CacheStatusChecker
	DBStatusChecker
}

type IDTokenSigningAlgValuesSupported

type IDTokenSigningAlgValuesSupported string

IDTokenSigningAlgValuesSupported defines model for ConfigurationResponse.id_token_signing_alg_values_supported.

const (
	ES256 IDTokenSigningAlgValuesSupported = "ES256"
)

Defines values for IDTokenSigningAlgValuesSupported.

type InternalServerError

type InternalServerError = ErrorResponse

InternalServerError Represents error response

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type InvalidRequest

type InvalidRequest = ErrorResponse

InvalidRequest Represents error response

type JWK

type JWK struct {
	// Crv ECDSA
	Crv JWKCrv `json:"crv"`

	// Kid Key ID
	Kid string `json:"kid"`

	// Kty Key type ( Only supports elliptic curve key )
	Kty JWKKty `json:"kty"`

	// Use Public key use
	Use string `json:"use"`

	// X X coordinate of elliptic curve key
	X string `json:"x"`

	// Y Y coordinate of elliptic curve key
	Y string `json:"y"`
}

JWK JSON Web Key format

type JWKCrv

type JWKCrv string

JWKCrv ECDSA

const (
	P256 JWKCrv = "P-256"
)

Defines values for JWKCrv.

type JWKKty

type JWKKty string

JWKKty Key type ( Only supports elliptic curve key )

const (
	EC JWKKty = "EC"
)

Defines values for JWKKty.

type Jwks

type Jwks struct{}

func (*Jwks) ServeHTTP

func (j *Jwks) ServeHTTP(w http.ResponseWriter, r *http.Request)

type JwksResponse

type JwksResponse struct {
	// Keys The set of JSON Web Key
	Keys []JWK `json:"keys"`
}

JwksResponse Represents the set of JSON Web Key

type MaxAge

type MaxAge = uint64

MaxAge defines model for MaxAge.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

func InjectRequestParameter

func InjectRequestParameter() MiddlewareFunc

func RestoreSession

func RestoreSession(opt *option.Option) MiddlewareFunc

type MiddlewareFuncMap

type MiddlewareFuncMap struct {
	// contains filtered or unexported fields
}

func NewMiddlewareFuncMap

func NewMiddlewareFuncMap() *MiddlewareFuncMap

func (*MiddlewareFuncMap) SetAuthenticateMW

func (mfm *MiddlewareFuncMap) SetAuthenticateMW(mf ...MiddlewareFunc) *MiddlewareFuncMap

func (*MiddlewareFuncMap) SetAuthorizeMW

func (mfm *MiddlewareFuncMap) SetAuthorizeMW(mf ...MiddlewareFunc) *MiddlewareFuncMap

func (*MiddlewareFuncMap) SetCheckHealthMW

func (mfm *MiddlewareFuncMap) SetCheckHealthMW(mf ...MiddlewareFunc) *MiddlewareFuncMap

func (*MiddlewareFuncMap) SetConfigurationMW

func (mfm *MiddlewareFuncMap) SetConfigurationMW(mf ...MiddlewareFunc) *MiddlewareFuncMap

func (*MiddlewareFuncMap) SetConsentMW

func (mfm *MiddlewareFuncMap) SetConsentMW(mf ...MiddlewareFunc) *MiddlewareFuncMap

func (*MiddlewareFuncMap) SetJwksMW

func (mfm *MiddlewareFuncMap) SetJwksMW(mf ...MiddlewareFunc) *MiddlewareFuncMap

func (*MiddlewareFuncMap) SetRegisterMW

func (mfm *MiddlewareFuncMap) SetRegisterMW(mf ...MiddlewareFunc) *MiddlewareFuncMap

func (*MiddlewareFuncMap) SetTokenMW

func (mfm *MiddlewareFuncMap) SetTokenMW(mf ...MiddlewareFunc) *MiddlewareFuncMap

func (*MiddlewareFuncMap) SetUserInfoMW

func (mfm *MiddlewareFuncMap) SetUserInfoMW(mf ...MiddlewareFunc) *MiddlewareFuncMap

type MockAccessTokenParser

type MockAccessTokenParser struct {
	// contains filtered or unexported fields
}

MockAccessTokenParser is a mock of AccessTokenParser interface.

func NewMockAccessTokenParser

func NewMockAccessTokenParser(ctrl *gomock.Controller) *MockAccessTokenParser

NewMockAccessTokenParser creates a new mock instance.

func (*MockAccessTokenParser) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAccessTokenParser) ParseAccessToken

func (m *MockAccessTokenParser) ParseAccessToken(token string) (jwt.Token, error)

ParseAccessToken mocks base method.

type MockAccessTokenParserMockRecorder

type MockAccessTokenParserMockRecorder struct {
	// contains filtered or unexported fields
}

MockAccessTokenParserMockRecorder is the mock recorder for MockAccessTokenParser.

func (*MockAccessTokenParserMockRecorder) ParseAccessToken

func (mr *MockAccessTokenParserMockRecorder) ParseAccessToken(token any) *gomock.Call

ParseAccessToken indicates an expected call of ParseAccessToken.

type MockAuthCodeGrantAcceptor

type MockAuthCodeGrantAcceptor struct {
	// contains filtered or unexported fields
}

MockAuthCodeGrantAcceptor is a mock of AuthCodeGrantAcceptor interface.

func NewMockAuthCodeGrantAcceptor

func NewMockAuthCodeGrantAcceptor(ctrl *gomock.Controller) *MockAuthCodeGrantAcceptor

NewMockAuthCodeGrantAcceptor creates a new mock instance.

func (*MockAuthCodeGrantAcceptor) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAuthCodeGrantAcceptor) GenerateAccessToken

func (m *MockAuthCodeGrantAcceptor) GenerateAccessToken(uid typedef.UserID, claims map[string]any) (string, error)

GenerateAccessToken mocks base method.

func (*MockAuthCodeGrantAcceptor) GenerateIDToken

func (m *MockAuthCodeGrantAcceptor) GenerateIDToken(uid typedef.UserID, audiences []string, authTime time.Time, nonce string) (string, error)

GenerateIDToken mocks base method.

func (*MockAuthCodeGrantAcceptor) GenerateRefreshToken

func (m *MockAuthCodeGrantAcceptor) GenerateRefreshToken(uid typedef.UserID, claims map[string]any) (string, error)

GenerateRefreshToken mocks base method.

func (*MockAuthCodeGrantAcceptor) RevokeAuthCode

func (m *MockAuthCodeGrantAcceptor) RevokeAuthCode(ctx context.Context, code string, clientID typedef.ClientID) error

RevokeAuthCode mocks base method.

type MockAuthCodeGrantAcceptorMockRecorder

type MockAuthCodeGrantAcceptorMockRecorder struct {
	// contains filtered or unexported fields
}

MockAuthCodeGrantAcceptorMockRecorder is the mock recorder for MockAuthCodeGrantAcceptor.

func (*MockAuthCodeGrantAcceptorMockRecorder) GenerateAccessToken

func (mr *MockAuthCodeGrantAcceptorMockRecorder) GenerateAccessToken(uid, claims any) *gomock.Call

GenerateAccessToken indicates an expected call of GenerateAccessToken.

func (*MockAuthCodeGrantAcceptorMockRecorder) GenerateIDToken

func (mr *MockAuthCodeGrantAcceptorMockRecorder) GenerateIDToken(uid, audiences, authTime, nonce any) *gomock.Call

GenerateIDToken indicates an expected call of GenerateIDToken.

func (*MockAuthCodeGrantAcceptorMockRecorder) GenerateRefreshToken

func (mr *MockAuthCodeGrantAcceptorMockRecorder) GenerateRefreshToken(uid, claims any) *gomock.Call

GenerateRefreshToken indicates an expected call of GenerateRefreshToken.

func (*MockAuthCodeGrantAcceptorMockRecorder) RevokeAuthCode

func (mr *MockAuthCodeGrantAcceptorMockRecorder) RevokeAuthCode(ctx, code, clientID any) *gomock.Call

RevokeAuthCode indicates an expected call of RevokeAuthCode.

type MockAuthCodeRevoker

type MockAuthCodeRevoker struct {
	// contains filtered or unexported fields
}

MockAuthCodeRevoker is a mock of AuthCodeRevoker interface.

func NewMockAuthCodeRevoker

func NewMockAuthCodeRevoker(ctrl *gomock.Controller) *MockAuthCodeRevoker

NewMockAuthCodeRevoker creates a new mock instance.

func (*MockAuthCodeRevoker) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAuthCodeRevoker) RevokeAuthCode

func (m *MockAuthCodeRevoker) RevokeAuthCode(ctx context.Context, code string, clientID typedef.ClientID) error

RevokeAuthCode mocks base method.

type MockAuthCodeRevokerMockRecorder

type MockAuthCodeRevokerMockRecorder struct {
	// contains filtered or unexported fields
}

MockAuthCodeRevokerMockRecorder is the mock recorder for MockAuthCodeRevoker.

func (*MockAuthCodeRevokerMockRecorder) RevokeAuthCode

func (mr *MockAuthCodeRevokerMockRecorder) RevokeAuthCode(ctx, code, clientID any) *gomock.Call

RevokeAuthCode indicates an expected call of RevokeAuthCode.

type MockAuthenticator

type MockAuthenticator struct {
	// contains filtered or unexported fields
}

MockAuthenticator is a mock of Authenticator interface.

func NewMockAuthenticator

func NewMockAuthenticator(ctrl *gomock.Controller) *MockAuthenticator

NewMockAuthenticator creates a new mock instance.

func (*MockAuthenticator) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAuthenticator) VerifyConsent

func (m *MockAuthenticator) VerifyConsent(ctx context.Context, userID typedef.UserID, clientID typedef.ClientID) (bool, error)

VerifyConsent mocks base method.

func (*MockAuthenticator) VerifyPassword

func (m *MockAuthenticator) VerifyPassword(ctx context.Context, name, pw string) (typedef.UserID, error)

VerifyPassword mocks base method.

type MockAuthenticatorMockRecorder

type MockAuthenticatorMockRecorder struct {
	// contains filtered or unexported fields
}

MockAuthenticatorMockRecorder is the mock recorder for MockAuthenticator.

func (*MockAuthenticatorMockRecorder) VerifyConsent

func (mr *MockAuthenticatorMockRecorder) VerifyConsent(ctx, userID, clientID any) *gomock.Call

VerifyConsent indicates an expected call of VerifyConsent.

func (*MockAuthenticatorMockRecorder) VerifyPassword

func (mr *MockAuthenticatorMockRecorder) VerifyPassword(ctx, name, pw any) *gomock.Call

VerifyPassword indicates an expected call of VerifyPassword.

type MockAuthorizer

type MockAuthorizer struct {
	// contains filtered or unexported fields
}

MockAuthorizer is a mock of Authorizer interface.

func NewMockAuthorizer

func NewMockAuthorizer(ctrl *gomock.Controller) *MockAuthorizer

NewMockAuthorizer creates a new mock instance.

func (*MockAuthorizer) Authorize

func (m *MockAuthorizer) Authorize(ctx context.Context, clientID typedef.ClientID, redirectURI, state string) (*url.URL, string, error)

Authorize mocks base method.

func (*MockAuthorizer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAuthorizer) SaveAuthorizationRequestFingerprint

func (m *MockAuthorizer) SaveAuthorizationRequestFingerprint(ctx context.Context, clientID typedef.ClientID, redirectURI, nonce, authCode string) error

SaveAuthorizationRequestFingerprint mocks base method.

type MockAuthorizerMockRecorder

type MockAuthorizerMockRecorder struct {
	// contains filtered or unexported fields
}

MockAuthorizerMockRecorder is the mock recorder for MockAuthorizer.

func (*MockAuthorizerMockRecorder) Authorize

func (mr *MockAuthorizerMockRecorder) Authorize(ctx, clientID, redirectURI, state any) *gomock.Call

Authorize indicates an expected call of Authorize.

func (*MockAuthorizerMockRecorder) SaveAuthorizationRequestFingerprint

func (mr *MockAuthorizerMockRecorder) SaveAuthorizationRequestFingerprint(ctx, clientID, redirectURI, nonce, authCode any) *gomock.Call

SaveAuthorizationRequestFingerprint indicates an expected call of SaveAuthorizationRequestFingerprint.

type MockCacheStatusChecker

type MockCacheStatusChecker struct {
	// contains filtered or unexported fields
}

MockCacheStatusChecker is a mock of CacheStatusChecker interface.

func NewMockCacheStatusChecker

func NewMockCacheStatusChecker(ctrl *gomock.Controller) *MockCacheStatusChecker

NewMockCacheStatusChecker creates a new mock instance.

func (*MockCacheStatusChecker) CheckCacheStatus

func (m *MockCacheStatusChecker) CheckCacheStatus(ctx context.Context) error

CheckCacheStatus mocks base method.

func (*MockCacheStatusChecker) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockCacheStatusCheckerMockRecorder

type MockCacheStatusCheckerMockRecorder struct {
	// contains filtered or unexported fields
}

MockCacheStatusCheckerMockRecorder is the mock recorder for MockCacheStatusChecker.

func (*MockCacheStatusCheckerMockRecorder) CheckCacheStatus

func (mr *MockCacheStatusCheckerMockRecorder) CheckCacheStatus(ctx any) *gomock.Call

CheckCacheStatus indicates an expected call of CheckCacheStatus.

type MockConsentAcceptor

type MockConsentAcceptor struct {
	// contains filtered or unexported fields
}

MockConsentAcceptor is a mock of ConsentAcceptor interface.

func NewMockConsentAcceptor

func NewMockConsentAcceptor(ctrl *gomock.Controller) *MockConsentAcceptor

NewMockConsentAcceptor creates a new mock instance.

func (*MockConsentAcceptor) AcceptConsent

func (m *MockConsentAcceptor) AcceptConsent(ctx context.Context, userID typedef.UserID, clientID typedef.ClientID) error

AcceptConsent mocks base method.

func (*MockConsentAcceptor) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockConsentAcceptorMockRecorder

type MockConsentAcceptorMockRecorder struct {
	// contains filtered or unexported fields
}

MockConsentAcceptorMockRecorder is the mock recorder for MockConsentAcceptor.

func (*MockConsentAcceptorMockRecorder) AcceptConsent

func (mr *MockConsentAcceptorMockRecorder) AcceptConsent(ctx, userID, clientID any) *gomock.Call

AcceptConsent indicates an expected call of AcceptConsent.

type MockConsentVerifier

type MockConsentVerifier struct {
	// contains filtered or unexported fields
}

MockConsentVerifier is a mock of ConsentVerifier interface.

func NewMockConsentVerifier

func NewMockConsentVerifier(ctrl *gomock.Controller) *MockConsentVerifier

NewMockConsentVerifier creates a new mock instance.

func (*MockConsentVerifier) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockConsentVerifier) VerifyConsent

func (m *MockConsentVerifier) VerifyConsent(ctx context.Context, userID typedef.UserID, clientID typedef.ClientID) (bool, error)

VerifyConsent mocks base method.

type MockConsentVerifierMockRecorder

type MockConsentVerifierMockRecorder struct {
	// contains filtered or unexported fields
}

MockConsentVerifierMockRecorder is the mock recorder for MockConsentVerifier.

func (*MockConsentVerifierMockRecorder) VerifyConsent

func (mr *MockConsentVerifierMockRecorder) VerifyConsent(ctx, userID, clientID any) *gomock.Call

VerifyConsent indicates an expected call of VerifyConsent.

type MockCredentialValidator

type MockCredentialValidator struct {
	// contains filtered or unexported fields
}

MockCredentialValidator is a mock of CredentialValidator interface.

func NewMockCredentialValidator

func NewMockCredentialValidator(ctrl *gomock.Controller) *MockCredentialValidator

NewMockCredentialValidator creates a new mock instance.

func (*MockCredentialValidator) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCredentialValidator) ValidateCredential

func (m *MockCredentialValidator) ValidateCredential(ctx context.Context, clientID typedef.ClientID, clientSecret string) error

ValidateCredential mocks base method.

type MockCredentialValidatorMockRecorder

type MockCredentialValidatorMockRecorder struct {
	// contains filtered or unexported fields
}

MockCredentialValidatorMockRecorder is the mock recorder for MockCredentialValidator.

func (*MockCredentialValidatorMockRecorder) ValidateCredential

func (mr *MockCredentialValidatorMockRecorder) ValidateCredential(ctx, clientID, clientSecret any) *gomock.Call

ValidateCredential indicates an expected call of ValidateCredential.

type MockDBStatusChecker

type MockDBStatusChecker struct {
	// contains filtered or unexported fields
}

MockDBStatusChecker is a mock of DBStatusChecker interface.

func NewMockDBStatusChecker

func NewMockDBStatusChecker(ctrl *gomock.Controller) *MockDBStatusChecker

NewMockDBStatusChecker creates a new mock instance.

func (*MockDBStatusChecker) CheckDBStatus

func (m *MockDBStatusChecker) CheckDBStatus(ctx context.Context) error

CheckDBStatus mocks base method.

func (*MockDBStatusChecker) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockDBStatusCheckerMockRecorder

type MockDBStatusCheckerMockRecorder struct {
	// contains filtered or unexported fields
}

MockDBStatusCheckerMockRecorder is the mock recorder for MockDBStatusChecker.

func (*MockDBStatusCheckerMockRecorder) CheckDBStatus

func (mr *MockDBStatusCheckerMockRecorder) CheckDBStatus(ctx any) *gomock.Call

CheckDBStatus indicates an expected call of CheckDBStatus.

type MockHealthChecker

type MockHealthChecker struct {
	// contains filtered or unexported fields
}

MockHealthChecker is a mock of HealthChecker interface.

func NewMockHealthChecker

func NewMockHealthChecker(ctrl *gomock.Controller) *MockHealthChecker

NewMockHealthChecker creates a new mock instance.

func (*MockHealthChecker) CheckCacheStatus

func (m *MockHealthChecker) CheckCacheStatus(ctx context.Context) error

CheckCacheStatus mocks base method.

func (*MockHealthChecker) CheckDBStatus

func (m *MockHealthChecker) CheckDBStatus(ctx context.Context) error

CheckDBStatus mocks base method.

func (*MockHealthChecker) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockHealthCheckerMockRecorder

type MockHealthCheckerMockRecorder struct {
	// contains filtered or unexported fields
}

MockHealthCheckerMockRecorder is the mock recorder for MockHealthChecker.

func (*MockHealthCheckerMockRecorder) CheckCacheStatus

func (mr *MockHealthCheckerMockRecorder) CheckCacheStatus(ctx any) *gomock.Call

CheckCacheStatus indicates an expected call of CheckCacheStatus.

func (*MockHealthCheckerMockRecorder) CheckDBStatus

func (mr *MockHealthCheckerMockRecorder) CheckDBStatus(ctx any) *gomock.Call

CheckDBStatus indicates an expected call of CheckDBStatus.

type MockPasswordVerifier

type MockPasswordVerifier struct {
	// contains filtered or unexported fields
}

MockPasswordVerifier is a mock of PasswordVerifier interface.

func NewMockPasswordVerifier

func NewMockPasswordVerifier(ctrl *gomock.Controller) *MockPasswordVerifier

NewMockPasswordVerifier creates a new mock instance.

func (*MockPasswordVerifier) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPasswordVerifier) VerifyPassword

func (m *MockPasswordVerifier) VerifyPassword(ctx context.Context, name, pw string) (typedef.UserID, error)

VerifyPassword mocks base method.

type MockPasswordVerifierMockRecorder

type MockPasswordVerifierMockRecorder struct {
	// contains filtered or unexported fields
}

MockPasswordVerifierMockRecorder is the mock recorder for MockPasswordVerifier.

func (*MockPasswordVerifierMockRecorder) VerifyPassword

func (mr *MockPasswordVerifierMockRecorder) VerifyPassword(ctx, name, pw any) *gomock.Call

VerifyPassword indicates an expected call of VerifyPassword.

type MockRefreshTokenGrantAcceptor

type MockRefreshTokenGrantAcceptor struct {
	// contains filtered or unexported fields
}

MockRefreshTokenGrantAcceptor is a mock of RefreshTokenGrantAcceptor interface.

func NewMockRefreshTokenGrantAcceptor

func NewMockRefreshTokenGrantAcceptor(ctrl *gomock.Controller) *MockRefreshTokenGrantAcceptor

NewMockRefreshTokenGrantAcceptor creates a new mock instance.

func (*MockRefreshTokenGrantAcceptor) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRefreshTokenGrantAcceptor) ExtractUserID

func (m *MockRefreshTokenGrantAcceptor) ExtractUserID(refreshToken string) (typedef.UserID, error)

ExtractUserID mocks base method.

func (*MockRefreshTokenGrantAcceptor) GenerateAccessToken

func (m *MockRefreshTokenGrantAcceptor) GenerateAccessToken(uid typedef.UserID, claims map[string]any) (string, error)

GenerateAccessToken mocks base method.

func (*MockRefreshTokenGrantAcceptor) GenerateRefreshToken

func (m *MockRefreshTokenGrantAcceptor) GenerateRefreshToken(uid typedef.UserID, claims map[string]any) (string, error)

GenerateRefreshToken mocks base method.

func (*MockRefreshTokenGrantAcceptor) VerifyRefreshToken

func (m *MockRefreshTokenGrantAcceptor) VerifyRefreshToken(ctx context.Context, token string, clientID typedef.ClientID) error

VerifyRefreshToken mocks base method.

type MockRefreshTokenGrantAcceptorMockRecorder

type MockRefreshTokenGrantAcceptorMockRecorder struct {
	// contains filtered or unexported fields
}

MockRefreshTokenGrantAcceptorMockRecorder is the mock recorder for MockRefreshTokenGrantAcceptor.

func (*MockRefreshTokenGrantAcceptorMockRecorder) ExtractUserID

func (mr *MockRefreshTokenGrantAcceptorMockRecorder) ExtractUserID(refreshToken any) *gomock.Call

ExtractUserID indicates an expected call of ExtractUserID.

func (*MockRefreshTokenGrantAcceptorMockRecorder) GenerateAccessToken

func (mr *MockRefreshTokenGrantAcceptorMockRecorder) GenerateAccessToken(uid, claims any) *gomock.Call

GenerateAccessToken indicates an expected call of GenerateAccessToken.

func (*MockRefreshTokenGrantAcceptorMockRecorder) GenerateRefreshToken

func (mr *MockRefreshTokenGrantAcceptorMockRecorder) GenerateRefreshToken(uid, claims any) *gomock.Call

GenerateRefreshToken indicates an expected call of GenerateRefreshToken.

func (*MockRefreshTokenGrantAcceptorMockRecorder) VerifyRefreshToken

func (mr *MockRefreshTokenGrantAcceptorMockRecorder) VerifyRefreshToken(ctx, token, clientID any) *gomock.Call

VerifyRefreshToken indicates an expected call of VerifyRefreshToken.

type MockRefreshTokenVerifier

type MockRefreshTokenVerifier struct {
	// contains filtered or unexported fields
}

MockRefreshTokenVerifier is a mock of RefreshTokenVerifier interface.

func NewMockRefreshTokenVerifier

func NewMockRefreshTokenVerifier(ctrl *gomock.Controller) *MockRefreshTokenVerifier

NewMockRefreshTokenVerifier creates a new mock instance.

func (*MockRefreshTokenVerifier) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRefreshTokenVerifier) VerifyRefreshToken

func (m *MockRefreshTokenVerifier) VerifyRefreshToken(ctx context.Context, token string, clientID typedef.ClientID) error

VerifyRefreshToken mocks base method.

type MockRefreshTokenVerifierMockRecorder

type MockRefreshTokenVerifierMockRecorder struct {
	// contains filtered or unexported fields
}

MockRefreshTokenVerifierMockRecorder is the mock recorder for MockRefreshTokenVerifier.

func (*MockRefreshTokenVerifierMockRecorder) VerifyRefreshToken

func (mr *MockRefreshTokenVerifierMockRecorder) VerifyRefreshToken(ctx, token, clientID any) *gomock.Call

VerifyRefreshToken indicates an expected call of VerifyRefreshToken.

type MockRequestFingerprintSaver

type MockRequestFingerprintSaver struct {
	// contains filtered or unexported fields
}

MockRequestFingerprintSaver is a mock of RequestFingerprintSaver interface.

func NewMockRequestFingerprintSaver

func NewMockRequestFingerprintSaver(ctrl *gomock.Controller) *MockRequestFingerprintSaver

NewMockRequestFingerprintSaver creates a new mock instance.

func (*MockRequestFingerprintSaver) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRequestFingerprintSaver) SaveAuthorizationRequestFingerprint

func (m *MockRequestFingerprintSaver) SaveAuthorizationRequestFingerprint(ctx context.Context, clientID typedef.ClientID, redirectURI, nonce, authCode string) error

SaveAuthorizationRequestFingerprint mocks base method.

type MockRequestFingerprintSaverMockRecorder

type MockRequestFingerprintSaverMockRecorder struct {
	// contains filtered or unexported fields
}

MockRequestFingerprintSaverMockRecorder is the mock recorder for MockRequestFingerprintSaver.

func (*MockRequestFingerprintSaverMockRecorder) SaveAuthorizationRequestFingerprint

func (mr *MockRequestFingerprintSaverMockRecorder) SaveAuthorizationRequestFingerprint(ctx, clientID, redirectURI, nonce, authCode any) *gomock.Call

SaveAuthorizationRequestFingerprint indicates an expected call of SaveAuthorizationRequestFingerprint.

type MockTokenCacheReadWriter

type MockTokenCacheReadWriter struct {
	// contains filtered or unexported fields
}

MockTokenCacheReadWriter is a mock of TokenCacheReadWriter interface.

func NewMockTokenCacheReadWriter

func NewMockTokenCacheReadWriter(ctrl *gomock.Controller) *MockTokenCacheReadWriter

NewMockTokenCacheReadWriter creates a new mock instance.

func (*MockTokenCacheReadWriter) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTokenCacheReadWriter) ReadAuthorizationRequestFingerprint

func (m *MockTokenCacheReadWriter) ReadAuthorizationRequestFingerprint(ctx context.Context, clientID typedef.ClientID, authCode string) (*typedef.AuthorizationRequestFingerprint, error)

ReadAuthorizationRequestFingerprint mocks base method.

func (*MockTokenCacheReadWriter) WriteRefreshToken

func (m *MockTokenCacheReadWriter) WriteRefreshToken(ctx context.Context, token string, clientID typedef.ClientID, userID typedef.UserID) error

WriteRefreshToken mocks base method.

type MockTokenCacheReadWriterMockRecorder

type MockTokenCacheReadWriterMockRecorder struct {
	// contains filtered or unexported fields
}

MockTokenCacheReadWriterMockRecorder is the mock recorder for MockTokenCacheReadWriter.

func (*MockTokenCacheReadWriterMockRecorder) ReadAuthorizationRequestFingerprint

func (mr *MockTokenCacheReadWriterMockRecorder) ReadAuthorizationRequestFingerprint(ctx, clientID, authCode any) *gomock.Call

ReadAuthorizationRequestFingerprint indicates an expected call of ReadAuthorizationRequestFingerprint.

func (*MockTokenCacheReadWriterMockRecorder) WriteRefreshToken

func (mr *MockTokenCacheReadWriterMockRecorder) WriteRefreshToken(ctx, token, clientID, userID any) *gomock.Call

WriteRefreshToken indicates an expected call of WriteRefreshToken.

type MockUserIDExtractor

type MockUserIDExtractor struct {
	// contains filtered or unexported fields
}

MockUserIDExtractor is a mock of UserIDExtractor interface.

func NewMockUserIDExtractor

func NewMockUserIDExtractor(ctrl *gomock.Controller) *MockUserIDExtractor

NewMockUserIDExtractor creates a new mock instance.

func (*MockUserIDExtractor) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockUserIDExtractor) ExtractUserID

func (m *MockUserIDExtractor) ExtractUserID(refreshToken string) (typedef.UserID, error)

ExtractUserID mocks base method.

type MockUserIDExtractorMockRecorder

type MockUserIDExtractorMockRecorder struct {
	// contains filtered or unexported fields
}

MockUserIDExtractorMockRecorder is the mock recorder for MockUserIDExtractor.

func (*MockUserIDExtractorMockRecorder) ExtractUserID

func (mr *MockUserIDExtractorMockRecorder) ExtractUserID(refreshToken any) *gomock.Call

ExtractUserID indicates an expected call of ExtractUserID.

type MockUserInfoReader

type MockUserInfoReader struct {
	// contains filtered or unexported fields
}

MockUserInfoReader is a mock of UserInfoReader interface.

func NewMockUserInfoReader

func NewMockUserInfoReader(ctrl *gomock.Controller) *MockUserInfoReader

NewMockUserInfoReader creates a new mock instance.

func (*MockUserInfoReader) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockUserInfoReader) ReadUserInfo

func (m *MockUserInfoReader) ReadUserInfo(ctx context.Context, accessToken jwt.Token) (*entity.UserInfo, error)

ReadUserInfo mocks base method.

type MockUserInfoReaderMockRecorder

type MockUserInfoReaderMockRecorder struct {
	// contains filtered or unexported fields
}

MockUserInfoReaderMockRecorder is the mock recorder for MockUserInfoReader.

func (*MockUserInfoReaderMockRecorder) ReadUserInfo

func (mr *MockUserInfoReaderMockRecorder) ReadUserInfo(ctx, accessToken any) *gomock.Call

ReadUserInfo indicates an expected call of ReadUserInfo.

type MockUserRegisterer

type MockUserRegisterer struct {
	// contains filtered or unexported fields
}

MockUserRegisterer is a mock of UserRegisterer interface.

func NewMockUserRegisterer

func NewMockUserRegisterer(ctrl *gomock.Controller) *MockUserRegisterer

NewMockUserRegisterer creates a new mock instance.

func (*MockUserRegisterer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockUserRegisterer) RegisterUser

func (m *MockUserRegisterer) RegisterUser(ctx context.Context, name, pw string) (*entity.User, error)

RegisterUser mocks base method.

type MockUserRegistererMockRecorder

type MockUserRegistererMockRecorder struct {
	// contains filtered or unexported fields
}

MockUserRegistererMockRecorder is the mock recorder for MockUserRegisterer.

func (*MockUserRegistererMockRecorder) RegisterUser

func (mr *MockUserRegistererMockRecorder) RegisterUser(ctx, name, pw any) *gomock.Call

RegisterUser indicates an expected call of RegisterUser.

type Nonce

type Nonce = string

Nonce defines model for Nonce.

type OIDCError

type OIDCError struct {
	Error            xerr.OIDCError `json:"error,string"`
	ErrorDescription string         `json:"error_description,omitempty"`
	ErrorUri         string         `json:"error_uri,omitempty"`
}

type PasswordVerifier

type PasswordVerifier interface {
	VerifyPassword(ctx context.Context, name, pw string) (typedef.UserID, error)
}

type Prompt

type Prompt = string

Prompt defines model for Prompt.

type RedirectURI

type RedirectURI = string

RedirectURI defines model for RedirectUri.

type RefreshTokenVerifier

type RefreshTokenVerifier interface {
	VerifyRefreshToken(ctx context.Context, token string, clientID typedef.ClientID) error
}

type RegisterJSONBody

type RegisterJSONBody struct {
	Name     string `json:"name" validate:"required"`
	Password string `json:"password" validate:"required"`
}

RegisterJSONBody defines parameters for Register.

type RegisterJSONRequestBody

type RegisterJSONRequestBody RegisterJSONBody

RegisterJSONRequestBody defines body for Register for application/json ContentType.

type Registration

type Registration struct {
	// contains filtered or unexported fields
}

func (*Registration) ServeHTTP

func (rr *Registration) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RequestFingerprintSaver

type RequestFingerprintSaver interface {
	SaveAuthorizationRequestFingerprint(ctx context.Context, clientID typedef.ClientID, redirectURI, nonce, authCode string) error
}

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type Response

type Response struct {
	Status  int              `json:"status"`
	Summary xerr.PublicError `json:"summary"`
	Details []string         `json:"details,omitempty"`
}

type ResponseType

type ResponseType = string

ResponseType defines model for ResponseType.

type ResponseTypesSupported

type ResponseTypesSupported string

ResponseTypesSupported defines model for ConfigurationResponse.response_types_supported.

const (
	ResponseTypesSupportedCode ResponseTypesSupported = "code"
)

Defines values for ResponseTypesSupported.

type Scope

type Scope = string

Scope defines model for Scope.

type ScopesSupported

type ScopesSupported string

ScopesSupported defines model for ConfigurationResponse.scopes_supported.

const (
	Email   ScopesSupported = "email"
	Openid  ScopesSupported = "openid"
	Profile ScopesSupported = "profile"
)

Defines values for ScopesSupported.

type SessionId

type SessionId = string

SessionId defines model for SessionId.

type State

type State = string

State defines model for State.

type SubjectTypesSupported

type SubjectTypesSupported string

SubjectTypesSupported defines model for ConfigurationResponse.subject_types_supported.

const (
	Public SubjectTypesSupported = "public"
)

Defines values for SubjectTypesSupported.

type TOTP

type TOTP struct {
	Key string
	// contains filtered or unexported fields
}

func NewTOTP

func NewTOTP(key string) *TOTP

func (*TOTP) Verify

func (totp *TOTP) Verify(code string) (bool, error)

type Token

type Token struct {
	// contains filtered or unexported fields
}

func (*Token) ServeHTTP

func (t *Token) ServeHTTP(w http.ResponseWriter, r *http.Request)

type TokenEndpointAuthMethodsSupported

type TokenEndpointAuthMethodsSupported string

TokenEndpointAuthMethodsSupported defines model for ConfigurationResponse.token_endpoint_auth_methods_supported.

const (
	ClientSecretBasic TokenEndpointAuthMethodsSupported = "client_secret_basic"
)

Defines values for TokenEndpointAuthMethodsSupported.

type TokenErrorResponseError

type TokenErrorResponseError string

TokenErrorResponseError defines model for TokenErrorResponse.Error.

const (
	TokenErrorResponseErrorInvalidClient        TokenErrorResponseError = "invalid_client"
	TokenErrorResponseErrorInvalidGrant         TokenErrorResponseError = "invalid_grant"
	TokenErrorResponseErrorInvalidRequest       TokenErrorResponseError = "invalid_request"
	TokenErrorResponseErrorInvalidScope         TokenErrorResponseError = "invalid_scope"
	TokenErrorResponseErrorUnauthorizedClient   TokenErrorResponseError = "unauthorized_client"
	TokenErrorResponseErrorUnsupportedGrantType TokenErrorResponseError = "unsupported_grant_type"
)

Defines values for TokenErrorResponseError.

type TokenFormdataBody

type TokenFormdataBody struct {
	// Code Represents "code" parameter
	Code *string `form:"code" json:"code" schema:"code" validate:"omitempty,alphanum"`

	// GrantType Represents "grant_type" parameter
	GrantType typedef.GrantType `form:"grant_type" json:"grant_type" schema:"grant_type" validate:"required,grant-type-validator"`

	// RedirectURI Represents "redirect_uri" parameter
	RedirectURI *string `form:"redirect_uri" json:"redirect_uri" schema:"redirect_uri" validate:"omitempty,url_encoded"`

	// RefreshToken Represents "refresh_token" parameter
	RefreshToken *string `form:"refresh_token" json:"refresh_token" schema:"refresh_token" validate:"omitempty,jwt"`
}

TokenFormdataBody defines parameters for Token.

type TokenFormdataRequestBody

type TokenFormdataRequestBody TokenFormdataBody

TokenFormdataRequestBody defines body for Token for application/x-www-form-urlencoded ContentType.

type TokenParams

type TokenParams struct {
	// Sid Session ID
	Sid *SessionId `form:"sid,omitempty" json:"-" url:"sid"`
}

TokenParams defines parameters for Token.

type TokenResponse

type TokenResponse struct {
	AccessToken  string            `json:"access_token"`
	ExpiresIn    uint64            `json:"expires_in"`
	IDToken      *string           `json:"id_token,omitempty"`
	RefreshToken string            `json:"refresh_token"`
	TokenType    typedef.TokenType `json:"token_type"`
}

TokenResponse ...

type TokenSet

type TokenSet struct {
	AccessToken  string
	RefreshToken string
	IDToken      string
}

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UILocalesSupported

type UILocalesSupported string

UILocalesSupported defines model for ConfigurationResponse.ui_locales_supported.

const (
	JaJP UILocalesSupported = "ja-JP"
)

Defines values for UILocalesSupported.

type UnauthorizedRequest

type UnauthorizedRequest = ErrorResponse

UnauthorizedRequest Represents error response

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type User

type User struct {
	ID   typedef.UserID `json:"id" validate:"required"`
	Name string         `json:"name" validate:"required"`
}

User defines model for User.

type UserIDExtractor

type UserIDExtractor interface {
	ExtractUserID(refreshToken string) (typedef.UserID, error)
}

type UserInfo

type UserInfo struct {
	// contains filtered or unexported fields
}

func (*UserInfo) ServeHTTP

func (ui *UserInfo) ServeHTTP(w http.ResponseWriter, r *http.Request)

type UserInfoReader

type UserInfoReader interface {
	ReadUserInfo(ctx context.Context, accessToken jwt.Token) (*entity.UserInfo, error)
}

type UserInfoResponse

type UserInfoResponse struct {
	Name *string `json:"name,omitempty"`
	Sub  *uint64 `json:"sub,omitempty"`
}

UserInfoResponse Represents user information

type UserName

type UserName struct {
	Name string `json:"name" validate:"required"`
}

UserName Represents a part of user data.

type UserPassword

type UserPassword struct {
	Password string `json:"password" validate:"required"`
}

UserPassword Represents the password of user

type UserRegisterer

type UserRegisterer interface {
	RegisterUser(ctx context.Context, name, pw string) (*entity.User, error)
}

Jump to

Keyboard shortcuts

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