userapi

package
v1.0.67 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(group *gin.RouterGroup, handler *Handler)

Register wires user API routes.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(repo *cluster.Repository, runtime *home.Runtime) *Handler

NewHandler creates a user API handler.

func (*Handler) BeginPasskeyLogin

func (h *Handler) BeginPasskeyLogin(c *gin.Context)

BeginPasskeyLogin returns WebAuthn assertion options for passkey login.

func (*Handler) BeginPasskeyRegistration

func (h *Handler) BeginPasskeyRegistration(c *gin.Context)

BeginPasskeyRegistration returns WebAuthn creation options for the authenticated user.

func (*Handler) BindTOTP

func (h *Handler) BindTOTP(c *gin.Context)

BindTOTP verifies and stores a TOTP secret for the authenticated user.

func (*Handler) ChangePassword

func (h *Handler) ChangePassword(c *gin.Context)

ChangePassword updates the authenticated user's password.

func (*Handler) ClearEmail added in v1.0.60

func (h *Handler) ClearEmail(c *gin.Context)

ClearEmail removes the authenticated user's email and invalidates email-bound security state.

func (*Handler) CreateAPIKey

func (h *Handler) CreateAPIKey(c *gin.Context)

CreateAPIKey creates an API key owned by the authenticated user.

func (*Handler) CreatePasskey

func (h *Handler) CreatePasskey(c *gin.Context)

CreatePasskey creates a passkey entry for the authenticated user.

func (*Handler) CurrentUser added in v1.0.30

func (h *Handler) CurrentUser(c *gin.Context)

CurrentUser returns the authenticated user profile.

func (*Handler) CurrentUserBillingOverview added in v1.0.32

func (h *Handler) CurrentUserBillingOverview(c *gin.Context)

CurrentUserBillingOverview returns the billing overview for the authenticated user.

func (*Handler) DeleteAPIKey

func (h *Handler) DeleteAPIKey(c *gin.Context)

DeleteAPIKey deletes an API key owned by the authenticated user.

func (*Handler) DeletePasskey

func (h *Handler) DeletePasskey(c *gin.Context)

DeletePasskey deletes a passkey entry for the authenticated user.

func (*Handler) DeleteTOTP added in v1.0.30

func (h *Handler) DeleteTOTP(c *gin.Context)

DeleteTOTP removes the authenticated user's TOTP configuration.

func (*Handler) ForgotPassword added in v1.0.60

func (h *Handler) ForgotPassword(c *gin.Context)

ForgotPassword accepts recovery requests without revealing account state.

func (*Handler) GetCapabilities added in v1.0.60

func (h *Handler) GetCapabilities(c *gin.Context)

GetCapabilities reports optional User API features without exposing mail configuration.

The manifest spans subsystems on purpose: a client reads it once at startup to decide which surfaces to render, so every optional feature belongs here rather than in whichever file happens to implement it.

func (*Handler) ListAPIKeys

func (h *Handler) ListAPIKeys(c *gin.Context)

ListAPIKeys lists API keys owned by the authenticated user.

func (*Handler) ListAccessibleModels added in v1.0.67

func (h *Handler) ListAccessibleModels(c *gin.Context)

ListAccessibleModels returns the subset of the catalog the caller's own API keys are allowed to call.

It is deliberately separate from the public catalog rather than a query parameter on it: the two answer different questions ("what does this cluster sell" versus "what can I call today"), and only one of them may be answered without a token.

func (*Handler) ListCurrentUserBillingCharges added in v1.0.32

func (h *Handler) ListCurrentUserBillingCharges(c *gin.Context)

ListCurrentUserBillingCharges returns billing charges for the authenticated user.

func (*Handler) ListModels added in v1.0.67

func (h *Handler) ListModels(c *gin.Context)

ListModels returns the public model catalog: every model the cluster can currently serve, described in buyer terms.

The route is unauthenticated on purpose — a visitor has to see what is on offer before deciding to hold an account — and it is deliberately narrower than the signed-in view. Prices and observed performance are withheld here, not because they are secret in principle but because they are the operator's commercial terms with a specific buyer; the visitor sees capability, the account holder sees the offer. Nothing here exposes the registry's internal registration shape, so credentials, auth identifiers and per-client counts stay out of reach.

func (*Handler) Login

func (h *Handler) Login(c *gin.Context)

Login handles password login without TOTP verification.

func (*Handler) LoginPasskey

func (h *Handler) LoginPasskey(c *gin.Context)

LoginPasskey handles passkey login.

func (*Handler) LoginTOTP

func (h *Handler) LoginTOTP(c *gin.Context)

LoginTOTP handles password login with TOTP verification.

func (*Handler) RegisterUser

func (h *Handler) RegisterUser(c *gin.Context)

RegisterUser creates a user account.

func (*Handler) RequestEmailVerification added in v1.0.60

func (h *Handler) RequestEmailVerification(c *gin.Context)

RequestEmailVerification queues a verification message for the current unverified email.

func (*Handler) ResetPassword added in v1.0.60

func (h *Handler) ResetPassword(c *gin.Context)

ResetPassword consumes a reset token and sets a new password without bypassing MFA or Passkeys.

func (*Handler) ShowTOTP

func (h *Handler) ShowTOTP(c *gin.Context)

ShowTOTP returns a TOTP setup secret and otpauth URL.

func (*Handler) UpdateAPIKey

func (h *Handler) UpdateAPIKey(c *gin.Context)

UpdateAPIKey updates an API key owned by the authenticated user.

func (*Handler) UpdateEmail added in v1.0.60

func (h *Handler) UpdateEmail(c *gin.Context)

UpdateEmail adds or replaces the authenticated user's optional email.

func (*Handler) VerifyEmail added in v1.0.60

func (h *Handler) VerifyEmail(c *gin.Context)

VerifyEmail consumes a single-use email-verification token.

Jump to

Keyboard shortcuts

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