Skip to content

http ​

go
import "github.com/prescriptoo/prescriptoo-api/services/identity/internal/presentation/http"

Package http exposes the identity API through Huma.

Index ​

type ChangePasswordInput ​

ChangePasswordInput carries authentication and the current and replacement passwords.

go
type ChangePasswordInput struct {
    Authorization string `header:"Authorization" hidden:"true"`
    Body          struct {
        CurrentPassword string `json:"currentPassword" minLength:"1" maxLength:"128" writeOnly:"true" example:"ExamplePassword123!" doc:"Current password, required to authorize the change."`
        NewPassword     string `json:"newPassword" minLength:"8" maxLength:"128" writeOnly:"true" example:"NewExamplePassword123!" doc:"Replacement password, 8–128 characters."`
    }
}

type ChangePasswordOutput ​

ChangePasswordOutput represents a successful password change with an empty data object.

go
type ChangePasswordOutput struct {
    Body types.SuccessResponse[types.Empty]
}

type ForgotPasswordInput ​

ForgotPasswordInput contains the email address for a password reset request.

go
type ForgotPasswordInput struct {
    Body struct {
        Email string `json:"email" format:"email" maxLength:"255" example:"user@example.com" doc:"Email to which the token should be sent, if eligible."`
    }
}

type ForgotPasswordOutput ​

ForgotPasswordOutput wraps the password reset request acknowledgment.

go
type ForgotPasswordOutput struct {
    Body types.SuccessResponse[types.Empty]
}

type GetMeInput ​

GetMeInput carries authentication for retrieving the current user's profile.

go
type GetMeInput struct {
    Authorization string `header:"Authorization" hidden:"true"`
}

type GetMeOutput ​

GetMeOutput wraps the current user's profile.

go
type GetMeOutput struct {
    Body types.SuccessResponse[usecase.User]
}

type Handler ​

Handler wires each endpoint to its dedicated application use case.

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

func NewHandler ​

go
func NewHandler(auth *usecase.Auth) *Handler

NewHandler wires HTTP operations to their application use cases.

func (*Handler) RegisterHuma ​

go
func (h *Handler) RegisterHuma(api huma.API)

RegisterHuma registers both the routes and their OpenAPI contracts.

type ListSessionsInput ​

ListSessionsInput carries authentication for listing the current user's sessions.

go
type ListSessionsInput struct {
    Authorization string `header:"Authorization" hidden:"true"`
}

type ListSessionsOutput ​

ListSessionsOutput wraps the current user's active sessions.

go
type ListSessionsOutput struct {
    Body types.SuccessResponse[[]usecase.Session]
}

type LoginInput ​

LoginInput contains the email and password used to authenticate an account.

go
type LoginInput struct {
    Body struct {
        Email    string `json:"email" format:"email" maxLength:"255" example:"user@example.com" doc:"Registered email address."`
        Password string `json:"password" minLength:"1" maxLength:"128" writeOnly:"true" example:"ExamplePassword123!" doc:"Current account password."`
    }
}

type LoginOutput ​

LoginOutput wraps the access and refresh tokens issued at login.

go
type LoginOutput struct {
    Body types.SuccessResponse[usecase.TokenPair]
}

type LogoutAllInput ​

LogoutAllInput carries authentication for revoking all of the user's sessions.

go
type LogoutAllInput struct {
    Authorization string `header:"Authorization" hidden:"true"`
}

type LogoutAllOutput ​

LogoutAllOutput represents a successful logout from all sessions with an empty data object.

go
type LogoutAllOutput struct {
    Body types.SuccessResponse[types.Empty]
}

type LogoutInput ​

LogoutInput contains the refresh token identifying the session to revoke.

go
type LogoutInput struct {
    Body struct {
        RefreshToken string `json:"refreshToken" minLength:"1" maxLength:"512" writeOnly:"true" example:"refresh-token-example" doc:"Secret refresh token issued by login or the most recent refresh."`
    }
}

type LogoutOutput ​

LogoutOutput represents a successful logout with an empty data object.

go
type LogoutOutput struct {
    Body types.SuccessResponse[types.Empty]
}

type RefreshInput ​

RefreshInput contains the refresh token to exchange for new credentials.

