auth

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionKeyUsername   = "username"
	SessionKeyRedirect   = "redirect"
	SessionKeyAuthorized = "authorized"
)

Variables

This section is empty.

Functions

func LoginCallback

func LoginCallback(c githubapp.Config, basePath string, sessions *scs.SessionManager, policy AccessPolicy) oauth2.LoginCallback

LoginCallback handles successful OAuth login

func NewSessionManager

func NewSessionManager(lifetime int, secure bool) *scs.SessionManager

NewSessionManager creates a new session manager with the given configuration

func RequireLogin

func RequireLogin(sessions *scs.SessionManager, basePath string) func(http.Handler) http.Handler

RequireLogin middleware checks if user is authenticated

Types

type AccessPolicy

type AccessPolicy struct {
	AllowedUsers         []string `yaml:"allowed_users"`
	AllowedOrganizations []string `yaml:"allowed_organizations"`
}

AccessPolicy authorizes access to the entire shared dashboard.

func (AccessPolicy) Validate

func (p AccessPolicy) Validate() error

Validate rejects empty policies and blank entries outside demo mode.

Jump to

Keyboard shortcuts

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