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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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