auth

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuthMiddleware added in v1.2.0

func BasicAuthMiddleware(cfg *config.BasicAuthConfig) func(http.Handler) http.Handler

BasicAuthMiddleware returns a middleware that performs basic authentication

Types

type GitHubAppAuth

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

GitHubAppAuth implements AuthProvider for GitHub Apps

func NewGitHubAppAuth

func NewGitHubAppAuth(appID, installationID int64, privateKeyPEM []byte) (*GitHubAppAuth, error)

NewGitHubAppAuth creates a new GitHub App auth provider

func (*GitHubAppAuth) GetToken

func (a *GitHubAppAuth) GetToken() (string, error)

GetToken returns a valid installation token, refreshing if needed

type PATAuth

type PATAuth struct {
	Token string
}

PATAuth implements AuthProvider for Personal Access Tokens

func NewPATAuth

func NewPATAuth(token string) *PATAuth

NewPATAuth creates a new PAT auth provider

func (*PATAuth) GetToken

func (a *PATAuth) GetToken() (string, error)

GetToken returns the PAT

type Provider

type Provider interface {
	GetToken() (string, error)
}

Provider defines interface for authentication methods

func NewAuthProvider

func NewAuthProvider(config *config.Config) (Provider, error)

NewAuthProvider creates appropriate auth provider based on config

Jump to

Keyboard shortcuts

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