auth

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	MiddlewareHandler(next http.Handler) http.Handler
	Mount() chi.Router
}

func NewClient

func NewClient(config Config, storeClient store.Client) (Client, error)

NewClient returns a new auth client for handling authentication and authorization within the kobs hub. The auth client exports two mount function, one for mounting the middleware to verify requests and one for mounting the router for all auth related API endpoints.

type Config

type Config struct {
	Enabled bool          `json:"enabled"`
	OIDC    OIDCConfig    `json:"oidc"`
	Session SessionConfig `json:"session"`
	Users   []UserConfig  `json:"users"`
}

type OIDCConfig

type OIDCConfig struct {
	Enabled      bool     `json:"enabled"`
	Issuer       string   `json:"issuer"`
	ClientID     string   `json:"clientID"`
	ClientSecret string   `json:"clientSecret"`
	RedirectURL  string   `json:"redirectURL"`
	State        string   `json:"state"`
	Scopes       []string `json:"scopes"`
}

type Session added in v0.11.0

type Session struct {
	Email string   `json:"email"`
	Teams []string `json:"teams"`
}

type SessionConfig

type SessionConfig struct {
	Token          string        `json:"token"`
	Interval       string        `json:"interval"`
	ParsedInterval time.Duration `json:"-"`
}

type SigninRequest

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

type UserConfig

type UserConfig struct {
	Email    string   `json:"email"`
	Password string   `json:"password"`
	Groups   []string `json:"groups"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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