auth

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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

func NewResource(fc *comby.Facade, api huma.API, email email.Email) *Resource

NewResource creates new instance

func (*Resource) AccountRegister

func (*Resource) OneTimeTokenValidate

func (rs *Resource) OneTimeTokenValidate(ctx context.Context, req *RequestOneTimeTokenValidate) (*ResponseAuthWithScope, error)

func (*Resource) Register

func (rs *Resource) Register()

func (*Resource) ThrottleRequest

func (rs *Resource) ThrottleRequest(ctx context.Context, req *RequestAuthAccountRegister) error

type ResponseAuthWithScope

type ResponseAuthWithScope struct {
	Body struct {
		Scope   *AuthScope `json:"authScope,omitempty"`
		Error   string     `json:"error,omitempty"`
		Message string     `json:"message,omitempty"`
	}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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