Documentation ¶
Index ¶
- type AttestationStatement
- type AuthData
- type AuthFlags
- type AuthenticationController
- type AuthenticationSelection
- type AuthenticationService
- func (s *AuthenticationService) InitiateAuthentication(ctx context.Context, request *InitiateAuthenticationRequest) (CredentialOptions, error)
- func (s *AuthenticationService) IssueGrant(ctx context.Context, user *domain.User) (*Success, error)
- func (s *AuthenticationService) Login(ctx context.Context, request *RequestCredentialRequest) (*Success, error)
- func (s *AuthenticationService) Register(ctx context.Context, request *CreateCredentialRequest) (*Success, error)
- type CreateCredentialRequest
- type CreationCredentialResponse
- type CredentialCreationOptions
- type CredentialOptions
- type CredentialRequestOptions
- type CredentialResponse
- type InitiateAuthenticationRequest
- type PublicKey
- type PublicKeyCredentialCreationOptions
- func (options *PublicKeyCredentialCreationOptions) ValidateAttestationObject(attestationObject attestationObject) error
- func (options *PublicKeyCredentialCreationOptions) ValidateAuthenticatorData(authenticatorData AuthData) error
- func (options *PublicKeyCredentialCreationOptions) ValidateClientData(clientData clientData) error
- type PublicKeyCredentialDescriptor
- type PublicKeyCredentialOptions
- type PublicKeyCredentialParameters
- type PublicKeyCredentialRequestOptions
- func (options *PublicKeyCredentialRequestOptions) ValidateAttestationObject(attestationObject attestationObject) error
- func (options *PublicKeyCredentialRequestOptions) ValidateAuthenticatorData(authenticatorData AuthData) error
- func (options *PublicKeyCredentialRequestOptions) ValidateClientData(clientData clientData) error
- type PublicKeyCredentialRpEntity
- type PublicKeyCredentialUserEntity
- type RawAttestationObject
- type RawClientDataJSON
- type RawCreateCredentialResponse
- type RawRequestCredentialResponse
- type RequestCredentialRequest
- type RequestCredentialResponse
- type Success
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttestationStatement ¶
type AuthenticationController ¶
type AuthenticationController struct {
// contains filtered or unexported fields
}
func NewAuthenticationController ¶
func NewAuthenticationController(service *AuthenticationService) *AuthenticationController
func (*AuthenticationController) RegisterRoutes ¶
func (c *AuthenticationController) RegisterRoutes(router gin.IRoutes)
type AuthenticationSelection ¶
type AuthenticationService ¶
type AuthenticationService struct {
// contains filtered or unexported fields
}
func NewAuthenticationService ¶
func NewAuthenticationService( initAuthenticationStore core.KeyValueStore[string, CredentialOptions], authenticationVerifierStore core.KeyValueStore[string, []byte], userService *domain.UserService, credentialService *domain.CredentialService, ) *AuthenticationService
func (*AuthenticationService) InitiateAuthentication ¶
func (s *AuthenticationService) InitiateAuthentication(ctx context.Context, request *InitiateAuthenticationRequest) (CredentialOptions, error)
func (*AuthenticationService) IssueGrant ¶
func (*AuthenticationService) Login ¶
func (s *AuthenticationService) Login(ctx context.Context, request *RequestCredentialRequest) (*Success, error)
func (*AuthenticationService) Register ¶
func (s *AuthenticationService) Register(ctx context.Context, request *CreateCredentialRequest) (*Success, error)
type CreateCredentialRequest ¶
type CreateCredentialRequest struct { AuthenticationID string `json:"authenticationId"` Id string `json:"id"` RawID []byte `json:"rawId"` Type string `json:"type"` Response RawCreateCredentialResponse `json:"response"` }
type CreationCredentialResponse ¶
type CreationCredentialResponse struct { ClientData clientData AttestationObject attestationObject }
func (*CreationCredentialResponse) Validate ¶
func (response *CreationCredentialResponse) Validate(options PublicKeyCredentialOptions, credential *domain.Credential) error
type CredentialCreationOptions ¶
type CredentialCreationOptions struct { AuthenticationId string `json:"authenticationId"` Type string `json:"type"` Options PublicKeyCredentialCreationOptions `json:"publicKey"` }
func (*CredentialCreationOptions) GetAuthenticationID ¶
func (options *CredentialCreationOptions) GetAuthenticationID() string
func (*CredentialCreationOptions) GetOptions ¶
func (options *CredentialCreationOptions) GetOptions() PublicKeyCredentialOptions
func (*CredentialCreationOptions) GetUserID ¶
func (options *CredentialCreationOptions) GetUserID() []byte
func (*CredentialCreationOptions) IsCreationOptions ¶
func (options *CredentialCreationOptions) IsCreationOptions() bool
type CredentialOptions ¶
type CredentialOptions interface { GetUserID() []byte GetAuthenticationID() string IsCreationOptions() bool GetOptions() PublicKeyCredentialOptions }
type CredentialRequestOptions ¶
type CredentialRequestOptions struct { AuthenticationId string `json:"authenticationId"` Type string `json:"type"` Options PublicKeyCredentialRequestOptions `json:"publicKey"` }
func (*CredentialRequestOptions) GetAuthenticationID ¶
func (options *CredentialRequestOptions) GetAuthenticationID() string
func (*CredentialRequestOptions) GetOptions ¶
func (options *CredentialRequestOptions) GetOptions() PublicKeyCredentialOptions
func (*CredentialRequestOptions) GetUserID ¶
func (options *CredentialRequestOptions) GetUserID() []byte
func (*CredentialRequestOptions) IsCreationOptions ¶
func (options *CredentialRequestOptions) IsCreationOptions() bool
type CredentialResponse ¶
type CredentialResponse interface {
Validate(options CredentialOptions, credential *domain.Credential) error
}
type InitiateAuthenticationRequest ¶
type InitiateAuthenticationRequest struct { // The unique identifier selected by the user // // Never print this value in plain text UserId string `json:"userId"` }
Request object to initiate an authentication flow,
type PublicKeyCredentialCreationOptions ¶
type PublicKeyCredentialCreationOptions struct { Challenge []byte `json:"challenge"` RelyingParty PublicKeyCredentialRpEntity `json:"rp"` User PublicKeyCredentialUserEntity `json:"user"` PublicKeyCredentialParams []PublicKeyCredentialParameters `json:"pubKeyCredParams"` AuthenticationSelection AuthenticationSelection `json:"authenticatorSelection"` Timeout uint64 `json:"timeout"` Attestation string `json:"attestation"` AttestationFormats []string `json:"attestationFormats"` }
func (*PublicKeyCredentialCreationOptions) ValidateAttestationObject ¶
func (options *PublicKeyCredentialCreationOptions) ValidateAttestationObject(attestationObject attestationObject) error
func (*PublicKeyCredentialCreationOptions) ValidateAuthenticatorData ¶
func (options *PublicKeyCredentialCreationOptions) ValidateAuthenticatorData(authenticatorData AuthData) error
func (*PublicKeyCredentialCreationOptions) ValidateClientData ¶
func (options *PublicKeyCredentialCreationOptions) ValidateClientData(clientData clientData) error
type PublicKeyCredentialRequestOptions ¶
type PublicKeyCredentialRequestOptions struct { UserId []byte `json:"-"` Challenge []byte `json:"challenge"` RpID string `json:"rpId"` Timeout uint64 `json:"timeout"` UserVerification string `json:"userVerification"` Attestation string `json:"attestation"` AttestationFormats []string `json:"attestationFormats"` AllowCredentials []PublicKeyCredentialDescriptor `json:"allowCredentials"` }
func (*PublicKeyCredentialRequestOptions) ValidateAttestationObject ¶
func (options *PublicKeyCredentialRequestOptions) ValidateAttestationObject(attestationObject attestationObject) error
func (*PublicKeyCredentialRequestOptions) ValidateAuthenticatorData ¶
func (options *PublicKeyCredentialRequestOptions) ValidateAuthenticatorData(authenticatorData AuthData) error
func (*PublicKeyCredentialRequestOptions) ValidateClientData ¶
func (options *PublicKeyCredentialRequestOptions) ValidateClientData(clientData clientData) error
type RawAttestationObject ¶
type RawAttestationObject []byte
func (RawAttestationObject) Decode ¶
func (attestation RawAttestationObject) Decode() (*attestationObject, error)
type RawClientDataJSON ¶
type RawClientDataJSON []byte
type RawCreateCredentialResponse ¶
type RawCreateCredentialResponse struct { ClientDataJSON RawClientDataJSON `json:"clientDataJSON"` AttestationObject RawAttestationObject `json:"attestationObject"` }
type RawRequestCredentialResponse ¶
type RawRequestCredentialResponse struct { ClientDataJSON RawClientDataJSON `json:"clientDataJSON"` AuthenticatorData []byte `json:"authenticatorData"` Signature []byte `json:"signature"` UserHandle []byte `json:"userHandle"` }
type RequestCredentialRequest ¶
type RequestCredentialRequest struct { AuthenticationID string `json:"authenticationId"` Id string `json:"id"` RawID []byte `json:"rawId"` Type string `json:"type"` Response RawRequestCredentialResponse `json:"response"` }
type RequestCredentialResponse ¶
type RequestCredentialResponse struct { ClientData clientData AuthenticatorData AuthData Signature []byte UserHandle []byte }
func (*RequestCredentialResponse) Validate ¶
func (response *RequestCredentialResponse) Validate(options PublicKeyCredentialOptions, credential *domain.Credential) error
type Success ¶
type Success struct { AccessToken *domain.AccessToken `json:"accessToken"` RefreshToken *domain.RefreshToken `json:"refreshToken"` }
Click to show internal directories.
Click to hide internal directories.