auth

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 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 {
	SetName(email, name string) error
	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 returns list of users, each user is the string slice []string{email, name}
	ListUsers() (users [][]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"`
	Name  string `json:"name,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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