Documentation
¶
Index ¶
- Constants
- func LoginCallback(c githubapp.Config, basePath string, sessions *scs.SessionManager, ...) oauth2.LoginCallback
- func NewSessionManager(lifetime int, secure bool) *scs.SessionManager
- func RequireLogin(sessions *scs.SessionManager, basePath string) func(http.Handler) http.Handler
- type AccessPolicy
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.