auth

package
v0.4.14 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeRepoRead        = "repo.read"
	ScopeRepoWrite       = "repo.write"
	ScopeRepoReadConfig  = "repo.readConfig"
	ScopeRepoWriteConfig = "repo.writeConfig"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthnStore

type AuthnStore interface {
	SetPassword(email, password string) error
	Authenticate(email, password string) (token string, err error)
	CheckToken(r *http.Request, token string) (*http.Request, *Claims, error)
	RemoveUser(email string) error
	ListUsers() (emails []string, err error)
	Exist(email string) bool
	Flush() error
}

type AuthzStore

type AuthzStore interface {
	AddPolicy(email, scope string) error
	RemovePolicy(email, scope string) error
	Authorized(r *http.Request, email, scope string) (bool, error)
	ListPolicies(email string) (scopes []string, err error)
	Flush() error
}

type Claims

type Claims struct {
	jwt.StandardClaims
	Email string `json:"email,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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