setup

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromoteToOwner added in v0.26.0

func PromoteToOwner(req api.Context, user *gatewaytypes.User) error

PromoteToOwner grants the Owner role to an identity that has proven it can sign in through the provider Obot is about to depend on. Bootstrap owner confirmation and the staged auth provider switch share it rather than each deciding for themselves.

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 Handler

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

func NewHandler

func NewHandler(serverURL string, bootstrapEnabler *bootstrap.Bootstrap, authProviderGetter configuredAuthProviderGetter) *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) 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. The sole local account becomes Owner automatically. Other identities are cached for the bootstrap user to review and confirm 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