auth

package
v0.0.0-...-f5bbbf4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	AuthenticateJWT(ctx context.Context, token string) (*entities.UserInfo, error)
	AuthenticateAPIKey(ctx context.Context, apiKey []byte) (*entities.UserInfo, error)
	AuthenticateTLS(ctx context.Context, connState *tls.ConnectionState) (*entities.UserInfo, error)
}

Authenticator retrieves user info given an authentication method

type Authorizator

type Authorizator interface {
	CheckPermission(ops ...*entities.Operation) error
	CheckAccess(allowedTenants []string) error
}

Authorizator allows managing authorizations given a set of permissions

type Roles

type Roles interface {
	Create(ctx context.Context, name string, permissions []entities.Permission, userInfo *entities.UserInfo) error
	Get(ctx context.Context, name string, userInfo *entities.UserInfo) (*entities.Role, error)
	List(ctx context.Context, userInfo *entities.UserInfo) ([]string, error)
	UserPermissions(ctx context.Context, userInfo *entities.UserInfo) []entities.Permission
}

Roles allows managing permissions and roles

Directories

Path Synopsis
api
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
service

Jump to

Keyboard shortcuts

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