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 ConfirmOwnerRequest ¶
type ConfirmOwnerRequest struct {
Email string `json:"email"`
}
type ConfirmOwnerResponse ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) CancelTempLogin ¶
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 ¶
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 ¶
GetTempUser returns information about the temporarily cached user. Endpoint: GET /api/setup/temp-user
func (*Handler) InitiateTempLogin ¶
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 ¶
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 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"`
}