go
type RefreshInput struct {
    Body struct {
        RefreshToken string `json:"refreshToken" minLength:"1" maxLength:"512" writeOnly:"true" example:"refresh-token-example" doc:"Secret refresh token issued by login or the most recent refresh."`
    }
}

type RefreshOutput ​

RefreshOutput wraps the replacement access and refresh tokens.

go
type RefreshOutput struct {
    Body types.SuccessResponse[usecase.TokenPair]
}

type RegisterInput ​

RegisterInput contains the email, password, and name for a new account.

go
type RegisterInput struct {
    Body struct {
        Email    string `json:"email" format:"email" maxLength:"255" example:"user@example.com" doc:"Unique account email address."`
        Password string `json:"password" minLength:"8" maxLength:"128" writeOnly:"true" example:"ExamplePassword123!" doc:"Account password, 8–128 characters."`
        Name     string `json:"name" minLength:"1" maxLength:"255" example:"Jane Doe" doc:"User display name."`
    }
}

type RegisterOutput ​

RegisterOutput wraps the newly registered user's profile.

go
type RegisterOutput struct {
    Body types.SuccessResponse[usecase.User]
}

type RequestEmailVerificationInput ​

RequestEmailVerificationInput contains the email address for a verification request.

go
type RequestEmailVerificationInput struct {
    Body struct {
        Email string `json:"email" format:"email" maxLength:"255" example:"user@example.com" doc:"Email to which the token should be sent, if eligible."`
    }
}

type RequestEmailVerificationOutput ​

RequestEmailVerificationOutput wraps the email verification request acknowledgment.

go
type RequestEmailVerificationOutput struct {
    Body types.SuccessResponse[types.Empty]
}

type ResetPasswordInput ​

ResetPasswordInput contains a password reset token and the replacement password.

go
type ResetPasswordInput struct {
    Body struct {
        Token       string `json:"token" minLength:"1" maxLength:"512" writeOnly:"true" example:"single-use-reset-token-example" doc:"Single-use password-reset token received by email."`
        NewPassword string `json:"newPassword" minLength:"8" maxLength:"128" writeOnly:"true" example:"NewExamplePassword123!" doc:"Replacement password, 8–128 characters."`
    }
}

type ResetPasswordOutput ​

ResetPasswordOutput represents a successful password reset with an empty data object.

go
type ResetPasswordOutput struct {
    Body types.SuccessResponse[types.Empty]
}

type RevokeSessionInput ​

RevokeSessionInput carries authentication and the ID of the session to revoke.

go
type RevokeSessionInput struct {
    Authorization string `header:"Authorization" hidden:"true"`
    SessionID     string `path:"sessionId" format:"uuid" example:"cd20a97b-5107-44db-bf05-66c86c54aa91" doc:"ID of a session owned by the authenticated user."`
}

type RevokeSessionOutput ​

RevokeSessionOutput represents successful session revocation with an empty data object.

go
type RevokeSessionOutput struct {
    Body types.SuccessResponse[types.Empty]
}

type UpdateMeInput ​

UpdateMeInput carries authentication and replacement profile details.

go
type UpdateMeInput struct {
    Authorization string `header:"Authorization" hidden:"true"`
    Body          struct {
        Name      string `json:"name" minLength:"1" maxLength:"255" example:"Jane Doe" doc:"Replacement display name."`
        Phone     string `json:"phone,omitempty" maxLength:"20" example:"+8801700000000" doc:"Replacement phone number. Omit or send an empty string to clear."`
        AvatarURL string `json:"avatarUrl,omitempty" maxLength:"2048" example:"https://example.com/avatar.png" doc:"Replacement absolute HTTP or HTTPS avatar URL. Omit or send an empty string to clear."`
    }
}

type UpdateMeOutput ​

UpdateMeOutput wraps the updated user profile.

go
type UpdateMeOutput struct {
    Body types.SuccessResponse[usecase.User]
}

type VerifyEmailInput ​

VerifyEmailInput contains the email verification token to confirm.

go
type VerifyEmailInput struct {
    Body struct {
        Token string `json:"token" minLength:"1" maxLength:"512" writeOnly:"true" example:"single-use-token-example" doc:"Single-use verification token received by email."`
    }
}

type VerifyEmailOutput ​

VerifyEmailOutput represents successful email verification with an empty data object.

go
type VerifyEmailOutput struct {
    Body types.SuccessResponse[types.Empty]
}

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.