Documentation
¶
Index ¶
- Constants
- Variables
- type AuthScope
- type RequestAuthAccountRegister
- type RequestOneTimeTokenValidate
- type Resource
- func (rs *Resource) AccountRegister(ctx context.Context, req *RequestAuthAccountRegister) (*ResponseAuthWithScope, error)
- func (rs *Resource) OneTimeTokenValidate(ctx context.Context, req *RequestOneTimeTokenValidate) (*ResponseAuthWithScope, error)
- func (rs *Resource) Register()
- func (rs *Resource) ThrottleRequest(ctx context.Context, req *RequestAuthAccountRegister) error
- type ResponseAuthWithScope
Constants ¶
View Source
const AUTH_SCOPE_REGISTER = "auth-account-register"
Variables ¶
View Source
var ( // ACCOUNT_REGISTRATION_CONFIRMATION_URL is the default URL for account registration confirmation. // While developing, this URL can be set to a local URL like "http://localhost:9000/auth/register/{ott}". ACCOUNT_REGISTRATION_CONFIRMATION_URL string = "https://www.example.tld/auth/register/{ott}" // account account confirmation email content ACCOUNT_REGISTRATION_CONFIRMATION_SUBJECT string = "Confirm your registration" ACCOUNT_REGISTRATION_CONFIRMATION_MESSAGE string = "Please confirm your registration by clicking the following link: {linkUrl}" )
Functions ¶
This section is empty.
Types ¶
type AuthScope ¶
type AuthScope struct {
OneTimeToken string `json:"oneTimeToken,omitempty"`
Action string `json:"action"`
Object string `json:"object"`
ExpiredAt int64 `json:"expiredAt"`
}
AuthScope represents the authorization scope for a specific action.
type RequestAuthAccountRegister ¶
type RequestAuthAccountRegister struct {
Body struct {
Email string `json:"email" validate:"required" doc:"email of the account" example:"user@example.com"`
}
}
type RequestOneTimeTokenValidate ¶
type RequestOneTimeTokenValidate struct {
Body struct {
OneTimeToken string `json:"oneTimeToken" validate:"required"`
}
}
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
Resource struct
func NewResource ¶
NewResource creates new instance
func (*Resource) AccountRegister ¶
func (rs *Resource) AccountRegister(ctx context.Context, req *RequestAuthAccountRegister) (*ResponseAuthWithScope, error)
func (*Resource) OneTimeTokenValidate ¶
func (rs *Resource) OneTimeTokenValidate(ctx context.Context, req *RequestOneTimeTokenValidate) (*ResponseAuthWithScope, error)
func (*Resource) ThrottleRequest ¶
func (rs *Resource) ThrottleRequest(ctx context.Context, req *RequestAuthAccountRegister) error
type ResponseAuthWithScope ¶
Click to show internal directories.
Click to hide internal directories.