Documentation
¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Alg
- func (Alg) AllValues() []Alg
- func (s *Alg) Decode(d *jx.Decoder) error
- func (s Alg) Encode(e *jx.Encoder)
- func (s Alg) MarshalJSON() ([]byte, error)
- func (s Alg) MarshalText() ([]byte, error)
- func (s *Alg) UnmarshalJSON(data []byte) error
- func (s *Alg) UnmarshalText(data []byte) error
- func (s Alg) Validate() error
- type BearerAuth
- type CheckSessionRes
- type Claims
- func (s *Claims) Decode(d *jx.Decoder) error
- func (s *Claims) Encode(e *jx.Encoder)
- func (s *Claims) GetRefreshTokenID() OptString
- func (s *Claims) GetRoles() []Role
- func (s *Claims) GetUserID() OptUUID
- func (s *Claims) MarshalJSON() ([]byte, error)
- func (s *Claims) SetRefreshTokenID(val OptString)
- func (s *Claims) SetRoles(val []Role)
- func (s *Claims) SetUserID(val OptUUID)
- func (s *Claims) UnmarshalJSON(data []byte) error
- func (s *Claims) Validate() error
- type Client
- func (c *Client) CheckSession(ctx context.Context) (CheckSessionRes, error)
- func (c *Client) CreateAnonSession(ctx context.Context) (CreateAnonSessionRes, error)
- func (c *Client) CreateRefreshToken(ctx context.Context) (CreateRefreshTokenRes, error)
- func (c *Client) CreateSession(ctx context.Context, request *LoginForm) (CreateSessionRes, error)
- func (c *Client) EmailExists(ctx context.Context, params EmailExistsParams) (EmailExistsRes, error)
- func (c *Client) GetPublicKey(ctx context.Context, params GetPublicKeyParams) (GetPublicKeyRes, error)
- func (c *Client) Healthcheck(ctx context.Context) (HealthcheckRes, error)
- func (c *Client) ListPublicKeys(ctx context.Context, params ListPublicKeysParams) (ListPublicKeysRes, error)
- func (c *Client) ListUsers(ctx context.Context, params ListUsersParams) (ListUsersRes, error)
- func (c *Client) Ping(ctx context.Context) (PingRes, error)
- func (c *Client) RefreshSession(ctx context.Context, params RefreshSessionParams) (RefreshSessionRes, error)
- func (c *Client) Register(ctx context.Context, request *RegisterForm) (RegisterRes, error)
- func (c *Client) RequestEmailUpdate(ctx context.Context, request *RequestEmailUpdateForm) (RequestEmailUpdateRes, error)
- func (c *Client) RequestPasswordReset(ctx context.Context, request *RequestPasswordResetForm) (RequestPasswordResetRes, error)
- func (c *Client) RequestRegistration(ctx context.Context, request *RequestRegistrationForm) (RequestRegistrationRes, error)
- func (c *Client) ResetPassword(ctx context.Context, request *ResetPasswordForm) (ResetPasswordRes, error)
- func (c *Client) UpdateEmail(ctx context.Context, request *UpdateEmailForm) (UpdateEmailRes, error)
- func (c *Client) UpdatePassword(ctx context.Context, request *UpdatePasswordForm) (UpdatePasswordRes, error)
- func (c *Client) UpdateRole(ctx context.Context, request *UpdateRoleForm) (UpdateRoleRes, error)
- type ClientOption
- type ConflictError
- type CreateAnonSessionIMATeapot
- type CreateAnonSessionRes
- type CreateRefreshTokenRes
- type CreateSessionRes
- type CredentialsRole
- func (CredentialsRole) AllValues() []CredentialsRole
- func (s *CredentialsRole) Decode(d *jx.Decoder) error
- func (s CredentialsRole) Encode(e *jx.Encoder)
- func (s CredentialsRole) MarshalJSON() ([]byte, error)
- func (s CredentialsRole) MarshalText() ([]byte, error)
- func (s *CredentialsRole) UnmarshalJSON(data []byte) error
- func (s *CredentialsRole) UnmarshalText(data []byte) error
- func (s CredentialsRole) Validate() error
- type Dependency
- func (s *Dependency) Decode(d *jx.Decoder) error
- func (s *Dependency) Encode(e *jx.Encoder)
- func (s *Dependency) GetAdditionalProps() DependencyAdditional
- func (s *Dependency) GetName() string
- func (s *Dependency) GetStatus() DependencyStatus
- func (s *Dependency) MarshalJSON() ([]byte, error)
- func (s *Dependency) SetAdditionalProps(val DependencyAdditional)
- func (s *Dependency) SetName(val string)
- func (s *Dependency) SetStatus(val DependencyStatus)
- func (s *Dependency) UnmarshalJSON(data []byte) error
- func (s *Dependency) Validate() error
- type DependencyAdditional
- type DependencyStatus
- func (DependencyStatus) AllValues() []DependencyStatus
- func (s *DependencyStatus) Decode(d *jx.Decoder) error
- func (s DependencyStatus) Encode(e *jx.Encoder)
- func (s DependencyStatus) MarshalJSON() ([]byte, error)
- func (s DependencyStatus) MarshalText() ([]byte, error)
- func (s *DependencyStatus) UnmarshalJSON(data []byte) error
- func (s *DependencyStatus) UnmarshalText(data []byte) error
- func (s DependencyStatus) Validate() error
- type Email
- type EmailExistsNoContent
- type EmailExistsParams
- type EmailExistsRes
- type ErrorHandler
- type ForbiddenError
- func (s *ForbiddenError) Decode(d *jx.Decoder) error
- func (s *ForbiddenError) Encode(e *jx.Encoder)
- func (s *ForbiddenError) GetError() string
- func (s *ForbiddenError) MarshalJSON() ([]byte, error)
- func (s *ForbiddenError) SetError(val string)
- func (s *ForbiddenError) UnmarshalJSON(data []byte) error
- type GetPublicKeyParams
- type GetPublicKeyRes
- type Handler
- type Health
- func (s *Health) Decode(d *jx.Decoder) error
- func (s *Health) Encode(e *jx.Encoder)
- func (s *Health) GetPostgres() Dependency
- func (s *Health) MarshalJSON() ([]byte, error)
- func (s *Health) SetPostgres(val Dependency)
- func (s *Health) UnmarshalJSON(data []byte) error
- func (s *Health) Validate() error
- type HealthcheckIMATeapot
- type HealthcheckRes
- type Invoker
- type JWK
- func (s *JWK) Decode(d *jx.Decoder) error
- func (s *JWK) Encode(e *jx.Encoder)
- func (s *JWK) GetAdditionalProps() JWKAdditional
- func (s *JWK) GetAlg() Alg
- func (s *JWK) GetKeyOps() []KeyOp
- func (s *JWK) GetKid() OptKID
- func (s *JWK) GetKty() KTY
- func (s *JWK) GetUse() Use
- func (s *JWK) MarshalJSON() ([]byte, error)
- func (s *JWK) SetAdditionalProps(val JWKAdditional)
- func (s *JWK) SetAlg(val Alg)
- func (s *JWK) SetKeyOps(val []KeyOp)
- func (s *JWK) SetKid(val OptKID)
- func (s *JWK) SetKty(val KTY)
- func (s *JWK) SetUse(val Use)
- func (s *JWK) UnmarshalJSON(data []byte) error
- func (s *JWK) Validate() error
- type JWKAdditional
- type KID
- type KTY
- func (KTY) AllValues() []KTY
- func (s *KTY) Decode(d *jx.Decoder) error
- func (s KTY) Encode(e *jx.Encoder)
- func (s KTY) MarshalJSON() ([]byte, error)
- func (s KTY) MarshalText() ([]byte, error)
- func (s *KTY) UnmarshalJSON(data []byte) error
- func (s *KTY) UnmarshalText(data []byte) error
- func (s KTY) Validate() error
- type KeyOp
- func (KeyOp) AllValues() []KeyOp
- func (s *KeyOp) Decode(d *jx.Decoder) error
- func (s KeyOp) Encode(e *jx.Encoder)
- func (s KeyOp) MarshalJSON() ([]byte, error)
- func (s KeyOp) MarshalText() ([]byte, error)
- func (s *KeyOp) UnmarshalJSON(data []byte) error
- func (s *KeyOp) UnmarshalText(data []byte) error
- func (s KeyOp) Validate() error
- type KeyUsage
- type Labeler
- type Lang
- func (Lang) AllValues() []Lang
- func (s *Lang) Decode(d *jx.Decoder) error
- func (s Lang) Encode(e *jx.Encoder)
- func (s Lang) MarshalJSON() ([]byte, error)
- func (s Lang) MarshalText() ([]byte, error)
- func (s *Lang) UnmarshalJSON(data []byte) error
- func (s *Lang) UnmarshalText(data []byte) error
- func (s Lang) Validate() error
- type ListPublicKeysOKApplicationJSON
- func (s *ListPublicKeysOKApplicationJSON) Decode(d *jx.Decoder) error
- func (s ListPublicKeysOKApplicationJSON) Encode(e *jx.Encoder)
- func (s ListPublicKeysOKApplicationJSON) MarshalJSON() ([]byte, error)
- func (s *ListPublicKeysOKApplicationJSON) UnmarshalJSON(data []byte) error
- func (s ListPublicKeysOKApplicationJSON) Validate() error
- type ListPublicKeysParams
- type ListPublicKeysRes
- type ListUsersOKApplicationJSON
- func (s *ListUsersOKApplicationJSON) Decode(d *jx.Decoder) error
- func (s ListUsersOKApplicationJSON) Encode(e *jx.Encoder)
- func (s ListUsersOKApplicationJSON) MarshalJSON() ([]byte, error)
- func (s *ListUsersOKApplicationJSON) UnmarshalJSON(data []byte) error
- func (s ListUsersOKApplicationJSON) Validate() error
- type ListUsersParams
- type ListUsersRes
- type LoginForm
- func (s *LoginForm) Decode(d *jx.Decoder) error
- func (s *LoginForm) Encode(e *jx.Encoder)
- func (s *LoginForm) GetEmail() Email
- func (s *LoginForm) GetPassword() Password
- func (s *LoginForm) MarshalJSON() ([]byte, error)
- func (s *LoginForm) SetEmail(val Email)
- func (s *LoginForm) SetPassword(val Password)
- func (s *LoginForm) UnmarshalJSON(data []byte) error
- func (s *LoginForm) Validate() error
- type Middleware
- type NotFoundError
- type OperationName
- type OptInt
- type OptKID
- func (o *OptKID) Decode(d *jx.Decoder) error
- func (o OptKID) Encode(e *jx.Encoder)
- func (o OptKID) Get() (v KID, ok bool)
- func (o OptKID) IsSet() bool
- func (s OptKID) MarshalJSON() ([]byte, error)
- func (o OptKID) Or(d KID) KID
- func (o *OptKID) Reset()
- func (o *OptKID) SetTo(v KID)
- func (s *OptKID) UnmarshalJSON(data []byte) error
- type OptLang
- func (o *OptLang) Decode(d *jx.Decoder) error
- func (o OptLang) Encode(e *jx.Encoder)
- func (o OptLang) Get() (v Lang, ok bool)
- func (o OptLang) IsSet() bool
- func (s OptLang) MarshalJSON() ([]byte, error)
- func (o OptLang) Or(d Lang) Lang
- func (o *OptLang) Reset()
- func (o *OptLang) SetTo(v Lang)
- func (s *OptLang) UnmarshalJSON(data []byte) error
- type OptString
- func (o *OptString) Decode(d *jx.Decoder) error
- func (o OptString) Encode(e *jx.Encoder)
- func (o OptString) Get() (v string, ok bool)
- func (o OptString) IsSet() bool
- func (s OptString) MarshalJSON() ([]byte, error)
- func (o OptString) Or(d string) string
- func (o *OptString) Reset()
- func (o *OptString) SetTo(v string)
- func (s *OptString) UnmarshalJSON(data []byte) error
- type OptUUID
- func (o *OptUUID) Decode(d *jx.Decoder) error
- func (o OptUUID) Encode(e *jx.Encoder)
- func (o OptUUID) Get() (v uuid.UUID, ok bool)
- func (o OptUUID) IsSet() bool
- func (s OptUUID) MarshalJSON() ([]byte, error)
- func (o OptUUID) Or(d uuid.UUID) uuid.UUID
- func (o *OptUUID) Reset()
- func (o *OptUUID) SetTo(v uuid.UUID)
- func (s *OptUUID) UnmarshalJSON(data []byte) error
- type Option
- type Password
- type PingIMATeapot
- type PingOK
- type PingRes
- type RefreshSessionParams
- type RefreshSessionRes
- type RefreshToken
- func (s *RefreshToken) Decode(d *jx.Decoder) error
- func (s *RefreshToken) Encode(e *jx.Encoder)
- func (s *RefreshToken) GetRefreshToken() string
- func (s *RefreshToken) MarshalJSON() ([]byte, error)
- func (s *RefreshToken) SetRefreshToken(val string)
- func (s *RefreshToken) UnmarshalJSON(data []byte) error
- type RegisterForm
- func (s *RegisterForm) Decode(d *jx.Decoder) error
- func (s *RegisterForm) Encode(e *jx.Encoder)
- func (s *RegisterForm) GetEmail() Email
- func (s *RegisterForm) GetPassword() Password
- func (s *RegisterForm) GetShortCode() ShortCode
- func (s *RegisterForm) MarshalJSON() ([]byte, error)
- func (s *RegisterForm) SetEmail(val Email)
- func (s *RegisterForm) SetPassword(val Password)
- func (s *RegisterForm) SetShortCode(val ShortCode)
- func (s *RegisterForm) UnmarshalJSON(data []byte) error
- func (s *RegisterForm) Validate() error
- type RegisterRes
- type RequestEmailUpdateForm
- func (s *RequestEmailUpdateForm) Decode(d *jx.Decoder) error
- func (s *RequestEmailUpdateForm) Encode(e *jx.Encoder)
- func (s *RequestEmailUpdateForm) GetEmail() Email
- func (s *RequestEmailUpdateForm) GetLang() OptLang
- func (s *RequestEmailUpdateForm) MarshalJSON() ([]byte, error)
- func (s *RequestEmailUpdateForm) SetEmail(val Email)
- func (s *RequestEmailUpdateForm) SetLang(val OptLang)
- func (s *RequestEmailUpdateForm) UnmarshalJSON(data []byte) error
- func (s *RequestEmailUpdateForm) Validate() error
- type RequestEmailUpdateNoContent
- type RequestEmailUpdateRes
- type RequestPasswordResetForm
- func (s *RequestPasswordResetForm) Decode(d *jx.Decoder) error
- func (s *RequestPasswordResetForm) Encode(e *jx.Encoder)
- func (s *RequestPasswordResetForm) GetEmail() Email
- func (s *RequestPasswordResetForm) GetLang() OptLang
- func (s *RequestPasswordResetForm) MarshalJSON() ([]byte, error)
- func (s *RequestPasswordResetForm) SetEmail(val Email)
- func (s *RequestPasswordResetForm) SetLang(val OptLang)
- func (s *RequestPasswordResetForm) UnmarshalJSON(data []byte) error
- func (s *RequestPasswordResetForm) Validate() error
- type RequestPasswordResetNoContent
- type RequestPasswordResetRes
- type RequestRegistrationForm
- func (s *RequestRegistrationForm) Decode(d *jx.Decoder) error
- func (s *RequestRegistrationForm) Encode(e *jx.Encoder)
- func (s *RequestRegistrationForm) GetEmail() Email
- func (s *RequestRegistrationForm) GetLang() OptLang
- func (s *RequestRegistrationForm) MarshalJSON() ([]byte, error)
- func (s *RequestRegistrationForm) SetEmail(val Email)
- func (s *RequestRegistrationForm) SetLang(val OptLang)
- func (s *RequestRegistrationForm) UnmarshalJSON(data []byte) error
- func (s *RequestRegistrationForm) Validate() error
- type RequestRegistrationIMATeapot
- type RequestRegistrationNoContent
- type RequestRegistrationRes
- type ResetPasswordForm
- func (s *ResetPasswordForm) Decode(d *jx.Decoder) error
- func (s *ResetPasswordForm) Encode(e *jx.Encoder)
- func (s *ResetPasswordForm) GetPassword() Password
- func (s *ResetPasswordForm) GetShortCode() ShortCode
- func (s *ResetPasswordForm) GetUserID() UserID
- func (s *ResetPasswordForm) MarshalJSON() ([]byte, error)
- func (s *ResetPasswordForm) SetPassword(val Password)
- func (s *ResetPasswordForm) SetShortCode(val ShortCode)
- func (s *ResetPasswordForm) SetUserID(val UserID)
- func (s *ResetPasswordForm) UnmarshalJSON(data []byte) error
- func (s *ResetPasswordForm) Validate() error
- type ResetPasswordNoContent
- type ResetPasswordRes
- type Role
- type Route
- type SecurityHandler
- type SecuritySource
- type Server
- type ServerOption
- func WithErrorHandler(h ErrorHandler) ServerOption
- func WithMaxMultipartMemory(max int64) ServerOption
- func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
- func WithMiddleware(m ...Middleware) ServerOption
- func WithNotFound(notFound http.HandlerFunc) ServerOption
- func WithPathPrefix(prefix string) ServerOption
- type ShortCode
- type Token
- type UnauthorizedError
- func (s *UnauthorizedError) Decode(d *jx.Decoder) error
- func (s *UnauthorizedError) Encode(e *jx.Encoder)
- func (s *UnauthorizedError) GetError() string
- func (s *UnauthorizedError) MarshalJSON() ([]byte, error)
- func (s *UnauthorizedError) SetError(val string)
- func (s *UnauthorizedError) UnmarshalJSON(data []byte) error
- type UnexpectedError
- func (s *UnexpectedError) Decode(d *jx.Decoder) error
- func (s *UnexpectedError) Encode(e *jx.Encoder)
- func (s *UnexpectedError) GetError() string
- func (s *UnexpectedError) MarshalJSON() ([]byte, error)
- func (s *UnexpectedError) SetError(val string)
- func (s *UnexpectedError) UnmarshalJSON(data []byte) error
- type UnexpectedErrorStatusCode
- func (s *UnexpectedErrorStatusCode) Error() string
- func (s *UnexpectedErrorStatusCode) GetResponse() UnexpectedError
- func (s *UnexpectedErrorStatusCode) GetStatusCode() int
- func (s *UnexpectedErrorStatusCode) SetResponse(val UnexpectedError)
- func (s *UnexpectedErrorStatusCode) SetStatusCode(val int)
- type UnimplementedHandler
- func (UnimplementedHandler) CheckSession(ctx context.Context) (r CheckSessionRes, _ error)
- func (UnimplementedHandler) CreateAnonSession(ctx context.Context) (r CreateAnonSessionRes, _ error)
- func (UnimplementedHandler) CreateRefreshToken(ctx context.Context) (r CreateRefreshTokenRes, _ error)
- func (UnimplementedHandler) CreateSession(ctx context.Context, req *LoginForm) (r CreateSessionRes, _ error)
- func (UnimplementedHandler) EmailExists(ctx context.Context, params EmailExistsParams) (r EmailExistsRes, _ error)
- func (UnimplementedHandler) GetPublicKey(ctx context.Context, params GetPublicKeyParams) (r GetPublicKeyRes, _ error)
- func (UnimplementedHandler) Healthcheck(ctx context.Context) (r HealthcheckRes, _ error)
- func (UnimplementedHandler) ListPublicKeys(ctx context.Context, params ListPublicKeysParams) (r ListPublicKeysRes, _ error)
- func (UnimplementedHandler) ListUsers(ctx context.Context, params ListUsersParams) (r ListUsersRes, _ error)
- func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *UnexpectedErrorStatusCode)
- func (UnimplementedHandler) Ping(ctx context.Context) (r PingRes, _ error)
- func (UnimplementedHandler) RefreshSession(ctx context.Context, params RefreshSessionParams) (r RefreshSessionRes, _ error)
- func (UnimplementedHandler) Register(ctx context.Context, req *RegisterForm) (r RegisterRes, _ error)
- func (UnimplementedHandler) RequestEmailUpdate(ctx context.Context, req *RequestEmailUpdateForm) (r RequestEmailUpdateRes, _ error)
- func (UnimplementedHandler) RequestPasswordReset(ctx context.Context, req *RequestPasswordResetForm) (r RequestPasswordResetRes, _ error)
- func (UnimplementedHandler) RequestRegistration(ctx context.Context, req *RequestRegistrationForm) (r RequestRegistrationRes, _ error)
- func (UnimplementedHandler) ResetPassword(ctx context.Context, req *ResetPasswordForm) (r ResetPasswordRes, _ error)
- func (UnimplementedHandler) UpdateEmail(ctx context.Context, req *UpdateEmailForm) (r UpdateEmailRes, _ error)
- func (UnimplementedHandler) UpdatePassword(ctx context.Context, req *UpdatePasswordForm) (r UpdatePasswordRes, _ error)
- func (UnimplementedHandler) UpdateRole(ctx context.Context, req *UpdateRoleForm) (r UpdateRoleRes, _ error)
- type UnprocessableEntityError
- func (s *UnprocessableEntityError) Decode(d *jx.Decoder) error
- func (s *UnprocessableEntityError) Encode(e *jx.Encoder)
- func (s *UnprocessableEntityError) GetError() string
- func (s *UnprocessableEntityError) MarshalJSON() ([]byte, error)
- func (s *UnprocessableEntityError) SetError(val string)
- func (s *UnprocessableEntityError) UnmarshalJSON(data []byte) error
- type UpdateEmailForm
- func (s *UpdateEmailForm) Decode(d *jx.Decoder) error
- func (s *UpdateEmailForm) Encode(e *jx.Encoder)
- func (s *UpdateEmailForm) GetShortCode() ShortCode
- func (s *UpdateEmailForm) GetUserID() UserID
- func (s *UpdateEmailForm) MarshalJSON() ([]byte, error)
- func (s *UpdateEmailForm) SetShortCode(val ShortCode)
- func (s *UpdateEmailForm) SetUserID(val UserID)
- func (s *UpdateEmailForm) UnmarshalJSON(data []byte) error
- func (s *UpdateEmailForm) Validate() error
- type UpdateEmailRes
- type UpdatePasswordForm
- func (s *UpdatePasswordForm) Decode(d *jx.Decoder) error
- func (s *UpdatePasswordForm) Encode(e *jx.Encoder)
- func (s *UpdatePasswordForm) GetCurrentPassword() Password
- func (s *UpdatePasswordForm) GetPassword() Password
- func (s *UpdatePasswordForm) MarshalJSON() ([]byte, error)
- func (s *UpdatePasswordForm) SetCurrentPassword(val Password)
- func (s *UpdatePasswordForm) SetPassword(val Password)
- func (s *UpdatePasswordForm) UnmarshalJSON(data []byte) error
- func (s *UpdatePasswordForm) Validate() error
- type UpdatePasswordNoContent
- type UpdatePasswordRes
- type UpdateRoleForm
- func (s *UpdateRoleForm) Decode(d *jx.Decoder) error
- func (s *UpdateRoleForm) Encode(e *jx.Encoder)
- func (s *UpdateRoleForm) GetRole() CredentialsRole
- func (s *UpdateRoleForm) GetUserID() UserID
- func (s *UpdateRoleForm) MarshalJSON() ([]byte, error)
- func (s *UpdateRoleForm) SetRole(val CredentialsRole)
- func (s *UpdateRoleForm) SetUserID(val UserID)
- func (s *UpdateRoleForm) UnmarshalJSON(data []byte) error
- func (s *UpdateRoleForm) Validate() error
- type UpdateRoleRes
- type Use
- func (Use) AllValues() []Use
- func (s *Use) Decode(d *jx.Decoder) error
- func (s Use) Encode(e *jx.Encoder)
- func (s Use) MarshalJSON() ([]byte, error)
- func (s Use) MarshalText() ([]byte, error)
- func (s *Use) UnmarshalJSON(data []byte) error
- func (s *Use) UnmarshalText(data []byte) error
- func (s Use) Validate() error
- type User
- func (s *User) Decode(d *jx.Decoder) error
- func (s *User) Encode(e *jx.Encoder)
- func (s *User) GetCreatedAt() time.Time
- func (s *User) GetEmail() Email
- func (s *User) GetID() UserID
- func (s *User) GetRole() CredentialsRole
- func (s *User) GetUpdatedAt() time.Time
- func (s *User) MarshalJSON() ([]byte, error)
- func (s *User) SetCreatedAt(val time.Time)
- func (s *User) SetEmail(val Email)
- func (s *User) SetID(val UserID)
- func (s *User) SetRole(val CredentialsRole)
- func (s *User) SetUpdatedAt(val time.Time)
- func (s *User) UnmarshalJSON(data []byte) error
- func (s *User) Validate() error
- type UserID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Alg ¶
type Alg string
The algorithm this key can be used for. Ref: #/components/schemas/Alg
const ( AlgHS256 Alg = "HS256" AlgHS384 Alg = "HS384" AlgHS512 Alg = "HS512" AlgRS256 Alg = "RS256" AlgRS384 Alg = "RS384" AlgRS512 Alg = "RS512" AlgES256 Alg = "ES256" AlgES384 Alg = "ES384" AlgES512 Alg = "ES512" AlgPS256 Alg = "PS256" AlgPS384 Alg = "PS384" AlgPS512 Alg = "PS512" AlgEdDSA Alg = "EdDSA" AlgRSAOAEP Alg = "RSA-OAEP" AlgRSAOAEP256 Alg = "RSA-OAEP-256" AlgA128KW Alg = "A128KW" AlgA192KW Alg = "A192KW" AlgA256KW Alg = "A256KW" AlgDir Alg = "dir" AlgECDHES Alg = "ECDH-ES" AlgECDHESA128KW Alg = "ECDH-ES+A128KW" AlgECDHESA192KW Alg = "ECDH-ES+A192KW" AlgECDHESA256KW Alg = "ECDH-ES+A256KW" AlgA128GCMKW Alg = "A128GCMKW" AlgA192GCMKW Alg = "A192GCMKW" AlgA256GCMKW Alg = "A256GCMKW" AlgPBES2HS256A128KW Alg = "PBES2-HS256+A128KW" AlgPBES2HS384A192KW Alg = "PBES2-HS384+A192KW" AlgPBES2HS512A256KW Alg = "PBES2-HS512+A256KW" AlgA128CBCHS256 Alg = "A128CBC-HS256" AlgA192CBCHS384 Alg = "A192CBC-HS384" AlgA256CBCHS512 Alg = "A256CBC-HS512" AlgA128GCM Alg = "A128GCM" AlgA192GCM Alg = "A192GCM" AlgA256GCM Alg = "A256GCM" )
func (Alg) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (Alg) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Alg) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
func (*Alg) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type BearerAuth ¶
type BearerAuth struct {
Token string
}
func (*BearerAuth) GetToken ¶
func (s *BearerAuth) GetToken() string
GetToken returns the value of Token.
func (*BearerAuth) SetToken ¶
func (s *BearerAuth) SetToken(val string)
SetToken sets the value of Token.
type CheckSessionRes ¶
type CheckSessionRes interface {
// contains filtered or unexported methods
}
type Claims ¶
type Claims struct {
// The unique identifier of the user. Can be null if the session is anonymous.
UserID OptUUID `json:"userID"`
// The roles granted by the token.
Roles []Role `json:"roles"`
// The unique identifier of the refresh token. Can be null if the session is anonymous.
RefreshTokenID OptString `json:"refreshTokenID"`
}
Ref: #/components/schemas/Claims
func (*Claims) GetRefreshTokenID ¶ added in v0.1.6
GetRefreshTokenID returns the value of RefreshTokenID.
func (*Claims) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Claims) SetRefreshTokenID ¶ added in v0.1.6
SetRefreshTokenID sets the value of RefreshTokenID.
func (*Claims) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements OAS client.
func NewClient ¶
func NewClient(serverURL string, sec SecuritySource, opts ...ClientOption) (*Client, error)
NewClient initializes new Client defined by OAS.
func (*Client) CheckSession ¶
func (c *Client) CheckSession(ctx context.Context) (CheckSessionRes, error)
CheckSession invokes checkSession operation.
Takes an empty request with authorization headers, and check the validity of those headers. If the headers can be used to access any protected resource, the session is considered valid and the decoded claims are returned as a success response. Otherwise, an error will be sent, explaining why the session is invalid.
GET /session
func (*Client) CreateAnonSession ¶
func (c *Client) CreateAnonSession(ctx context.Context) (CreateAnonSessionRes, error)
CreateAnonSession invokes createAnonSession operation.
Create a new anonymous session. An anonymous session is delivered without constraint, and grants basic access to apis with low protection.
PUT /session/anon
func (*Client) CreateRefreshToken ¶ added in v0.1.1
func (c *Client) CreateRefreshToken(ctx context.Context) (CreateRefreshTokenRes, error)
CreateRefreshToken invokes createRefreshToken operation.
Issue a new refresh token. The access token used for this request must not be anonymous, and must come from direct login (not a refresh token).
PUT /session/refresh
func (*Client) CreateSession ¶
CreateSession invokes createSession operation.
Create a new session, using a set of credentials. The provided credentials will be used to validate the identity of the caller. Once the credentials have been verified, a token is issued. The access rights it grants may depend on the profile of the user.
PUT /session
func (*Client) EmailExists ¶
func (c *Client) EmailExists(ctx context.Context, params EmailExistsParams) (EmailExistsRes, error)
EmailExists invokes emailExists operation.
Returns an empty, successful response if the email is already associated to an user. Otherwise, it fails with a not found (404) error status.
GET /credentials/email
func (*Client) GetPublicKey ¶
func (c *Client) GetPublicKey(ctx context.Context, params GetPublicKeyParams) (GetPublicKeyRes, error)
GetPublicKey invokes getPublicKey operation.
Get a public key from its usage.
GET /public-keys
func (*Client) Healthcheck ¶ added in v0.1.1
func (c *Client) Healthcheck(ctx context.Context) (HealthcheckRes, error)
Healthcheck invokes healthcheck operation.
Returns a detailed report of the health of the service, including every dependency.
GET /healthcheck
func (*Client) ListPublicKeys ¶
func (c *Client) ListPublicKeys(ctx context.Context, params ListPublicKeysParams) (ListPublicKeysRes, error)
ListPublicKeys invokes listPublicKeys operation.
Get all public keys from the service that match a given usage.
GET /public-keys/list
func (*Client) ListUsers ¶ added in v0.1.6
func (c *Client) ListUsers(ctx context.Context, params ListUsersParams) (ListUsersRes, error)
ListUsers invokes listUsers operation.
List users in the database.
GET /users
func (*Client) Ping ¶
Ping invokes ping operation.
Check the status of the service. If the service is running, a successful response is returned.
GET /ping
func (*Client) RefreshSession ¶ added in v0.1.1
func (c *Client) RefreshSession(ctx context.Context, params RefreshSessionParams) (RefreshSessionRes, error)
RefreshSession invokes refreshSession operation.
Takes a refresh token, and use it to issue a new access token.
PATCH /session/refresh
func (*Client) Register ¶
func (c *Client) Register(ctx context.Context, request *RegisterForm) (RegisterRes, error)
Register invokes register operation.
Create a new user. The form must contain a short code, that was sent through a registration link at the user desired email. On success, a valid access token is returned, that can be used to access higher-privilege routes.
PUT /credentials
func (*Client) RequestEmailUpdate ¶
func (c *Client) RequestEmailUpdate(ctx context.Context, request *RequestEmailUpdateForm) (RequestEmailUpdateRes, error)
RequestEmailUpdate invokes requestEmailUpdate operation.
Create a new short code for updating the email of an user. This short code is sent to the new address. If the user clicks on it, it should take it to a page that will forward the short code back to this API. Once done, the email associated to the user will be updated automatically. This route requires to be called by an authenticated user. Anonymous sessions cannot trigger an email update request. NOTE that this request does not verify the availability of an email. You may check this beforehand,
using
the `Email Exists` endpoint. If multiple email update links are requested for the same email, only the last one will be valid.
PUT /short-code/update-email
func (*Client) RequestPasswordReset ¶
func (c *Client) RequestPasswordReset(ctx context.Context, request *RequestPasswordResetForm) (RequestPasswordResetRes, error)
RequestPasswordReset invokes requestPasswordReset operation.
Create a new short code for updating the password of an user. This short code is sent to the new address. If the user clicks on it, it should take it to a page that will forward the short code back to this API. Once done, the password of the user is updated. This route does not require authentication (although it requires at least an anonymous session). This allow users who forgot their password to reset it. If multiple password update links are requested for the same email, only the last one will be valid.
PUT /short-code/update-password
func (*Client) RequestRegistration ¶
func (c *Client) RequestRegistration(ctx context.Context, request *RequestRegistrationForm) (RequestRegistrationRes, error)
RequestRegistration invokes requestRegistration operation.
To prevent spam in our user database, registration must be done through a link sent by e-mail, so we can ensure this address is valid. When a user registers, the short code it received must be sent along with the registration payload.
The email
of the payload MUST match the email the short code was sent to, and is used to retrieve the short code. NOTE that this request does not verify the availability of an email. You may check this beforehand,
using
the `Email Exists` endpoint. If multiple registration links are requested for the same email, only the last one will be valid.
PUT /short-code/register
func (*Client) ResetPassword ¶
func (c *Client) ResetPassword(ctx context.Context, request *ResetPasswordForm) (ResetPasswordRes, error)
ResetPassword invokes resetPassword operation.
Reset the password of an user. This route allows an unauthenticated session to update the password of a user. To prevent security issues, this route requires a short code that was sent to the email of the user that requested the password reset.
PATCH /credentials/password/reset
func (*Client) UpdateEmail ¶
func (c *Client) UpdateEmail(ctx context.Context, request *UpdateEmailForm) (UpdateEmailRes, error)
UpdateEmail invokes updateEmail operation.
Update the email of an user. This route requires a valid short code, that was sent to the new email. If the short code is valid, the email of the user is updated with the email address the short code was sent to.
PATCH /credentials/email
func (*Client) UpdatePassword ¶
func (c *Client) UpdatePassword(ctx context.Context, request *UpdatePasswordForm) (UpdatePasswordRes, error)
UpdatePassword invokes updatePassword operation.
Update the password of an user. This route requires the original password of the user, to double check the identity of the caller.
PATCH /credentials/password
func (*Client) UpdateRole ¶ added in v0.1.6
func (c *Client) UpdateRole(ctx context.Context, request *UpdateRoleForm) (UpdateRoleRes, error)
UpdateRole invokes updateRole operation.
Update the role of an user. This route requires the original password of the user, to double check the identity of the caller.
PATCH /credentials/role
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption is client config option.
func WithClient ¶
func WithClient(client ht.Client) ClientOption
WithClient specifies http client to use.
type ConflictError ¶
type ConflictError struct {
// The error message.
Error string `json:"error"`
}
Ref: #/components/schemas/ConflictError
func (*ConflictError) Decode ¶
func (s *ConflictError) Decode(d *jx.Decoder) error
Decode decodes ConflictError from json.
func (*ConflictError) Encode ¶
func (s *ConflictError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ConflictError) GetError ¶
func (s *ConflictError) GetError() string
GetError returns the value of Error.
func (*ConflictError) MarshalJSON ¶
func (s *ConflictError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ConflictError) SetError ¶
func (s *ConflictError) SetError(val string)
SetError sets the value of Error.
func (*ConflictError) UnmarshalJSON ¶
func (s *ConflictError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type CreateAnonSessionIMATeapot ¶
type CreateAnonSessionIMATeapot struct{}
CreateAnonSessionIMATeapot is response for CreateAnonSession operation.
type CreateAnonSessionRes ¶
type CreateAnonSessionRes interface {
// contains filtered or unexported methods
}
type CreateRefreshTokenRes ¶ added in v0.1.1
type CreateRefreshTokenRes interface {
// contains filtered or unexported methods
}
type CreateSessionRes ¶
type CreateSessionRes interface {
// contains filtered or unexported methods
}
type CredentialsRole ¶ added in v0.1.6
type CredentialsRole string
A role specifically assigned to a user. Ref: #/components/schemas/CredentialsRole
const ( CredentialsRoleUser CredentialsRole = "user" CredentialsRoleAdmin CredentialsRole = "admin" CredentialsRoleSuperAdmin CredentialsRole = "super_admin" )
func (CredentialsRole) AllValues ¶ added in v0.1.6
func (CredentialsRole) AllValues() []CredentialsRole
AllValues returns all CredentialsRole values.
func (*CredentialsRole) Decode ¶ added in v0.1.6
func (s *CredentialsRole) Decode(d *jx.Decoder) error
Decode decodes CredentialsRole from json.
func (CredentialsRole) Encode ¶ added in v0.1.6
func (s CredentialsRole) Encode(e *jx.Encoder)
Encode encodes CredentialsRole as json.
func (CredentialsRole) MarshalJSON ¶ added in v0.1.6
func (s CredentialsRole) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (CredentialsRole) MarshalText ¶ added in v0.1.6
func (s CredentialsRole) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*CredentialsRole) UnmarshalJSON ¶ added in v0.1.6
func (s *CredentialsRole) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*CredentialsRole) UnmarshalText ¶ added in v0.1.6
func (s *CredentialsRole) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (CredentialsRole) Validate ¶ added in v0.1.6
func (s CredentialsRole) Validate() error
type Dependency ¶ added in v0.1.1
type Dependency struct {
// The name of the dependency.
Name string `json:"name"`
Status DependencyStatus `json:"status"`
AdditionalProps DependencyAdditional
}
Ref: #/components/schemas/Dependency
func (*Dependency) Decode ¶ added in v0.1.1
func (s *Dependency) Decode(d *jx.Decoder) error
Decode decodes Dependency from json.
func (*Dependency) Encode ¶ added in v0.1.1
func (s *Dependency) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*Dependency) GetAdditionalProps ¶ added in v0.1.1
func (s *Dependency) GetAdditionalProps() DependencyAdditional
GetAdditionalProps returns the value of AdditionalProps.
func (*Dependency) GetName ¶ added in v0.1.1
func (s *Dependency) GetName() string
GetName returns the value of Name.
func (*Dependency) GetStatus ¶ added in v0.1.1
func (s *Dependency) GetStatus() DependencyStatus
GetStatus returns the value of Status.
func (*Dependency) MarshalJSON ¶ added in v0.1.1
func (s *Dependency) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*Dependency) SetAdditionalProps ¶ added in v0.1.1
func (s *Dependency) SetAdditionalProps(val DependencyAdditional)
SetAdditionalProps sets the value of AdditionalProps.
func (*Dependency) SetName ¶ added in v0.1.1
func (s *Dependency) SetName(val string)
SetName sets the value of Name.
func (*Dependency) SetStatus ¶ added in v0.1.1
func (s *Dependency) SetStatus(val DependencyStatus)
SetStatus sets the value of Status.
func (*Dependency) UnmarshalJSON ¶ added in v0.1.1
func (s *Dependency) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*Dependency) Validate ¶ added in v0.1.1
func (s *Dependency) Validate() error
type DependencyAdditional ¶ added in v0.1.1
func (*DependencyAdditional) Decode ¶ added in v0.1.1
func (s *DependencyAdditional) Decode(d *jx.Decoder) error
Decode decodes DependencyAdditional from json.
func (DependencyAdditional) Encode ¶ added in v0.1.1
func (s DependencyAdditional) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (DependencyAdditional) MarshalJSON ¶ added in v0.1.1
func (s DependencyAdditional) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*DependencyAdditional) UnmarshalJSON ¶ added in v0.1.1
func (s *DependencyAdditional) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type DependencyStatus ¶ added in v0.1.1
type DependencyStatus string
The status of a dependency. Ref: #/components/schemas/DependencyStatus
const ( DependencyStatusUp DependencyStatus = "up" DependencyStatusDown DependencyStatus = "down" DependencyStatusUnknown DependencyStatus = "unknown" )
func (DependencyStatus) AllValues ¶ added in v0.1.1
func (DependencyStatus) AllValues() []DependencyStatus
AllValues returns all DependencyStatus values.
func (*DependencyStatus) Decode ¶ added in v0.1.1
func (s *DependencyStatus) Decode(d *jx.Decoder) error
Decode decodes DependencyStatus from json.
func (DependencyStatus) Encode ¶ added in v0.1.1
func (s DependencyStatus) Encode(e *jx.Encoder)
Encode encodes DependencyStatus as json.
func (DependencyStatus) MarshalJSON ¶ added in v0.1.1
func (s DependencyStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (DependencyStatus) MarshalText ¶ added in v0.1.1
func (s DependencyStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*DependencyStatus) UnmarshalJSON ¶ added in v0.1.1
func (s *DependencyStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*DependencyStatus) UnmarshalText ¶ added in v0.1.1
func (s *DependencyStatus) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (DependencyStatus) Validate ¶ added in v0.1.1
func (s DependencyStatus) Validate() error
type Email ¶
type Email string
func (Email) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Email) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type EmailExistsNoContent ¶
type EmailExistsNoContent struct{}
EmailExistsNoContent is response for EmailExists operation.
type EmailExistsParams ¶
type EmailExistsParams struct {
Email Email
}
EmailExistsParams is parameters of emailExists operation.
type EmailExistsRes ¶
type EmailExistsRes interface {
// contains filtered or unexported methods
}
type ForbiddenError ¶
type ForbiddenError struct {
// The error message.
Error string `json:"error"`
}
Ref: #/components/schemas/ForbiddenError
func (*ForbiddenError) Decode ¶
func (s *ForbiddenError) Decode(d *jx.Decoder) error
Decode decodes ForbiddenError from json.
func (*ForbiddenError) Encode ¶
func (s *ForbiddenError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ForbiddenError) GetError ¶
func (s *ForbiddenError) GetError() string
GetError returns the value of Error.
func (*ForbiddenError) MarshalJSON ¶
func (s *ForbiddenError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ForbiddenError) SetError ¶
func (s *ForbiddenError) SetError(val string)
SetError sets the value of Error.
func (*ForbiddenError) UnmarshalJSON ¶
func (s *ForbiddenError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetPublicKeyParams ¶
type GetPublicKeyParams struct {
// The unique identifier of the key, conveyed through its KID field.
Kid KID
}
GetPublicKeyParams is parameters of getPublicKey operation.
type GetPublicKeyRes ¶
type GetPublicKeyRes interface {
// contains filtered or unexported methods
}
type Handler ¶
type Handler interface {
// CheckSession implements checkSession operation.
//
// Takes an empty request with authorization headers, and check the validity of those headers. If the
// headers can
// be used to access any protected resource, the session is considered valid and the decoded claims
// are returned
// as a success response. Otherwise, an error will be sent, explaining why the session is invalid.
//
// GET /session
CheckSession(ctx context.Context) (CheckSessionRes, error)
// CreateAnonSession implements createAnonSession operation.
//
// Create a new anonymous session. An anonymous session is delivered without constraint, and grants
// basic access
// to apis with low protection.
//
// PUT /session/anon
CreateAnonSession(ctx context.Context) (CreateAnonSessionRes, error)
// CreateRefreshToken implements createRefreshToken operation.
//
// Issue a new refresh token. The access token used for this request must not be anonymous, and must
// come from
// direct login (not a refresh token).
//
// PUT /session/refresh
CreateRefreshToken(ctx context.Context) (CreateRefreshTokenRes, error)
// CreateSession implements createSession operation.
//
// Create a new session, using a set of credentials. The provided credentials will be used to
// validate the
// identity of the caller. Once the credentials have been verified, a token is issued. The access
// rights it grants
// may depend on the profile of the user.
//
// PUT /session
CreateSession(ctx context.Context, req *LoginForm) (CreateSessionRes, error)
// EmailExists implements emailExists operation.
//
// Returns an empty, successful response if the email is already associated to an user. Otherwise, it
// fails
// with a not found (404) error status.
//
// GET /credentials/email
EmailExists(ctx context.Context, params EmailExistsParams) (EmailExistsRes, error)
// GetPublicKey implements getPublicKey operation.
//
// Get a public key from its usage.
//
// GET /public-keys
GetPublicKey(ctx context.Context, params GetPublicKeyParams) (GetPublicKeyRes, error)
// Healthcheck implements healthcheck operation.
//
// Returns a detailed report of the health of the service, including every dependency.
//
// GET /healthcheck
Healthcheck(ctx context.Context) (HealthcheckRes, error)
// ListPublicKeys implements listPublicKeys operation.
//
// Get all public keys from the service that match a given usage.
//
// GET /public-keys/list
ListPublicKeys(ctx context.Context, params ListPublicKeysParams) (ListPublicKeysRes, error)
// ListUsers implements listUsers operation.
//
// List users in the database.
//
// GET /users
ListUsers(ctx context.Context, params ListUsersParams) (ListUsersRes, error)
// Ping implements ping operation.
//
// Check the status of the service. If the service is running, a successful response is returned.
//
// GET /ping
Ping(ctx context.Context) (PingRes, error)
// RefreshSession implements refreshSession operation.
//
// Takes a refresh token, and use it to issue a new access token.
//
// PATCH /session/refresh
RefreshSession(ctx context.Context, params RefreshSessionParams) (RefreshSessionRes, error)
// Register implements register operation.
//
// Create a new user. The form must contain a short code, that was sent through a registration link
// at the user
// desired email.
// On success, a valid access token is returned, that can be used to access higher-privilege routes.
//
// PUT /credentials
Register(ctx context.Context, req *RegisterForm) (RegisterRes, error)
// RequestEmailUpdate implements requestEmailUpdate operation.
//
// Create a new short code for updating the email of an user. This short code is sent to the new
// address.
// If the user clicks on it, it should take it to a page that will forward the short code back to
// this API.
// Once done, the email associated to the user will be updated automatically.
// This route requires to be called by an authenticated user. Anonymous sessions cannot trigger an
// email
// update request.
// NOTE that this request does not verify the availability of an email. You may check this beforehand,
// using
// the `Email Exists` endpoint.
// If multiple email update links are requested for the same email, only the last one will be valid.
//
// PUT /short-code/update-email
RequestEmailUpdate(ctx context.Context, req *RequestEmailUpdateForm) (RequestEmailUpdateRes, error)
// RequestPasswordReset implements requestPasswordReset operation.
//
// Create a new short code for updating the password of an user. This short code is sent to the new
// address.
// If the user clicks on it, it should take it to a page that will forward the short code back to
// this API.
// Once done, the password of the user is updated.
// This route does not require authentication (although it requires at least an anonymous session).
// This
// allow users who forgot their password to reset it.
// If multiple password update links are requested for the same email, only the last one will be
// valid.
//
// PUT /short-code/update-password
RequestPasswordReset(ctx context.Context, req *RequestPasswordResetForm) (RequestPasswordResetRes, error)
// RequestRegistration implements requestRegistration operation.
//
// To prevent spam in our user database, registration must be done through a link sent by e-mail, so
// we can
// ensure this address is valid.
// When a user registers, the short code it received must be sent along with the registration payload.
// The email
// of the payload MUST match the email the short code was sent to, and is used to retrieve the short
// code.
// NOTE that this request does not verify the availability of an email. You may check this beforehand,
// using
// the `Email Exists` endpoint.
// If multiple registration links are requested for the same email, only the last one will be valid.
//
// PUT /short-code/register
RequestRegistration(ctx context.Context, req *RequestRegistrationForm) (RequestRegistrationRes, error)
// ResetPassword implements resetPassword operation.
//
// Reset the password of an user. This route allows an unauthenticated session to update the password
// of a user.
// To prevent security issues, this route requires a short code that was sent to the email of the
// user that
// requested the password reset.
//
// PATCH /credentials/password/reset
ResetPassword(ctx context.Context, req *ResetPasswordForm) (ResetPasswordRes, error)
// UpdateEmail implements updateEmail operation.
//
// Update the email of an user. This route requires a valid short code, that was sent to the new
// email.
// If the short code is valid, the email of the user is updated with the email address the short code
// was
// sent to.
//
// PATCH /credentials/email
UpdateEmail(ctx context.Context, req *UpdateEmailForm) (UpdateEmailRes, error)
// UpdatePassword implements updatePassword operation.
//
// Update the password of an user. This route requires the original password of the user, to double
// check
// the identity of the caller.
//
// PATCH /credentials/password
UpdatePassword(ctx context.Context, req *UpdatePasswordForm) (UpdatePasswordRes, error)
// UpdateRole implements updateRole operation.
//
// Update the role of an user. This route requires the original password of the user, to double check
// the identity of the caller.
//
// PATCH /credentials/role
UpdateRole(ctx context.Context, req *UpdateRoleForm) (UpdateRoleRes, error)
// NewError creates *UnexpectedErrorStatusCode from error returned by handler.
//
// Used for common default response.
NewError(ctx context.Context, err error) *UnexpectedErrorStatusCode
}
Handler handles operations described by OpenAPI v3 specification.
type Health ¶ added in v0.1.1
type Health struct {
Postgres Dependency `json:"postgres"`
}
Ref: #/components/schemas/Health
func (*Health) GetPostgres ¶ added in v0.1.1
func (s *Health) GetPostgres() Dependency
GetPostgres returns the value of Postgres.
func (*Health) MarshalJSON ¶ added in v0.1.1
MarshalJSON implements stdjson.Marshaler.
func (*Health) SetPostgres ¶ added in v0.1.1
func (s *Health) SetPostgres(val Dependency)
SetPostgres sets the value of Postgres.
func (*Health) UnmarshalJSON ¶ added in v0.1.1
UnmarshalJSON implements stdjson.Unmarshaler.
type HealthcheckIMATeapot ¶ added in v0.1.1
type HealthcheckIMATeapot struct{}
HealthcheckIMATeapot is response for Healthcheck operation.
type HealthcheckRes ¶ added in v0.1.1
type HealthcheckRes interface {
// contains filtered or unexported methods
}
type Invoker ¶
type Invoker interface {
// CheckSession invokes checkSession operation.
//
// Takes an empty request with authorization headers, and check the validity of those headers. If the
// headers can
// be used to access any protected resource, the session is considered valid and the decoded claims
// are returned
// as a success response. Otherwise, an error will be sent, explaining why the session is invalid.
//
// GET /session
CheckSession(ctx context.Context) (CheckSessionRes, error)
// CreateAnonSession invokes createAnonSession operation.
//
// Create a new anonymous session. An anonymous session is delivered without constraint, and grants
// basic access
// to apis with low protection.
//
// PUT /session/anon
CreateAnonSession(ctx context.Context) (CreateAnonSessionRes, error)
// CreateRefreshToken invokes createRefreshToken operation.
//
// Issue a new refresh token. The access token used for this request must not be anonymous, and must
// come from
// direct login (not a refresh token).
//
// PUT /session/refresh
CreateRefreshToken(ctx context.Context) (CreateRefreshTokenRes, error)
// CreateSession invokes createSession operation.
//
// Create a new session, using a set of credentials. The provided credentials will be used to
// validate the
// identity of the caller. Once the credentials have been verified, a token is issued. The access
// rights it grants
// may depend on the profile of the user.
//
// PUT /session
CreateSession(ctx context.Context, request *LoginForm) (CreateSessionRes, error)
// EmailExists invokes emailExists operation.
//
// Returns an empty, successful response if the email is already associated to an user. Otherwise, it
// fails
// with a not found (404) error status.
//
// GET /credentials/email
EmailExists(ctx context.Context, params EmailExistsParams) (EmailExistsRes, error)
// GetPublicKey invokes getPublicKey operation.
//
// Get a public key from its usage.
//
// GET /public-keys
GetPublicKey(ctx context.Context, params GetPublicKeyParams) (GetPublicKeyRes, error)
// Healthcheck invokes healthcheck operation.
//
// Returns a detailed report of the health of the service, including every dependency.
//
// GET /healthcheck
Healthcheck(ctx context.Context) (HealthcheckRes, error)
// ListPublicKeys invokes listPublicKeys operation.
//
// Get all public keys from the service that match a given usage.
//
// GET /public-keys/list
ListPublicKeys(ctx context.Context, params ListPublicKeysParams) (ListPublicKeysRes, error)
// ListUsers invokes listUsers operation.
//
// List users in the database.
//
// GET /users
ListUsers(ctx context.Context, params ListUsersParams) (ListUsersRes, error)
// Ping invokes ping operation.
//
// Check the status of the service. If the service is running, a successful response is returned.
//
// GET /ping
Ping(ctx context.Context) (PingRes, error)
// RefreshSession invokes refreshSession operation.
//
// Takes a refresh token, and use it to issue a new access token.
//
// PATCH /session/refresh
RefreshSession(ctx context.Context, params RefreshSessionParams) (RefreshSessionRes, error)
// Register invokes register operation.
//
// Create a new user. The form must contain a short code, that was sent through a registration link
// at the user
// desired email.
// On success, a valid access token is returned, that can be used to access higher-privilege routes.
//
// PUT /credentials
Register(ctx context.Context, request *RegisterForm) (RegisterRes, error)
// RequestEmailUpdate invokes requestEmailUpdate operation.
//
// Create a new short code for updating the email of an user. This short code is sent to the new
// address.
// If the user clicks on it, it should take it to a page that will forward the short code back to
// this API.
// Once done, the email associated to the user will be updated automatically.
// This route requires to be called by an authenticated user. Anonymous sessions cannot trigger an
// email
// update request.
// NOTE that this request does not verify the availability of an email. You may check this beforehand,
// using
// the `Email Exists` endpoint.
// If multiple email update links are requested for the same email, only the last one will be valid.
//
// PUT /short-code/update-email
RequestEmailUpdate(ctx context.Context, request *RequestEmailUpdateForm) (RequestEmailUpdateRes, error)
// RequestPasswordReset invokes requestPasswordReset operation.
//
// Create a new short code for updating the password of an user. This short code is sent to the new
// address.
// If the user clicks on it, it should take it to a page that will forward the short code back to
// this API.
// Once done, the password of the user is updated.
// This route does not require authentication (although it requires at least an anonymous session).
// This
// allow users who forgot their password to reset it.
// If multiple password update links are requested for the same email, only the last one will be
// valid.
//
// PUT /short-code/update-password
RequestPasswordReset(ctx context.Context, request *RequestPasswordResetForm) (RequestPasswordResetRes, error)
// RequestRegistration invokes requestRegistration operation.
//
// To prevent spam in our user database, registration must be done through a link sent by e-mail, so
// we can
// ensure this address is valid.
// When a user registers, the short code it received must be sent along with the registration payload.
// The email
// of the payload MUST match the email the short code was sent to, and is used to retrieve the short
// code.
// NOTE that this request does not verify the availability of an email. You may check this beforehand,
// using
// the `Email Exists` endpoint.
// If multiple registration links are requested for the same email, only the last one will be valid.
//
// PUT /short-code/register
RequestRegistration(ctx context.Context, request *RequestRegistrationForm) (RequestRegistrationRes, error)
// ResetPassword invokes resetPassword operation.
//
// Reset the password of an user. This route allows an unauthenticated session to update the password
// of a user.
// To prevent security issues, this route requires a short code that was sent to the email of the
// user that
// requested the password reset.
//
// PATCH /credentials/password/reset
ResetPassword(ctx context.Context, request *ResetPasswordForm) (ResetPasswordRes, error)
// UpdateEmail invokes updateEmail operation.
//
// Update the email of an user. This route requires a valid short code, that was sent to the new
// email.
// If the short code is valid, the email of the user is updated with the email address the short code
// was
// sent to.
//
// PATCH /credentials/email
UpdateEmail(ctx context.Context, request *UpdateEmailForm) (UpdateEmailRes, error)
// UpdatePassword invokes updatePassword operation.
//
// Update the password of an user. This route requires the original password of the user, to double
// check
// the identity of the caller.
//
// PATCH /credentials/password
UpdatePassword(ctx context.Context, request *UpdatePasswordForm) (UpdatePasswordRes, error)
// UpdateRole invokes updateRole operation.
//
// Update the role of an user. This route requires the original password of the user, to double check
// the identity of the caller.
//
// PATCH /credentials/role
UpdateRole(ctx context.Context, request *UpdateRoleForm) (UpdateRoleRes, error)
}
Invoker invokes operations described by OpenAPI v3 specification.
type JWK ¶
type JWK struct {
Kty KTY `json:"kty"`
Use Use `json:"use"`
KeyOps []KeyOp `json:"key_ops"`
Alg Alg `json:"alg"`
Kid OptKID `json:"kid"`
AdditionalProps JWKAdditional
}
Ref: #/components/schemas/JWK
func (*JWK) GetAdditionalProps ¶
func (s *JWK) GetAdditionalProps() JWKAdditional
GetAdditionalProps returns the value of AdditionalProps.
func (*JWK) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*JWK) SetAdditionalProps ¶
func (s *JWK) SetAdditionalProps(val JWKAdditional)
SetAdditionalProps sets the value of AdditionalProps.
func (*JWK) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type JWKAdditional ¶
func (*JWKAdditional) Decode ¶
func (s *JWKAdditional) Decode(d *jx.Decoder) error
Decode decodes JWKAdditional from json.
func (JWKAdditional) Encode ¶
func (s JWKAdditional) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (JWKAdditional) MarshalJSON ¶
func (s JWKAdditional) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*JWKAdditional) UnmarshalJSON ¶
func (s *JWKAdditional) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type KID ¶
func (KID) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*KID) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type KTY ¶
type KTY string
The type of the key embedded in the JWK. Ref: #/components/schemas/KTY
func (KTY) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (KTY) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*KTY) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
func (*KTY) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type KeyOp ¶
type KeyOp string
The operation that can be performed using the key. Ref: #/components/schemas/KeyOp
func (KeyOp) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (KeyOp) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*KeyOp) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
func (*KeyOp) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type KeyUsage ¶
type KeyUsage string
The intended usage of the key. Ref: #/components/schemas/KeyUsage
func (KeyUsage) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*KeyUsage) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Labeler ¶
type Labeler struct {
// contains filtered or unexported fields
}
Labeler is used to allow adding custom attributes to the server request metrics.
func LabelerFromContext ¶
LabelerFromContext retrieves the Labeler from the provided context, if present.
If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.
func (*Labeler) AttributeSet ¶
AttributeSet returns the attributes added to the Labeler as an attribute.Set.
type Lang ¶ added in v0.1.8
type Lang string
The language of the user. Ref: #/components/schemas/Lang
func (Lang) MarshalJSON ¶ added in v0.1.8
MarshalJSON implements stdjson.Marshaler.
func (Lang) MarshalText ¶ added in v0.1.8
MarshalText implements encoding.TextMarshaler.
func (*Lang) UnmarshalJSON ¶ added in v0.1.8
UnmarshalJSON implements stdjson.Unmarshaler.
func (*Lang) UnmarshalText ¶ added in v0.1.8
UnmarshalText implements encoding.TextUnmarshaler.
type ListPublicKeysOKApplicationJSON ¶
type ListPublicKeysOKApplicationJSON []JWK
func (*ListPublicKeysOKApplicationJSON) Decode ¶
func (s *ListPublicKeysOKApplicationJSON) Decode(d *jx.Decoder) error
Decode decodes ListPublicKeysOKApplicationJSON from json.
func (ListPublicKeysOKApplicationJSON) Encode ¶
func (s ListPublicKeysOKApplicationJSON) Encode(e *jx.Encoder)
Encode encodes ListPublicKeysOKApplicationJSON as json.
func (ListPublicKeysOKApplicationJSON) MarshalJSON ¶
func (s ListPublicKeysOKApplicationJSON) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ListPublicKeysOKApplicationJSON) UnmarshalJSON ¶
func (s *ListPublicKeysOKApplicationJSON) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (ListPublicKeysOKApplicationJSON) Validate ¶
func (s ListPublicKeysOKApplicationJSON) Validate() error
type ListPublicKeysParams ¶
type ListPublicKeysParams struct {
// The intended usage of the keys.
Usage KeyUsage
}
ListPublicKeysParams is parameters of listPublicKeys operation.
type ListPublicKeysRes ¶
type ListPublicKeysRes interface {
// contains filtered or unexported methods
}
type ListUsersOKApplicationJSON ¶ added in v0.1.6
type ListUsersOKApplicationJSON []User
func (*ListUsersOKApplicationJSON) Decode ¶ added in v0.1.6
func (s *ListUsersOKApplicationJSON) Decode(d *jx.Decoder) error
Decode decodes ListUsersOKApplicationJSON from json.
func (ListUsersOKApplicationJSON) Encode ¶ added in v0.1.6
func (s ListUsersOKApplicationJSON) Encode(e *jx.Encoder)
Encode encodes ListUsersOKApplicationJSON as json.
func (ListUsersOKApplicationJSON) MarshalJSON ¶ added in v0.1.6
func (s ListUsersOKApplicationJSON) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ListUsersOKApplicationJSON) UnmarshalJSON ¶ added in v0.1.6
func (s *ListUsersOKApplicationJSON) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (ListUsersOKApplicationJSON) Validate ¶ added in v0.1.6
func (s ListUsersOKApplicationJSON) Validate() error
type ListUsersParams ¶ added in v0.1.6
type ListUsersParams struct {
// The maximum number of items to return.
Limit OptInt
// The number of items to skip before starting to collect the result set.
Offset OptInt
// The roles to filter the users by.
Roles []CredentialsRole
}
ListUsersParams is parameters of listUsers operation.
type ListUsersRes ¶ added in v0.1.6
type ListUsersRes interface {
// contains filtered or unexported methods
}
type LoginForm ¶
Data used to authenticate a user. It usually includes some private information only known to the user (password, secret question, etc), that is checked against some protected data on the server. If this information is correct, the user is authenticated and granted a special token. Ref: #/components/schemas/LoginForm
func (*LoginForm) GetPassword ¶
GetPassword returns the value of Password.
func (*LoginForm) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*LoginForm) SetPassword ¶
SetPassword sets the value of Password.
func (*LoginForm) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type NotFoundError ¶
type NotFoundError struct {
// The error message.
Error string `json:"error"`
}
Ref: #/components/schemas/NotFoundError
func (*NotFoundError) Decode ¶
func (s *NotFoundError) Decode(d *jx.Decoder) error
Decode decodes NotFoundError from json.
func (*NotFoundError) Encode ¶
func (s *NotFoundError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*NotFoundError) GetError ¶
func (s *NotFoundError) GetError() string
GetError returns the value of Error.
func (*NotFoundError) MarshalJSON ¶
func (s *NotFoundError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*NotFoundError) SetError ¶
func (s *NotFoundError) SetError(val string)
SetError sets the value of Error.
func (*NotFoundError) UnmarshalJSON ¶
func (s *NotFoundError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OperationName ¶
type OperationName = string
OperationName is the ogen operation name
const ( CheckSessionOperation OperationName = "CheckSession" CreateAnonSessionOperation OperationName = "CreateAnonSession" CreateRefreshTokenOperation OperationName = "CreateRefreshToken" CreateSessionOperation OperationName = "CreateSession" EmailExistsOperation OperationName = "EmailExists" GetPublicKeyOperation OperationName = "GetPublicKey" HealthcheckOperation OperationName = "Healthcheck" ListPublicKeysOperation OperationName = "ListPublicKeys" ListUsersOperation OperationName = "ListUsers" PingOperation OperationName = "Ping" RefreshSessionOperation OperationName = "RefreshSession" RegisterOperation OperationName = "Register" RequestEmailUpdateOperation OperationName = "RequestEmailUpdate" RequestPasswordResetOperation OperationName = "RequestPasswordReset" RequestRegistrationOperation OperationName = "RequestRegistration" ResetPasswordOperation OperationName = "ResetPassword" UpdateEmailOperation OperationName = "UpdateEmail" UpdatePasswordOperation OperationName = "UpdatePassword" UpdateRoleOperation OperationName = "UpdateRole" )
type OptInt ¶ added in v0.1.6
OptInt is optional int.
func (OptInt) Get ¶ added in v0.1.6
Get returns value and boolean that denotes whether value was set.
type OptKID ¶
OptKID is optional KID.
func (OptKID) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptKID) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptLang ¶ added in v0.1.8
OptLang is optional Lang.
func NewOptLang ¶ added in v0.1.8
NewOptLang returns new OptLang with value set to v.
func (OptLang) Get ¶ added in v0.1.8
Get returns value and boolean that denotes whether value was set.
func (OptLang) MarshalJSON ¶ added in v0.1.8
MarshalJSON implements stdjson.Marshaler.
func (*OptLang) UnmarshalJSON ¶ added in v0.1.8
UnmarshalJSON implements stdjson.Unmarshaler.
type OptString ¶ added in v0.1.6
OptString is optional string.
func NewOptString ¶ added in v0.1.6
NewOptString returns new OptString with value set to v.
func (OptString) Get ¶ added in v0.1.6
Get returns value and boolean that denotes whether value was set.
func (OptString) MarshalJSON ¶ added in v0.1.6
MarshalJSON implements stdjson.Marshaler.
func (*OptString) UnmarshalJSON ¶ added in v0.1.6
UnmarshalJSON implements stdjson.Unmarshaler.
type OptUUID ¶ added in v0.1.5
OptUUID is optional uuid.UUID.
func NewOptUUID ¶ added in v0.1.5
NewOptUUID returns new OptUUID with value set to v.
func (OptUUID) Get ¶ added in v0.1.5
Get returns value and boolean that denotes whether value was set.
func (OptUUID) MarshalJSON ¶ added in v0.1.5
MarshalJSON implements stdjson.Marshaler.
func (*OptUUID) UnmarshalJSON ¶ added in v0.1.5
UnmarshalJSON implements stdjson.Unmarshaler.
type Option ¶
type Option interface {
ServerOption
ClientOption
}
Option is config option.
func WithMeterProvider ¶
func WithMeterProvider(provider metric.MeterProvider) Option
WithMeterProvider specifies a meter provider to use for creating a meter.
If none is specified, the otel.GetMeterProvider() is used.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer.
If none is specified, the global provider is used.
type Password ¶
type Password string
func (Password) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Password) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type RefreshSessionParams ¶ added in v0.1.1
RefreshSessionParams is parameters of refreshSession operation.
type RefreshSessionRes ¶ added in v0.1.1
type RefreshSessionRes interface {
// contains filtered or unexported methods
}
type RefreshToken ¶ added in v0.1.1
type RefreshToken struct {
// The token used to refresh the session.
RefreshToken string `json:"refreshToken"`
}
Ref: #/components/schemas/RefreshToken
func (*RefreshToken) Decode ¶ added in v0.1.1
func (s *RefreshToken) Decode(d *jx.Decoder) error
Decode decodes RefreshToken from json.
func (*RefreshToken) Encode ¶ added in v0.1.1
func (s *RefreshToken) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*RefreshToken) GetRefreshToken ¶ added in v0.1.1
func (s *RefreshToken) GetRefreshToken() string
GetRefreshToken returns the value of RefreshToken.
func (*RefreshToken) MarshalJSON ¶ added in v0.1.1
func (s *RefreshToken) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*RefreshToken) SetRefreshToken ¶ added in v0.1.1
func (s *RefreshToken) SetRefreshToken(val string)
SetRefreshToken sets the value of RefreshToken.
func (*RefreshToken) UnmarshalJSON ¶ added in v0.1.1
func (s *RefreshToken) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type RegisterForm ¶
type RegisterForm struct {
// The email of the new user. This email must be available, and also match the one that received
// the short code / registration link.
Email Email `json:"email"`
Password Password `json:"password"`
ShortCode ShortCode `json:"shortCode"`
}
Data used to create a user. Ref: #/components/schemas/RegisterForm
func (*RegisterForm) Decode ¶
func (s *RegisterForm) Decode(d *jx.Decoder) error
Decode decodes RegisterForm from json.
func (*RegisterForm) Encode ¶
func (s *RegisterForm) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*RegisterForm) GetEmail ¶
func (s *RegisterForm) GetEmail() Email
GetEmail returns the value of Email.
func (*RegisterForm) GetPassword ¶
func (s *RegisterForm) GetPassword() Password
GetPassword returns the value of Password.
func (*RegisterForm) GetShortCode ¶
func (s *RegisterForm) GetShortCode() ShortCode
GetShortCode returns the value of ShortCode.
func (*RegisterForm) MarshalJSON ¶
func (s *RegisterForm) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*RegisterForm) SetEmail ¶
func (s *RegisterForm) SetEmail(val Email)
SetEmail sets the value of Email.
func (*RegisterForm) SetPassword ¶
func (s *RegisterForm) SetPassword(val Password)
SetPassword sets the value of Password.
func (*RegisterForm) SetShortCode ¶
func (s *RegisterForm) SetShortCode(val ShortCode)
SetShortCode sets the value of ShortCode.
func (*RegisterForm) UnmarshalJSON ¶
func (s *RegisterForm) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*RegisterForm) Validate ¶
func (s *RegisterForm) Validate() error
type RegisterRes ¶
type RegisterRes interface {
// contains filtered or unexported methods
}
type RequestEmailUpdateForm ¶
type RequestEmailUpdateForm struct {
// The bew email of the new user. This email must be available at the time of validation.
Email Email `json:"email"`
Lang OptLang `json:"lang"`
}
Create a new email update link. Ref: #/components/schemas/RequestEmailUpdateForm
func (*RequestEmailUpdateForm) Decode ¶
func (s *RequestEmailUpdateForm) Decode(d *jx.Decoder) error
Decode decodes RequestEmailUpdateForm from json.
func (*RequestEmailUpdateForm) Encode ¶
func (s *RequestEmailUpdateForm) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*RequestEmailUpdateForm) GetEmail ¶
func (s *RequestEmailUpdateForm) GetEmail() Email
GetEmail returns the value of Email.
func (*RequestEmailUpdateForm) GetLang ¶ added in v0.1.8
func (s *RequestEmailUpdateForm) GetLang() OptLang
GetLang returns the value of Lang.
func (*RequestEmailUpdateForm) MarshalJSON ¶
func (s *RequestEmailUpdateForm) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*RequestEmailUpdateForm) SetEmail ¶
func (s *RequestEmailUpdateForm) SetEmail(val Email)
SetEmail sets the value of Email.
func (*RequestEmailUpdateForm) SetLang ¶ added in v0.1.8
func (s *RequestEmailUpdateForm) SetLang(val OptLang)
SetLang sets the value of Lang.
func (*RequestEmailUpdateForm) UnmarshalJSON ¶
func (s *RequestEmailUpdateForm) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*RequestEmailUpdateForm) Validate ¶
func (s *RequestEmailUpdateForm) Validate() error
type RequestEmailUpdateNoContent ¶
type RequestEmailUpdateNoContent struct{}
RequestEmailUpdateNoContent is response for RequestEmailUpdate operation.
type RequestEmailUpdateRes ¶
type RequestEmailUpdateRes interface {
// contains filtered or unexported methods
}
type RequestPasswordResetForm ¶
type RequestPasswordResetForm struct {
// The email of the user. This email must match a user in the database.
Email Email `json:"email"`
Lang OptLang `json:"lang"`
}
Create a new password update link. Ref: #/components/schemas/RequestPasswordResetForm
func (*RequestPasswordResetForm) Decode ¶
func (s *RequestPasswordResetForm) Decode(d *jx.Decoder) error
Decode decodes RequestPasswordResetForm from json.
func (*RequestPasswordResetForm) Encode ¶
func (s *RequestPasswordResetForm) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*RequestPasswordResetForm) GetEmail ¶
func (s *RequestPasswordResetForm) GetEmail() Email
GetEmail returns the value of Email.
func (*RequestPasswordResetForm) GetLang ¶ added in v0.1.8
func (s *RequestPasswordResetForm) GetLang() OptLang
GetLang returns the value of Lang.
func (*RequestPasswordResetForm) MarshalJSON ¶
func (s *RequestPasswordResetForm) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*RequestPasswordResetForm) SetEmail ¶
func (s *RequestPasswordResetForm) SetEmail(val Email)
SetEmail sets the value of Email.
func (*RequestPasswordResetForm) SetLang ¶ added in v0.1.8
func (s *RequestPasswordResetForm) SetLang(val OptLang)
SetLang sets the value of Lang.
func (*RequestPasswordResetForm) UnmarshalJSON ¶
func (s *RequestPasswordResetForm) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*RequestPasswordResetForm) Validate ¶
func (s *RequestPasswordResetForm) Validate() error
type RequestPasswordResetNoContent ¶
type RequestPasswordResetNoContent struct{}
RequestPasswordResetNoContent is response for RequestPasswordReset operation.
type RequestPasswordResetRes ¶
type RequestPasswordResetRes interface {
// contains filtered or unexported methods
}
type RequestRegistrationForm ¶
type RequestRegistrationForm struct {
// The email of the new user. This email must be available at the time of registration.
Email Email `json:"email"`
Lang OptLang `json:"lang"`
}
Create a new registration link. Ref: #/components/schemas/RequestRegistrationForm
func (*RequestRegistrationForm) Decode ¶
func (s *RequestRegistrationForm) Decode(d *jx.Decoder) error
Decode decodes RequestRegistrationForm from json.
func (*RequestRegistrationForm) Encode ¶
func (s *RequestRegistrationForm) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*RequestRegistrationForm) GetEmail ¶
func (s *RequestRegistrationForm) GetEmail() Email
GetEmail returns the value of Email.
func (*RequestRegistrationForm) GetLang ¶ added in v0.1.8
func (s *RequestRegistrationForm) GetLang() OptLang
GetLang returns the value of Lang.
func (*RequestRegistrationForm) MarshalJSON ¶
func (s *RequestRegistrationForm) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*RequestRegistrationForm) SetEmail ¶
func (s *RequestRegistrationForm) SetEmail(val Email)
SetEmail sets the value of Email.
func (*RequestRegistrationForm) SetLang ¶ added in v0.1.8
func (s *RequestRegistrationForm) SetLang(val OptLang)
SetLang sets the value of Lang.
func (*RequestRegistrationForm) UnmarshalJSON ¶
func (s *RequestRegistrationForm) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*RequestRegistrationForm) Validate ¶
func (s *RequestRegistrationForm) Validate() error
type RequestRegistrationIMATeapot ¶
type RequestRegistrationIMATeapot struct{}
RequestRegistrationIMATeapot is response for RequestRegistration operation.
type RequestRegistrationNoContent ¶
type RequestRegistrationNoContent struct{}
RequestRegistrationNoContent is response for RequestRegistration operation.
type RequestRegistrationRes ¶
type RequestRegistrationRes interface {
// contains filtered or unexported methods
}
type ResetPasswordForm ¶
type ResetPasswordForm struct {
// The ID of the user that requested a password reset is sent in the reset link of the reset password
// email.
UserID UserID `json:"userID"`
// The new password of the user.
Password Password `json:"password"`
ShortCode ShortCode `json:"shortCode"`
}
Data used to reset the password of a user. Ref: #/components/schemas/ResetPasswordForm
func (*ResetPasswordForm) Decode ¶
func (s *ResetPasswordForm) Decode(d *jx.Decoder) error
Decode decodes ResetPasswordForm from json.
func (*ResetPasswordForm) Encode ¶
func (s *ResetPasswordForm) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ResetPasswordForm) GetPassword ¶
func (s *ResetPasswordForm) GetPassword() Password
GetPassword returns the value of Password.
func (*ResetPasswordForm) GetShortCode ¶
func (s *ResetPasswordForm) GetShortCode() ShortCode
GetShortCode returns the value of ShortCode.
func (*ResetPasswordForm) GetUserID ¶
func (s *ResetPasswordForm) GetUserID() UserID
GetUserID returns the value of UserID.
func (*ResetPasswordForm) MarshalJSON ¶
func (s *ResetPasswordForm) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ResetPasswordForm) SetPassword ¶
func (s *ResetPasswordForm) SetPassword(val Password)
SetPassword sets the value of Password.
func (*ResetPasswordForm) SetShortCode ¶
func (s *ResetPasswordForm) SetShortCode(val ShortCode)
SetShortCode sets the value of ShortCode.
func (*ResetPasswordForm) SetUserID ¶
func (s *ResetPasswordForm) SetUserID(val UserID)
SetUserID sets the value of UserID.
func (*ResetPasswordForm) UnmarshalJSON ¶
func (s *ResetPasswordForm) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*ResetPasswordForm) Validate ¶
func (s *ResetPasswordForm) Validate() error
type ResetPasswordNoContent ¶
type ResetPasswordNoContent struct{}
ResetPasswordNoContent is response for ResetPassword operation.
type ResetPasswordRes ¶
type ResetPasswordRes interface {
// contains filtered or unexported methods
}
type Role ¶
type Role string
func (Role) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Role) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
type SecurityHandler ¶
type SecurityHandler interface {
// HandleBearerAuth handles bearerAuth security.
HandleBearerAuth(ctx context.Context, operationName OperationName, t BearerAuth) (context.Context, error)
}
SecurityHandler is handler for security parameters.
type SecuritySource ¶
type SecuritySource interface {
// BearerAuth provides bearerAuth security value.
BearerAuth(ctx context.Context, operationName OperationName) (BearerAuth, error)
}
SecuritySource is provider of security values (tokens, passwords, etc.).
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.
func NewServer ¶
func NewServer(h Handler, sec SecurityHandler, opts ...ServerOption) (*Server, error)
NewServer creates new Server.
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
ServerOption is server config option.
func WithErrorHandler ¶
func WithErrorHandler(h ErrorHandler) ServerOption
WithErrorHandler specifies error handler to use.
func WithMaxMultipartMemory ¶
func WithMaxMultipartMemory(max int64) ServerOption
WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.
func WithMethodNotAllowed ¶
func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
WithMethodNotAllowed specifies Method Not Allowed handler to use.
func WithMiddleware ¶
func WithMiddleware(m ...Middleware) ServerOption
WithMiddleware specifies middlewares to use.
func WithNotFound ¶
func WithNotFound(notFound http.HandlerFunc) ServerOption
WithNotFound specifies Not Found handler to use.
func WithPathPrefix ¶
func WithPathPrefix(prefix string) ServerOption
WithPathPrefix specifies server path prefix.
type ShortCode ¶
type ShortCode string
func (ShortCode) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*ShortCode) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Token ¶
type Token struct {
// The token used to authenticate the session. This token can be passed as a header to http requests
// on
// protected routes.
AccessToken string `json:"accessToken"`
}
Ref: #/components/schemas/Token
func (*Token) GetAccessToken ¶
GetAccessToken returns the value of AccessToken.
func (*Token) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Token) SetAccessToken ¶
SetAccessToken sets the value of AccessToken.
func (*Token) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type UnauthorizedError ¶ added in v0.1.8
type UnauthorizedError struct {
Error string `json:"error"`
}
Ref: #/components/schemas/UnauthorizedError
func (*UnauthorizedError) Decode ¶ added in v0.1.8
func (s *UnauthorizedError) Decode(d *jx.Decoder) error
Decode decodes UnauthorizedError from json.
func (*UnauthorizedError) Encode ¶ added in v0.1.8
func (s *UnauthorizedError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UnauthorizedError) GetError ¶ added in v0.1.8
func (s *UnauthorizedError) GetError() string
GetError returns the value of Error.
func (*UnauthorizedError) MarshalJSON ¶ added in v0.1.8
func (s *UnauthorizedError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UnauthorizedError) SetError ¶ added in v0.1.8
func (s *UnauthorizedError) SetError(val string)
SetError sets the value of Error.
func (*UnauthorizedError) UnmarshalJSON ¶ added in v0.1.8
func (s *UnauthorizedError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type UnexpectedError ¶
type UnexpectedError struct {
// The error message.
Error string `json:"error"`
}
Ref: #/components/schemas/UnexpectedError
func (*UnexpectedError) Decode ¶
func (s *UnexpectedError) Decode(d *jx.Decoder) error
Decode decodes UnexpectedError from json.
func (*UnexpectedError) Encode ¶
func (s *UnexpectedError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UnexpectedError) GetError ¶
func (s *UnexpectedError) GetError() string
GetError returns the value of Error.
func (*UnexpectedError) MarshalJSON ¶
func (s *UnexpectedError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UnexpectedError) SetError ¶
func (s *UnexpectedError) SetError(val string)
SetError sets the value of Error.
func (*UnexpectedError) UnmarshalJSON ¶
func (s *UnexpectedError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type UnexpectedErrorStatusCode ¶
type UnexpectedErrorStatusCode struct {
StatusCode int
Response UnexpectedError
}
UnexpectedErrorStatusCode wraps UnexpectedError with StatusCode.
func (*UnexpectedErrorStatusCode) Error ¶
func (s *UnexpectedErrorStatusCode) Error() string
func (*UnexpectedErrorStatusCode) GetResponse ¶
func (s *UnexpectedErrorStatusCode) GetResponse() UnexpectedError
GetResponse returns the value of Response.
func (*UnexpectedErrorStatusCode) GetStatusCode ¶
func (s *UnexpectedErrorStatusCode) GetStatusCode() int
GetStatusCode returns the value of StatusCode.
func (*UnexpectedErrorStatusCode) SetResponse ¶
func (s *UnexpectedErrorStatusCode) SetResponse(val UnexpectedError)
SetResponse sets the value of Response.
func (*UnexpectedErrorStatusCode) SetStatusCode ¶
func (s *UnexpectedErrorStatusCode) SetStatusCode(val int)
SetStatusCode sets the value of StatusCode.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) CheckSession ¶
func (UnimplementedHandler) CheckSession(ctx context.Context) (r CheckSessionRes, _ error)
CheckSession implements checkSession operation.
Takes an empty request with authorization headers, and check the validity of those headers. If the headers can be used to access any protected resource, the session is considered valid and the decoded claims are returned as a success response. Otherwise, an error will be sent, explaining why the session is invalid.
GET /session
func (UnimplementedHandler) CreateAnonSession ¶
func (UnimplementedHandler) CreateAnonSession(ctx context.Context) (r CreateAnonSessionRes, _ error)
CreateAnonSession implements createAnonSession operation.
Create a new anonymous session. An anonymous session is delivered without constraint, and grants basic access to apis with low protection.
PUT /session/anon
func (UnimplementedHandler) CreateRefreshToken ¶ added in v0.1.1
func (UnimplementedHandler) CreateRefreshToken(ctx context.Context) (r CreateRefreshTokenRes, _ error)
CreateRefreshToken implements createRefreshToken operation.
Issue a new refresh token. The access token used for this request must not be anonymous, and must come from direct login (not a refresh token).
PUT /session/refresh
func (UnimplementedHandler) CreateSession ¶
func (UnimplementedHandler) CreateSession(ctx context.Context, req *LoginForm) (r CreateSessionRes, _ error)
CreateSession implements createSession operation.
Create a new session, using a set of credentials. The provided credentials will be used to validate the identity of the caller. Once the credentials have been verified, a token is issued. The access rights it grants may depend on the profile of the user.
PUT /session
func (UnimplementedHandler) EmailExists ¶
func (UnimplementedHandler) EmailExists(ctx context.Context, params EmailExistsParams) (r EmailExistsRes, _ error)
EmailExists implements emailExists operation.
Returns an empty, successful response if the email is already associated to an user. Otherwise, it fails with a not found (404) error status.
GET /credentials/email
func (UnimplementedHandler) GetPublicKey ¶
func (UnimplementedHandler) GetPublicKey(ctx context.Context, params GetPublicKeyParams) (r GetPublicKeyRes, _ error)
GetPublicKey implements getPublicKey operation.
Get a public key from its usage.
GET /public-keys
func (UnimplementedHandler) Healthcheck ¶ added in v0.1.1
func (UnimplementedHandler) Healthcheck(ctx context.Context) (r HealthcheckRes, _ error)
Healthcheck implements healthcheck operation.
Returns a detailed report of the health of the service, including every dependency.
GET /healthcheck
func (UnimplementedHandler) ListPublicKeys ¶
func (UnimplementedHandler) ListPublicKeys(ctx context.Context, params ListPublicKeysParams) (r ListPublicKeysRes, _ error)
ListPublicKeys implements listPublicKeys operation.
Get all public keys from the service that match a given usage.
GET /public-keys/list
func (UnimplementedHandler) ListUsers ¶ added in v0.1.6
func (UnimplementedHandler) ListUsers(ctx context.Context, params ListUsersParams) (r ListUsersRes, _ error)
ListUsers implements listUsers operation.
List users in the database.
GET /users
func (UnimplementedHandler) NewError ¶
func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *UnexpectedErrorStatusCode)
NewError creates *UnexpectedErrorStatusCode from error returned by handler.
Used for common default response.
func (UnimplementedHandler) Ping ¶
func (UnimplementedHandler) Ping(ctx context.Context) (r PingRes, _ error)
Ping implements ping operation.
Check the status of the service. If the service is running, a successful response is returned.
GET /ping
func (UnimplementedHandler) RefreshSession ¶ added in v0.1.1
func (UnimplementedHandler) RefreshSession(ctx context.Context, params RefreshSessionParams) (r RefreshSessionRes, _ error)
RefreshSession implements refreshSession operation.
Takes a refresh token, and use it to issue a new access token.
PATCH /session/refresh
func (UnimplementedHandler) Register ¶
func (UnimplementedHandler) Register(ctx context.Context, req *RegisterForm) (r RegisterRes, _ error)
Register implements register operation.
Create a new user. The form must contain a short code, that was sent through a registration link at the user desired email. On success, a valid access token is returned, that can be used to access higher-privilege routes.
PUT /credentials
func (UnimplementedHandler) RequestEmailUpdate ¶
func (UnimplementedHandler) RequestEmailUpdate(ctx context.Context, req *RequestEmailUpdateForm) (r RequestEmailUpdateRes, _ error)
RequestEmailUpdate implements requestEmailUpdate operation.
Create a new short code for updating the email of an user. This short code is sent to the new address. If the user clicks on it, it should take it to a page that will forward the short code back to this API. Once done, the email associated to the user will be updated automatically. This route requires to be called by an authenticated user. Anonymous sessions cannot trigger an email update request. NOTE that this request does not verify the availability of an email. You may check this beforehand,
using
the `Email Exists` endpoint. If multiple email update links are requested for the same email, only the last one will be valid.
PUT /short-code/update-email
func (UnimplementedHandler) RequestPasswordReset ¶
func (UnimplementedHandler) RequestPasswordReset(ctx context.Context, req *RequestPasswordResetForm) (r RequestPasswordResetRes, _ error)
RequestPasswordReset implements requestPasswordReset operation.
Create a new short code for updating the password of an user. This short code is sent to the new address. If the user clicks on it, it should take it to a page that will forward the short code back to this API. Once done, the password of the user is updated. This route does not require authentication (although it requires at least an anonymous session). This allow users who forgot their password to reset it. If multiple password update links are requested for the same email, only the last one will be valid.
PUT /short-code/update-password
func (UnimplementedHandler) RequestRegistration ¶
func (UnimplementedHandler) RequestRegistration(ctx context.Context, req *RequestRegistrationForm) (r RequestRegistrationRes, _ error)
RequestRegistration implements requestRegistration operation.
To prevent spam in our user database, registration must be done through a link sent by e-mail, so we can ensure this address is valid. When a user registers, the short code it received must be sent along with the registration payload.
The email
of the payload MUST match the email the short code was sent to, and is used to retrieve the short code. NOTE that this request does not verify the availability of an email. You may check this beforehand,
using
the `Email Exists` endpoint. If multiple registration links are requested for the same email, only the last one will be valid.
PUT /short-code/register
func (UnimplementedHandler) ResetPassword ¶
func (UnimplementedHandler) ResetPassword(ctx context.Context, req *ResetPasswordForm) (r ResetPasswordRes, _ error)
ResetPassword implements resetPassword operation.
Reset the password of an user. This route allows an unauthenticated session to update the password of a user. To prevent security issues, this route requires a short code that was sent to the email of the user that requested the password reset.
PATCH /credentials/password/reset
func (UnimplementedHandler) UpdateEmail ¶
func (UnimplementedHandler) UpdateEmail(ctx context.Context, req *UpdateEmailForm) (r UpdateEmailRes, _ error)
UpdateEmail implements updateEmail operation.
Update the email of an user. This route requires a valid short code, that was sent to the new email. If the short code is valid, the email of the user is updated with the email address the short code was sent to.
PATCH /credentials/email
func (UnimplementedHandler) UpdatePassword ¶
func (UnimplementedHandler) UpdatePassword(ctx context.Context, req *UpdatePasswordForm) (r UpdatePasswordRes, _ error)
UpdatePassword implements updatePassword operation.
Update the password of an user. This route requires the original password of the user, to double check the identity of the caller.
PATCH /credentials/password
func (UnimplementedHandler) UpdateRole ¶ added in v0.1.6
func (UnimplementedHandler) UpdateRole(ctx context.Context, req *UpdateRoleForm) (r UpdateRoleRes, _ error)
UpdateRole implements updateRole operation.
Update the role of an user. This route requires the original password of the user, to double check the identity of the caller.
PATCH /credentials/role
type UnprocessableEntityError ¶ added in v0.1.1
type UnprocessableEntityError struct {
// The error message.
Error string `json:"error"`
}
Ref: #/components/schemas/UnprocessableEntityError
func (*UnprocessableEntityError) Decode ¶ added in v0.1.1
func (s *UnprocessableEntityError) Decode(d *jx.Decoder) error
Decode decodes UnprocessableEntityError from json.
func (*UnprocessableEntityError) Encode ¶ added in v0.1.1
func (s *UnprocessableEntityError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UnprocessableEntityError) GetError ¶ added in v0.1.1
func (s *UnprocessableEntityError) GetError() string
GetError returns the value of Error.
func (*UnprocessableEntityError) MarshalJSON ¶ added in v0.1.1
func (s *UnprocessableEntityError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UnprocessableEntityError) SetError ¶ added in v0.1.1
func (s *UnprocessableEntityError) SetError(val string)
SetError sets the value of Error.
func (*UnprocessableEntityError) UnmarshalJSON ¶ added in v0.1.1
func (s *UnprocessableEntityError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type UpdateEmailForm ¶
type UpdateEmailForm struct {
// The id of the user that requested the email update. This ID is usually sent along the short code
// in the email update link.
UserID UserID `json:"userID"`
ShortCode ShortCode `json:"shortCode"`
}
Data used to update the email of a user. Ref: #/components/schemas/UpdateEmailForm
func (*UpdateEmailForm) Decode ¶
func (s *UpdateEmailForm) Decode(d *jx.Decoder) error
Decode decodes UpdateEmailForm from json.
func (*UpdateEmailForm) Encode ¶
func (s *UpdateEmailForm) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UpdateEmailForm) GetShortCode ¶
func (s *UpdateEmailForm) GetShortCode() ShortCode
GetShortCode returns the value of ShortCode.
func (*UpdateEmailForm) GetUserID ¶
func (s *UpdateEmailForm) GetUserID() UserID
GetUserID returns the value of UserID.
func (*UpdateEmailForm) MarshalJSON ¶
func (s *UpdateEmailForm) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UpdateEmailForm) SetShortCode ¶
func (s *UpdateEmailForm) SetShortCode(val ShortCode)
SetShortCode sets the value of ShortCode.
func (*UpdateEmailForm) SetUserID ¶
func (s *UpdateEmailForm) SetUserID(val UserID)
SetUserID sets the value of UserID.
func (*UpdateEmailForm) UnmarshalJSON ¶
func (s *UpdateEmailForm) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*UpdateEmailForm) Validate ¶
func (s *UpdateEmailForm) Validate() error
type UpdateEmailRes ¶
type UpdateEmailRes interface {
// contains filtered or unexported methods
}
type UpdatePasswordForm ¶
type UpdatePasswordForm struct {
// The new password of the user.
Password Password `json:"password"`
// The current password of the user, used for further verification of the caller identity.
CurrentPassword Password `json:"currentPassword"`
}
Data used to update the password of a user. Ref: #/components/schemas/UpdatePasswordForm
func (*UpdatePasswordForm) Decode ¶
func (s *UpdatePasswordForm) Decode(d *jx.Decoder) error
Decode decodes UpdatePasswordForm from json.
func (*UpdatePasswordForm) Encode ¶
func (s *UpdatePasswordForm) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UpdatePasswordForm) GetCurrentPassword ¶
func (s *UpdatePasswordForm) GetCurrentPassword() Password
GetCurrentPassword returns the value of CurrentPassword.
func (*UpdatePasswordForm) GetPassword ¶
func (s *UpdatePasswordForm) GetPassword() Password
GetPassword returns the value of Password.
func (*UpdatePasswordForm) MarshalJSON ¶
func (s *UpdatePasswordForm) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UpdatePasswordForm) SetCurrentPassword ¶
func (s *UpdatePasswordForm) SetCurrentPassword(val Password)
SetCurrentPassword sets the value of CurrentPassword.
func (*UpdatePasswordForm) SetPassword ¶
func (s *UpdatePasswordForm) SetPassword(val Password)
SetPassword sets the value of Password.
func (*UpdatePasswordForm) UnmarshalJSON ¶
func (s *UpdatePasswordForm) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*UpdatePasswordForm) Validate ¶
func (s *UpdatePasswordForm) Validate() error
type UpdatePasswordNoContent ¶
type UpdatePasswordNoContent struct{}
UpdatePasswordNoContent is response for UpdatePassword operation.
type UpdatePasswordRes ¶
type UpdatePasswordRes interface {
// contains filtered or unexported methods
}
type UpdateRoleForm ¶ added in v0.1.6
type UpdateRoleForm struct {
// The id of the user who's role is to be updated.
UserID UserID `json:"userID"`
// The new role of the user.
Role CredentialsRole `json:"role"`
}
Data used to update the role of a user. The user requesting the update must follow some specific rules. - A user cannot upgrade other users to a role higher than its own. - A user can only downgrade other users to a role lower than its own. For example, the following operations are permitted: - ✅ A (super_admin) upgrades B (admin) to super_admin. - ✅ A (admin) upgrades B (user) to admin. - ✅ A (super_admin) downgrades B (admin) to user. But the following operations are not: - ❌ A (admin) upgrades B (user) to super_admin. - ❌ A (admin) downgrades B (admin) to user. Ref: #/components/schemas/UpdateRoleForm
func (*UpdateRoleForm) Decode ¶ added in v0.1.6
func (s *UpdateRoleForm) Decode(d *jx.Decoder) error
Decode decodes UpdateRoleForm from json.
func (*UpdateRoleForm) Encode ¶ added in v0.1.6
func (s *UpdateRoleForm) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UpdateRoleForm) GetRole ¶ added in v0.1.6
func (s *UpdateRoleForm) GetRole() CredentialsRole
GetRole returns the value of Role.
func (*UpdateRoleForm) GetUserID ¶ added in v0.1.6
func (s *UpdateRoleForm) GetUserID() UserID
GetUserID returns the value of UserID.
func (*UpdateRoleForm) MarshalJSON ¶ added in v0.1.6
func (s *UpdateRoleForm) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UpdateRoleForm) SetRole ¶ added in v0.1.6
func (s *UpdateRoleForm) SetRole(val CredentialsRole)
SetRole sets the value of Role.
func (*UpdateRoleForm) SetUserID ¶ added in v0.1.6
func (s *UpdateRoleForm) SetUserID(val UserID)
SetUserID sets the value of UserID.
func (*UpdateRoleForm) UnmarshalJSON ¶ added in v0.1.6
func (s *UpdateRoleForm) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*UpdateRoleForm) Validate ¶ added in v0.1.6
func (s *UpdateRoleForm) Validate() error
type UpdateRoleRes ¶ added in v0.1.6
type UpdateRoleRes interface {
// contains filtered or unexported methods
}
type Use ¶
type Use string
The intended use of the public key. Ref: #/components/schemas/Use
func (Use) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (Use) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Use) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
func (*Use) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type User ¶ added in v0.1.6
type User struct {
// The unique identifier of the user.
ID UserID `json:"id"`
// The email of the user.
Email Email `json:"email"`
// The role of the user.
Role CredentialsRole `json:"role"`
// The date and time the user was created.
CreatedAt time.Time `json:"createdAt"`
// The date and time the user was last updated.
UpdatedAt time.Time `json:"updatedAt"`
}
Ref: #/components/schemas/User
func (*User) GetCreatedAt ¶ added in v0.1.6
GetCreatedAt returns the value of CreatedAt.
func (*User) GetRole ¶ added in v0.1.6
func (s *User) GetRole() CredentialsRole
GetRole returns the value of Role.
func (*User) GetUpdatedAt ¶ added in v0.1.6
GetUpdatedAt returns the value of UpdatedAt.
func (*User) MarshalJSON ¶ added in v0.1.6
MarshalJSON implements stdjson.Marshaler.
func (*User) SetCreatedAt ¶ added in v0.1.6
SetCreatedAt sets the value of CreatedAt.
func (*User) SetRole ¶ added in v0.1.6
func (s *User) SetRole(val CredentialsRole)
SetRole sets the value of Role.
func (*User) SetUpdatedAt ¶ added in v0.1.6
SetUpdatedAt sets the value of UpdatedAt.
func (*User) UnmarshalJSON ¶ added in v0.1.6
UnmarshalJSON implements stdjson.Unmarshaler.
type UserID ¶
func (UserID) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*UserID) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
Source Files
¶
- oas_cfg_gen.go
- oas_client_gen.go
- oas_handlers_gen.go
- oas_interfaces_gen.go
- oas_json_gen.go
- oas_labeler_gen.go
- oas_middleware_gen.go
- oas_operations_gen.go
- oas_parameters_gen.go
- oas_request_decoders_gen.go
- oas_request_encoders_gen.go
- oas_response_decoders_gen.go
- oas_response_encoders_gen.go
- oas_router_gen.go
- oas_schemas_gen.go
- oas_security_gen.go
- oas_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go