auth

package
v0.0.1-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type ChangePasswordSettings

type ChangePasswordSettings struct {
	EnableRegistration  bool `json:"enable_registration,string,omitempty"`
	EnablePasswordLogin bool `json:"enable,string,omitempty"`
}

type Controller

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

func New

func New(
	tx dbtx.Transactor,
	instanceCtrl *instance.Controller,
	userCtrl *user.Controller,
	tenantCtrl *tenant.Controller,
	tokenStore store.TokenStore,
	authSettingStore store.AuthSettingsStore,
) *Controller

func ProvideController

func ProvideController(
	tx dbtx.Transactor,
	instanceCtrl *instance.Controller,
	userCtrl *user.Controller,
	tenantCtrl *tenant.Controller,
	tokenStore store.TokenStore,
	authSettingStore store.AuthSettingsStore,
) *Controller

func (*Controller) Callback

func (c *Controller) Callback(ctx context.Context, authSetting *types.AuthSetting, code string) (*types.TokenResponse, error)

func (*Controller) GetByProvider

func (c *Controller) GetByProvider(ctx context.Context, provider enum.AuthProvider) (*types.AuthSetting, error)

func (*Controller) GetDemoUser

func (c *Controller) GetDemoUser(ctx context.Context, instance *types.Instance) (*types.DemoUser, error)

func (*Controller) GetRedirectUrl

func (c *Controller) GetRedirectUrl(ctx context.Context, authSetting *types.AuthSetting) (string, error)

func (*Controller) Init

func (c *Controller) Init(ctx context.Context) error

func (*Controller) ListAllMap

func (c *Controller) ListAllMap(ctx context.Context) (map[enum.AuthProvider]*types.AuthSetting, error)

func (*Controller) ListEnabled

func (c *Controller) ListEnabled(ctx context.Context) (map[enum.AuthProvider]*types.AuthSetting, error)

func (*Controller) Login

func (c *Controller) Login(ctx context.Context, instance *types.Instance, in *LoginInput) (*types.TokenResponse, error)

func (*Controller) Logout

func (c *Controller) Logout(ctx context.Context, session *auth.Session) error

func (*Controller) Register

func (*Controller) UpdateDemoUserAuth

func (c *Controller) UpdateDemoUserAuth(ctx context.Context, in *DemoUserSettings) error

func (*Controller) UpdateOauthSettings

func (c *Controller) UpdateOauthSettings(ctx context.Context, auth *types.AuthSetting, provider enum.AuthProvider) error

func (*Controller) UpdatePasswordSettings

func (c *Controller) UpdatePasswordSettings(ctx context.Context, in *ChangePasswordSettings) error

TODO: looks clumsy, check if you can reformat

type DemoUserSettings

type DemoUserSettings struct {
	DemoUserEnabled bool `json:"demo_user_enabled,string,omitempty"`
}

type LoginInput

type LoginInput struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type RegisterUserInput

type RegisterUserInput struct {
	DisplayName     string `json:"displayName"`
	Email           string `json:"email"`
	Password        string `json:"password"`
	ConfirmPassword string `json:"confirmPassword"`
}

Jump to

Keyboard shortcuts

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