Documentation
¶
Index ¶
- Variables
- type AdminCreateParams
- type Error
- type JWTCreateParams
- type JWTCreateRequest
- type JWTCreateResponse
- type JWTCreateResults
- type JWTValidateParams
- type JWTValidateRequest
- type JWTValidateResponse
- type JWTValidateResults
- type MagicLinkCreateParams
- type MagicLinkCreateRequest
- type MagicLinkCreateResponse
- type MagicLinkCreateResults
- type MagicLinkEmailCreateParams
- type MagicLinkEmailCreateRequest
- type MagicLinkEmailCreateResponse
- type MagicLinkEmailCreateResults
- type OTPCreateParams
- type OTPCreateRequest
- type OTPCreateResponse
- type OTPCreateResults
- type OTPEmailCreateParams
- type OTPEmailCreateRequest
- type OTPEmailCreateResponse
- type OTPEmailCreateResults
- type OTPValidateParams
- type OTPValidateRequest
- type OTPValidateResponse
- type OTPValidateResults
- type RequestMetadata
- type ServiceAccount
- type ServiceAccountCreateParams
- type ServiceAccountCreateRequest
- type ServiceAccountCreateResponse
- type ServiceAccountCreateResults
- type ValidAdminCreateParams
- type ValidJWTCreateParams
- type ValidJWTCreateRequest
- type ValidJWTValidateParams
- type ValidJWTValidateRequest
- type ValidMagicLinkCreateParams
- type ValidMagicLinkCreateRequest
- type ValidMagicLinkEmailCreateParams
- type ValidMagicLinkEmailCreateRequest
- type ValidOTPCreateParams
- type ValidOTPCreateRequest
- type ValidOTPEmailCreateParams
- type ValidOTPEmailCreateRequest
- type ValidOTPValidateParams
- type ValidOTPValidateRequest
- type ValidServiceAccountCreateParams
- type ValidServiceAccountCreateRequest
- type Validation
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidModel = errors.New("invalid model")
ErrInvalidModel is returned when a model is invalid.
Functions ¶
This section is empty.
Types ¶
type AdminCreateParams ¶ added in v0.6.0
type AdminCreateParams struct {
APIKey uuid.UUID `json:"apiKey"`
Aud uuid.UUID `json:"aud"`
UUID uuid.UUID `json:"uuid"`
ServiceAccountCreateParams ServiceAccountCreateParams `json:"serviceAccountCreateParams"`
}
func (AdminCreateParams) Validate ¶ added in v0.6.0
func (a AdminCreateParams) Validate(config Validation) (ValidAdminCreateParams, error)
type Error ¶
type Error struct {
Code int `json:"code"`
Message string `json:"message"`
RequestMetadata RequestMetadata `json:"requestMetadata"`
}
Error is the model for an error.
type JWTCreateParams ¶ added in v0.6.0
type JWTCreateParams struct {
Alg string `json:"alg"`
Claims any `json:"claims"`
LifespanSeconds int `json:"lifespanSeconds"`
}
func (JWTCreateParams) Validate ¶ added in v0.6.0
func (j JWTCreateParams) Validate(config Validation) (ValidJWTCreateParams, error)
type JWTCreateRequest ¶
type JWTCreateRequest struct {
JWTCreateParams JWTCreateParams `json:"jwtCreateParams"`
}
func (JWTCreateRequest) Validate ¶
func (j JWTCreateRequest) Validate(config Validation) (ValidJWTCreateRequest, error)
type JWTCreateResponse ¶
type JWTCreateResponse struct {
JWTCreateResults JWTCreateResults `json:"jwtCreateResults"`
RequestMetadata RequestMetadata `json:"requestMetadata"`
}
type JWTCreateResults ¶
type JWTCreateResults struct {
JWT string `json:"jwt"`
}
type JWTValidateParams ¶ added in v0.6.0
type JWTValidateParams struct {
JWT string `json:"jwt"`
}
func (JWTValidateParams) Validate ¶ added in v0.6.0
func (j JWTValidateParams) Validate(_ Validation) (ValidJWTValidateParams, error)
type JWTValidateRequest ¶
type JWTValidateRequest struct {
JWTValidateParams JWTValidateParams `json:"jwtValidateParams"`
}
func (JWTValidateRequest) Validate ¶
func (j JWTValidateRequest) Validate(config Validation) (ValidJWTValidateRequest, error)
type JWTValidateResponse ¶
type JWTValidateResponse struct {
JWTValidateResults JWTValidateResults `json:"jwtValidateResults"`
RequestMetadata RequestMetadata `json:"requestMetadata"`
}
type JWTValidateResults ¶
type JWTValidateResults struct {
JWTClaims json.RawMessage `json:"claims"`
}
type MagicLinkCreateParams ¶ added in v0.6.0
type MagicLinkCreateParams struct {
JWTCreateParams JWTCreateParams `json:"jwtCreateParams"`
LifespanSeconds int `json:"lifespanSeconds"`
RedirectQueryKey string `json:"redirectQueryKey"`
RedirectURL string `json:"redirectURL"`
}
func (MagicLinkCreateParams) Validate ¶ added in v0.6.0
func (p MagicLinkCreateParams) Validate(config Validation) (ValidMagicLinkCreateParams, error)
type MagicLinkCreateRequest ¶ added in v0.6.0
type MagicLinkCreateRequest struct {
MagicLinkCreateParams MagicLinkCreateParams `json:"magicLinkCreateParams"`
}
func (MagicLinkCreateRequest) Validate ¶ added in v0.6.0
func (b MagicLinkCreateRequest) Validate(config Validation) (ValidMagicLinkCreateRequest, error)
type MagicLinkCreateResponse ¶ added in v0.6.0
type MagicLinkCreateResponse struct {
MagicLinkCreateResults MagicLinkCreateResults `json:"magicLinkCreateResults"`
RequestMetadata RequestMetadata `json:"requestMetadata"`
}
type MagicLinkCreateResults ¶ added in v0.6.0
type MagicLinkEmailCreateParams ¶ added in v0.6.0
type MagicLinkEmailCreateParams struct {
ButtonText string `json:"buttonText"`
Greeting string `json:"greeting"`
LogoClickURL string `json:"logoClickURL"`
LogoImageURL string `json:"logoImageURL"`
ServiceName string `json:"serviceName"`
Subject string `json:"subject"`
SubTitle string `json:"subTitle"`
Title string `json:"title"`
ToEmail string `json:"toEmail"`
ToName string `json:"toName"`
}
func (MagicLinkEmailCreateParams) Validate ¶ added in v0.6.0
func (p MagicLinkEmailCreateParams) Validate(config Validation) (ValidMagicLinkEmailCreateParams, error)
type MagicLinkEmailCreateRequest ¶ added in v0.6.0
type MagicLinkEmailCreateRequest struct {
MagicLinkCreateParams MagicLinkCreateParams `json:"magicLinkCreateParams"`
MagicLinkEmailCreateParams MagicLinkEmailCreateParams `json:"magicLinkEmailCreateParams"`
}
func (MagicLinkEmailCreateRequest) Validate ¶ added in v0.6.0
func (b MagicLinkEmailCreateRequest) Validate(config Validation) (ValidMagicLinkEmailCreateRequest, error)
type MagicLinkEmailCreateResponse ¶ added in v0.6.0
type MagicLinkEmailCreateResponse struct {
MagicLinkEmailCreateResults MagicLinkEmailCreateResults `json:"magicLinkEmailCreateResults"`
RequestMetadata RequestMetadata `json:"requestMetadata"`
}
type MagicLinkEmailCreateResults ¶ added in v0.6.0
type MagicLinkEmailCreateResults struct {
MagicLinkCreateResults MagicLinkCreateResults `json:"magicLinkCreateResults"`
}
type OTPCreateParams ¶ added in v0.6.0
type OTPCreateParams struct {
CharSetAlphaLower bool `json:"charSetAlphaLower"`
CharSetAlphaUpper bool `json:"charSetAlphaUpper"`
CharSetNumeric bool `json:"charSetNumeric"`
Length uint `json:"length"`
LifespanSeconds int `json:"lifespanSeconds"`
}
func (OTPCreateParams) Validate ¶ added in v0.6.0
func (o OTPCreateParams) Validate(config Validation) (ValidOTPCreateParams, error)
type OTPCreateRequest ¶ added in v0.6.0
type OTPCreateRequest struct {
OTPCreateParams OTPCreateParams `json:"otpCreateParams"`
}
func (OTPCreateRequest) Validate ¶ added in v0.6.0
func (o OTPCreateRequest) Validate(config Validation) (ValidOTPCreateRequest, error)
type OTPCreateResponse ¶ added in v0.6.0
type OTPCreateResponse struct {
OTPCreateResults OTPCreateResults `json:"otpCreateResults"`
RequestMetadata RequestMetadata `json:"requestMetadata"`
}
type OTPCreateResults ¶ added in v0.6.0
type OTPEmailCreateParams ¶ added in v0.6.0
type OTPEmailCreateParams struct {
Greeting string `json:"greeting"`
LogoClickURL string `json:"logoClickURL"`
LogoImageURL string `json:"logoImageURL"`
ServiceName string `json:"serviceName"`
Subject string `json:"subject"`
SubTitle string `json:"subTitle"`
Title string `json:"title"`
ToEmail string `json:"toEmail"`
ToName string `json:"toName"`
}
func (OTPEmailCreateParams) Validate ¶ added in v0.6.0
func (p OTPEmailCreateParams) Validate(config Validation) (ValidOTPEmailCreateParams, error)
type OTPEmailCreateRequest ¶ added in v0.6.0
type OTPEmailCreateRequest struct {
OTPCreateParams OTPCreateParams `json:"otpCreateParams"`
OTPEmailCreateParams OTPEmailCreateParams `json:"otpEmailCreateParams"`
}
func (OTPEmailCreateRequest) Validate ¶ added in v0.6.0
func (b OTPEmailCreateRequest) Validate(config Validation) (ValidOTPEmailCreateRequest, error)
type OTPEmailCreateResponse ¶ added in v0.6.0
type OTPEmailCreateResponse struct {
OTPEmailCreateResults OTPEmailCreateResults `json:"otpEmailCreateResults"`
RequestMetadata RequestMetadata `json:"requestMetadata"`
}
type OTPEmailCreateResults ¶ added in v0.6.0
type OTPEmailCreateResults struct {
OTPCreateResults OTPCreateResults `json:"otpCreateResults"`
}
type OTPValidateParams ¶ added in v0.6.0
func (OTPValidateParams) Validate ¶ added in v0.6.0
func (o OTPValidateParams) Validate(_ Validation) (ValidOTPValidateParams, error)
type OTPValidateRequest ¶ added in v0.6.0
type OTPValidateRequest struct {
OTPValidateParams OTPValidateParams `json:"otpValidateParams"`
}
func (OTPValidateRequest) Validate ¶ added in v0.6.0
func (o OTPValidateRequest) Validate(config Validation) (ValidOTPValidateRequest, error)
type OTPValidateResponse ¶ added in v0.6.0
type OTPValidateResponse struct {
OTPValidateResults OTPValidateResults `json:"otpValidateResults"`
RequestMetadata RequestMetadata `json:"requestMetadata"`
}
type OTPValidateResults ¶ added in v0.6.0
type OTPValidateResults struct{}
type RequestMetadata ¶
RequestMetadata is the model for request metadata.
type ServiceAccount ¶
type ServiceAccount struct {
UUID uuid.UUID `json:"uuid"`
APIKey uuid.UUID `json:"apiKey"`
Aud uuid.UUID `json:"aud"`
Admin bool `json:"admin"`
}
ServiceAccount is the model for a service account and its metadata.
type ServiceAccountCreateParams ¶ added in v0.6.0
type ServiceAccountCreateParams struct{}
func (ServiceAccountCreateParams) Validate ¶ added in v0.6.0
func (s ServiceAccountCreateParams) Validate(_ Validation) (ValidServiceAccountCreateParams, error)
type ServiceAccountCreateRequest ¶
type ServiceAccountCreateRequest struct {
ServiceAccountCreateParams ServiceAccountCreateParams `json:"serviceAccountCreateParams"`
}
func (ServiceAccountCreateRequest) Validate ¶
func (s ServiceAccountCreateRequest) Validate(config Validation) (ValidServiceAccountCreateRequest, error)
type ServiceAccountCreateResponse ¶
type ServiceAccountCreateResponse struct {
ServiceAccountCreateResults ServiceAccountCreateResults `json:"serviceAccountCreateResults"`
RequestMetadata RequestMetadata `json:"requestMetadata"`
}
type ServiceAccountCreateResults ¶
type ServiceAccountCreateResults struct {
ServiceAccount ServiceAccount `json:"serviceAccount"`
}
type ValidAdminCreateParams ¶ added in v0.6.0
type ValidJWTCreateParams ¶ added in v0.6.0
type ValidJWTCreateParams struct {
Alg string
Claims json.RawMessage
Lifespan time.Duration
}
type ValidJWTCreateRequest ¶
type ValidJWTCreateRequest struct {
JWTCreateParams ValidJWTCreateParams
}
type ValidJWTValidateParams ¶ added in v0.6.0
type ValidJWTValidateParams struct {
JWT string
}
type ValidJWTValidateRequest ¶
type ValidJWTValidateRequest struct {
JWTValidateParams ValidJWTValidateParams
}
type ValidMagicLinkCreateParams ¶ added in v0.6.0
type ValidMagicLinkCreateRequest ¶ added in v0.6.0
type ValidMagicLinkCreateRequest struct {
MagicLinkParams ValidMagicLinkCreateParams
}
type ValidMagicLinkEmailCreateParams ¶ added in v0.6.0
type ValidMagicLinkEmailCreateRequest ¶ added in v0.6.0
type ValidMagicLinkEmailCreateRequest struct {
MagicLinkCreateParams ValidMagicLinkCreateParams
MagicLinkEmailCreateParams ValidMagicLinkEmailCreateParams
}
type ValidOTPCreateParams ¶ added in v0.6.0
type ValidOTPCreateRequest ¶ added in v0.6.0
type ValidOTPCreateRequest struct {
OTPCreateParams ValidOTPCreateParams
}
type ValidOTPEmailCreateParams ¶ added in v0.6.0
type ValidOTPEmailCreateRequest ¶ added in v0.6.0
type ValidOTPEmailCreateRequest struct {
OTPCreateParams ValidOTPCreateParams
OTPEmailCreateParams ValidOTPEmailCreateParams
}
type ValidOTPValidateParams ¶ added in v0.6.0
type ValidOTPValidateRequest ¶ added in v0.6.0
type ValidOTPValidateRequest struct {
OTPValidateParams ValidOTPValidateParams
}
type ValidServiceAccountCreateParams ¶ added in v0.6.0
type ValidServiceAccountCreateParams struct{}
type ValidServiceAccountCreateRequest ¶
type ValidServiceAccountCreateRequest struct {
ServiceAccountCreateParams ValidServiceAccountCreateParams
}
type Validation ¶
type Validation struct {
LinkLifespanDefault *jt.JSONType[time.Duration] `json:"linkLifespanDefault"`
LifeSpanSeconds *jt.JSONType[time.Duration] `json:"maxLinkLifespan"`
JWTClaimsMaxBytes uint `json:"maxJWTClaimsBytes"`
JWTLifespanDefault *jt.JSONType[time.Duration] `json:"jwtLifespanDefault"`
JWTLifespanMax *jt.JSONType[time.Duration] `json:"maxJWTLifespan"`
ServiceNameMinUTF8 uint `json:"serviceNameMinUTF8"`
ServiceNameMaxUTF8 uint `json:"serviceNameMaxUTF8"`
URLMaxLength uint `json:"urlMaxLength"`
}
Validation contains information on how to validate models.
func (Validation) DefaultsAndValidate ¶
func (v Validation) DefaultsAndValidate() (Validation, error)
Click to show internal directories.
Click to hide internal directories.