proxy

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccessToken

func GetAccessToken(ctx context.Context) string

Types

type Config

type Config struct {
	AuthCookieSecret string   `usage:"Secret used to encrypt cookie"`
	AuthEmailDomains string   `usage:"Email domains allowed for authentication" default:"*"`
	AuthAdminEmails  []string `usage:"Emails admin users"`
	AuthConfigType   string   `usage:"Type of OAuth configuration" default:"google"`
	AuthClientID     string   `usage:"Client ID for OAuth"`
	AuthClientSecret string   `usage:"Client secret for OAuth"`

	// Type-specific config
	GithubConfig
}

type GithubConfig

type GithubConfig struct {
	AuthGithubOrg        string   `usage:"Restrict logins to members of this organization"`
	AuthGithubTeams      []string `usage:"Restrict logins to members of any of these teams (slug)"`
	AuthGithubRepo       string   `usage:"Restrict logins to collaborators of this repository formatted as org/repo"`
	AuthGithubToken      string   `usage:"The token to use when verifying repository collaborators (must have push access to the repository)"`
	AuthGithubAllowUsers []string `usage:"Users allowed to login even if they don't belong to the organization or team(s)"`
}

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

func New

func New(serverURL string, authProviderID uint, cfg Config) (*Proxy, error)

func (*Proxy) AuthenticateRequest

func (p *Proxy) AuthenticateRequest(req *http.Request) (*authenticator.Response, bool, error)

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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