authloginhttpsvc

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Configs = configset.Set[Config]{
	Default: &Config{},
	Dev: &Config{
		GoogleOAuth: oauth2Config{
			RedirectURL: "http://localhost:9980/auth/google/callback",
			Cookie:      &gologin.DebugOnlyCookieConfig,
		},
		GithubOAuth: oauth2Config{
			RedirectURL: "http://localhost:9980/auth/github/callback",
			Cookie:      &gologin.DebugOnlyCookieConfig,
		},
	},
}

Functions

func Init

func Init(deps Deps) error

func RedirectToLogin

func RedirectToLogin(w http.ResponseWriter, r *http.Request, src *url.URL)

Types

type Config

type Config struct {
	GoogleOAuth oauth2Config  `koanf:"google_oauth"`
	GithubOAuth oauth2Config  `konf:"github_oauth"`
	Descope     descopeConfig `koanf:"descope"`

	// Allowed login patterns, separated by commas.
	// Pattern format is either of:
	// - "*"       - matches any login
	// - "*@host"  - matches any login from host
	// - otherwise - matches exact login
	AllowedLogins string `koanf:"allowed_logins"`
}

type Deps

type Deps struct {
	fx.In

	Muxes    *muxes.Muxes
	Z        *zap.Logger
	Cfg      *Config
	DB       db.DB
	Sessions authsessions.Store
	Tokens   authtokens.Tokens
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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