setup

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelTempLoginResponse

type CancelTempLoginResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

type ConfirmOwnerRequest

type ConfirmOwnerRequest struct {
	Email string `json:"email"`
}

type ConfirmOwnerResponse

type ConfirmOwnerResponse struct {
	Success bool   `json:"success"`
	UserID  uint   `json:"userId"`
	Email   string `json:"email"`
	Message string `json:"message"`
}

type ExplicitRoleEmailsResponse

type ExplicitRoleEmailsResponse struct {
	Owners []string `json:"owners"`
	Admins []string `json:"admins"`
}

type Handler

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

func NewHandler

func NewHandler(serverURL string) *Handler

func (*Handler) CancelTempLogin

func (h *Handler) CancelTempLogin(req api.Context) error

CancelTempLogin removes the temporary user from the cache and optionally demotes the user in the database. Endpoint: POST /api/setup/cancel-temp-login

func (*Handler) ConfirmOwner

func (h *Handler) ConfirmOwner(req api.Context) error

ConfirmOwner confirms the temporary user as a permanent Owner. The user is already in the database (created during OAuth), so we just ensure they have the Owner role and clear the cache. Endpoint: POST /api/setup/confirm-owner

func (*Handler) GetTempUser

func (h *Handler) GetTempUser(req api.Context) error

GetTempUser returns information about the temporarily cached user. Endpoint: GET /api/setup/temp-user

func (*Handler) InitiateTempLogin

func (h *Handler) InitiateTempLogin(req api.Context) error

InitiateTempLogin starts an OAuth flow for any user via the specified auth provider. The user does not need to be pre-configured as an Owner - any authenticated user can become the first Owner if the bootstrap user confirms them. Endpoint: POST /api/setup/initiate-temp-login

func (*Handler) ListExplicitRoleEmails

func (h *Handler) ListExplicitRoleEmails(req api.Context) error

ListExplicitRoleEmails returns all emails with explicit Owner or Admin roles. This is informational only - the bootstrap user can choose to log in as any user, not just those on these lists. Endpoint: GET /api/setup/explicit-role-emails

func (*Handler) OAuthComplete

func (h *Handler) OAuthComplete(req api.Context) error

OAuthComplete handles the OAuth callback for setup flow. This endpoint is called after oauth2-proxy completes authentication. Any authenticated user can be cached - they don't need to be pre-configured as an Owner. The bootstrap user will review their details and decide whether to confirm them as the first Owner. Endpoint: GET /api/setup/oauth-complete

type InitiateTempLoginRequest

type InitiateTempLoginRequest struct {
	AuthProviderName      string `json:"authProviderName"`
	AuthProviderNamespace string `json:"authProviderNamespace"`
}

type InitiateTempLoginResponse

type InitiateTempLoginResponse struct {
	RedirectURL string `json:"redirectUrl"`
	TokenID     string `json:"tokenId"`
}

type TempUserInfoResponse

type TempUserInfoResponse struct {
	UserID                uint       `json:"userId"`
	Username              string     `json:"username"`
	Email                 string     `json:"email"`
	Role                  types.Role `json:"role"`
	Groups                []string   `json:"groups"`
	IconURL               string     `json:"iconUrl,omitempty"`
	AuthProviderName      string     `json:"authProviderName"`
	AuthProviderNamespace string     `json:"authProviderNamespace"`
	CachedAt              string     `json:"cachedAt"`
}

Jump to

Keyboard shortcuts

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