Documentation
¶
Index ¶
- type AdminPluginConfig
- type AdminSessionState
- type AdminUserSession
- type AdminUserState
- type BanUserRequest
- type BanUserResponse
- type CreateAccountRequest
- type CreateAccountResponse
- type CreateSessionStateRequest
- type CreateUserRequest
- type CreateUserResponse
- type CreateUserStateRequest
- type DeleteAccountResponse
- type DeleteSessionStateResponse
- type DeleteUserResponse
- type DeleteUserStateResponse
- type GetAccountByIDResponse
- type GetImpersonationByIDResponse
- type GetSessionStateResponse
- type GetUserByIDResponse
- type GetUserStateResponse
- type Impersonation
- type RevokeSessionRequest
- type RevokeSessionResponse
- type StartImpersonationRequest
- type StartImpersonationResponse
- type StartImpersonationResult
- type StopImpersonationRequest
- type StopImpersonationResponse
- type StopImpersonationResult
- type UnbanUserResponse
- type UpdateAccountRequest
- type UpdateAccountResponse
- type UpdateUserRequest
- type UpdateUserResponse
- type UpsertSessionStateRequest
- type UpsertSessionStateResponse
- type UpsertUserStateRequest
- type UpsertUserStateResponse
- type UserAccountsResponse
- type UsersPage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminPluginConfig ¶
type AdminPluginConfig struct {
Enabled bool `json:"enabled" toml:"enabled"`
ImpersonationMaxExpiresIn time.Duration `json:"impersonation_max_expires_in" toml:"impersonation_max_expires_in"`
}
func (*AdminPluginConfig) ApplyDefaults ¶
func (config *AdminPluginConfig) ApplyDefaults()
type AdminSessionState ¶
type AdminSessionState struct {
bun.BaseModel `bun:"table:admin_session_states"`
SessionID string `json:"session_id" bun:"column:session_id,pk"`
RevokedAt *time.Time `json:"revoked_at" bun:"column:revoked_at"`
RevokedReason *string `json:"revoked_reason" bun:"column:revoked_reason"`
RevokedByUserID *string `json:"revoked_by_user_id" bun:"column:revoked_by_user_id"`
ImpersonatorUserID *string `json:"impersonator_user_id" bun:"column:impersonator_user_id"`
ImpersonatorSessionID *string `json:"impersonator_session_id" bun:"column:impersonator_session_id"`
ImpersonationReason *string `json:"impersonation_reason" bun:"column:impersonation_reason"`
ImpersonationExpiresAt *time.Time `json:"impersonation_expires_at" bun:"column:impersonation_expires_at"`
CreatedAt time.Time `json:"created_at" bun:"column:created_at,default:current_timestamp"`
UpdatedAt time.Time `json:"updated_at" bun:"column:updated_at,default:current_timestamp"`
}
type AdminUserSession ¶
type AdminUserSession struct {
Session models.Session `json:"session"`
State *AdminSessionState `json:"state,omitempty"`
}
type AdminUserState ¶
type AdminUserState struct {
bun.BaseModel `bun:"table:admin_user_states"`
UserID string `json:"user_id" bun:"column:user_id,pk"`
Banned bool `json:"banned" bun:"column:banned"`
BannedAt *time.Time `json:"banned_at" bun:"column:banned_at"`
BannedUntil *time.Time `json:"banned_until" bun:"column:banned_until"`
BannedReason *string `json:"banned_reason" bun:"column:banned_reason"`
BannedByUserID *string `json:"banned_by_user_id" bun:"column:banned_by_user_id"`
CreatedAt time.Time `json:"created_at" bun:"column:created_at,default:current_timestamp"`
UpdatedAt time.Time `json:"updated_at" bun:"column:updated_at,default:current_timestamp"`
}
type BanUserRequest ¶
type BanUserRequest struct {
BannedUntil *time.Time `json:"banned_until,omitempty"`
Reason *string `json:"reason,omitempty"`
}
func (*BanUserRequest) Validate ¶ added in v1.14.0
func (req *BanUserRequest) Validate() error
type BanUserResponse ¶
type BanUserResponse struct {
State *AdminUserState `json:"state"`
}
type CreateAccountRequest ¶
type CreateAccountRequest struct {
ProviderID string `json:"provider_id" validate:"required"`
AccountID string `json:"account_id" validate:"required"`
AccessToken *string `json:"access_token,omitempty"`
RefreshToken *string `json:"refresh_token,omitempty"`
IDToken *string `json:"id_token,omitempty"`
AccessTokenExpiresAt *time.Time `json:"access_token_expires_at,omitempty"`
RefreshTokenExpiresAt *time.Time `json:"refresh_token_expires_at,omitempty"`
Scope *string `json:"scope,omitempty"`
Password *string `json:"password,omitempty"`
}
func (*CreateAccountRequest) Validate ¶ added in v1.7.0
func (req *CreateAccountRequest) Validate() error
type CreateAccountResponse ¶
type CreateSessionStateRequest ¶
type CreateSessionStateRequest struct {
Revoke bool `json:"revoke" validate:"required"`
RevokedReason *string `json:"revoked_reason,omitempty"`
ImpersonatorUserID *string `json:"impersonator_user_id,omitempty"`
ImpersonationReason *string `json:"impersonation_reason,omitempty"`
ImpersonationExpiresAt *time.Time `json:"impersonation_expires_at,omitempty"`
}
func (*CreateSessionStateRequest) Validate ¶ added in v1.14.0
func (req *CreateSessionStateRequest) Validate() error
type CreateUserRequest ¶
type CreateUserRequest struct {
Name string `json:"name" validate:"required"`
Email string `json:"email" validate:"required,email"`
EmailVerified *bool `json:"email_verified,omitempty"`
Image *string `json:"image,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
func (*CreateUserRequest) Validate ¶ added in v1.14.0
func (req *CreateUserRequest) Validate() error
type CreateUserResponse ¶
type CreateUserStateRequest ¶
type CreateUserStateRequest struct {
Banned bool `json:"banned" validate:"required"`
BannedUntil *time.Time `json:"banned_until,omitempty"`
BannedReason *string `json:"banned_reason,omitempty"`
}
func (*CreateUserStateRequest) Validate ¶ added in v1.14.0
func (req *CreateUserStateRequest) Validate() error
type DeleteAccountResponse ¶
type DeleteAccountResponse struct {
Message string `json:"message"`
}
type DeleteSessionStateResponse ¶
type DeleteSessionStateResponse struct {
Message string `json:"message"`
}
type DeleteUserResponse ¶
type DeleteUserResponse struct {
Message string `json:"message"`
}
type DeleteUserStateResponse ¶
type DeleteUserStateResponse struct {
Message string `json:"message"`
}
type GetAccountByIDResponse ¶
type GetImpersonationByIDResponse ¶
type GetImpersonationByIDResponse struct {
Impersonation *Impersonation `json:"impersonation"`
}
type GetSessionStateResponse ¶
type GetSessionStateResponse struct {
State *AdminSessionState `json:"state"`
}
type GetUserByIDResponse ¶
type GetUserStateResponse ¶
type GetUserStateResponse struct {
State *AdminUserState `json:"state"`
}
type Impersonation ¶
type Impersonation struct {
bun.BaseModel `bun:"table:admin_impersonations"`
ID string `json:"id" bun:"column:id,pk"`
ActorUserID string `json:"actor_user_id" bun:"column:actor_user_id"`
TargetUserID string `json:"target_user_id" bun:"column:target_user_id"`
ActorSessionID *string `json:"actor_session_id" bun:"column:actor_session_id"`
ImpersonationSessionID *string `json:"impersonation_session_id" bun:"column:impersonation_session_id"`
Reason string `json:"reason" bun:"column:reason"`
StartedAt time.Time `json:"started_at" bun:"column:started_at"`
ExpiresAt time.Time `json:"expires_at" bun:"column:expires_at"`
EndedAt *time.Time `json:"ended_at" bun:"column:ended_at"`
EndedByUserID *string `json:"ended_by_user_id" bun:"column:ended_by_user_id"`
CreatedAt time.Time `json:"created_at" bun:"column:created_at,default:current_timestamp"`
UpdatedAt time.Time `json:"updated_at" bun:"column:updated_at,default:current_timestamp"`
}
type RevokeSessionRequest ¶
type RevokeSessionRequest struct {
Reason *string `json:"reason,omitempty"`
}
type RevokeSessionResponse ¶
type RevokeSessionResponse struct {
State *AdminSessionState `json:"state"`
}
type StartImpersonationRequest ¶
type StartImpersonationRequest struct {
TargetUserID string `json:"target_user_id" validate:"required"`
Reason string `json:"reason" validate:"required"`
ExpiresInSeconds *int `json:"expires_in_seconds,omitempty"`
}
func (*StartImpersonationRequest) Validate ¶ added in v1.14.0
func (req *StartImpersonationRequest) Validate() error
type StartImpersonationResponse ¶
type StartImpersonationResponse struct {
Impersonation *Impersonation `json:"impersonation"`
}
type StartImpersonationResult ¶
type StartImpersonationResult struct {
Impersonation *Impersonation `json:"impersonation"`
SessionID *string `json:"session_id,omitempty"`
SessionToken *string `json:"session_token,omitempty"`
ImpersonatorUserID string `json:"-"`
ImpersonatorScopes []string `json:"-"`
OriginalCookieToken string `json:"-"`
OriginalCookieMaxAge int `json:"-"`
TargetUserID string `json:"-"`
}
type StopImpersonationRequest ¶
type StopImpersonationRequest struct {
ImpersonationID *string `json:"impersonation_id,omitempty"`
}
type StopImpersonationResponse ¶
type StopImpersonationResponse struct {
Message string `json:"message"`
}
type StopImpersonationResult ¶ added in v1.14.0
type StopImpersonationResult struct {
OriginalSessionToken string `json:"-"`
}
type UnbanUserResponse ¶
type UnbanUserResponse struct {
State *AdminUserState `json:"state"`
}
type UpdateAccountRequest ¶
type UpdateAccountRequest struct {
ProviderID *string `json:"provider_id,omitempty"`
AccountID *string `json:"account_id,omitempty"`
AccessToken *string `json:"access_token,omitempty"`
RefreshToken *string `json:"refresh_token,omitempty"`
IDToken *string `json:"id_token,omitempty"`
AccessTokenExpiresAt *time.Time `json:"access_token_expires_at,omitempty"`
RefreshTokenExpiresAt *time.Time `json:"refresh_token_expires_at,omitempty"`
Scope *string `json:"scope,omitempty"`
Password *string `json:"password,omitempty"`
}
func (*UpdateAccountRequest) Validate ¶ added in v1.7.0
func (req *UpdateAccountRequest) Validate() error
type UpdateAccountResponse ¶
type UpdateUserRequest ¶
type UpdateUserRequest struct {
Name *string `json:"name,omitempty" validate:"omitempty"`
Email *string `json:"email,omitempty" validate:"omitempty,email"`
EmailVerified *bool `json:"email_verified,omitempty"`
Image *string `json:"image,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
func (*UpdateUserRequest) Validate ¶ added in v1.14.0
func (req *UpdateUserRequest) Validate() error
type UpdateUserResponse ¶
type UpsertSessionStateRequest ¶
type UpsertSessionStateRequest struct {
Revoke bool `json:"revoke" validate:"required"`
RevokedReason *string `json:"revoked_reason,omitempty"`
ImpersonatorUserID *string `json:"impersonator_user_id,omitempty"`
ImpersonationReason *string `json:"impersonation_reason,omitempty"`
ImpersonationExpiresAt *time.Time `json:"impersonation_expires_at,omitempty"`
}
func (*UpsertSessionStateRequest) Validate ¶ added in v1.14.0
func (req *UpsertSessionStateRequest) Validate() error
type UpsertSessionStateResponse ¶
type UpsertSessionStateResponse struct {
State *AdminSessionState `json:"state"`
}
type UpsertUserStateRequest ¶
type UpsertUserStateRequest struct {
Banned bool `json:"banned" validate:"required"`
BannedUntil *time.Time `json:"banned_until,omitempty"`
BannedReason *string `json:"banned_reason,omitempty"`
}
func (*UpsertUserStateRequest) Validate ¶ added in v1.14.0
func (req *UpsertUserStateRequest) Validate() error
type UpsertUserStateResponse ¶
type UpsertUserStateResponse struct {
State *AdminUserState `json:"state"`
}
type UserAccountsResponse ¶
Click to show internal directories.
Click to hide internal directories.