auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownDriver = fmt.Errorf("Unknown driver")

ErrUnknownDriver is the "Unknown driver" error.

Functions

This section is empty.

Types

type Authorizer

type Authorizer interface {
	AddProject(projectID int64, name string) error
	DeleteProject(projectID int64) error
	RenameProject(projectID int64, newName string) error

	StopStatusCheck()

	UserAccess(username string) (*UserAccess, error)
	UserIsAdmin(r *http.Request) bool
	UserHasPermission(r *http.Request, projectName string, permission string) bool
}

func LoadAuthorizer

func LoadAuthorizer(name string, config map[string]any, logger logger.Logger, projectsGetFunc func() (map[int64]string, error)) (Authorizer, error)

type UserAccess

type UserAccess struct {
	Admin    bool
	Projects map[string][]string
}

UserAccess struct for permission checks.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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