middlewares

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindRepositoryPermissions

func BindRepositoryPermissions(next http.Handler) http.Handler

func IsRepositoryAdmin

func IsRepositoryAdmin(next http.Handler) http.Handler

func IsRepositoryMember

func IsRepositoryMember(next http.Handler) http.Handler

Types

type CompanyAuthzMiddleware

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

func (*CompanyAuthzMiddleware) IsCompanyAdmin

func (c *CompanyAuthzMiddleware) IsCompanyAdmin(next http.Handler) http.Handler

nolint

func (*CompanyAuthzMiddleware) IsCompanyMember

func (c *CompanyAuthzMiddleware) IsCompanyMember(next http.Handler) http.Handler

nolint

type CtxKey

type CtxKey string
const CompanyIDCtxKey CtxKey = "companyID"
const RepositoryIDCtxKey CtxKey = "repositoryID"
const RepositoryPermissionsCtxKey CtxKey = "repositoryPermissions"

type ICompanyAuthzMiddleware

type ICompanyAuthzMiddleware interface {
	IsCompanyMember(next http.Handler) http.Handler
	IsCompanyAdmin(next http.Handler) http.Handler
}

func NewCompanyAuthzMiddleware

func NewCompanyAuthzMiddleware(
	databaseRead SQL.InterfaceRead, databaseWrite SQL.InterfaceWrite) ICompanyAuthzMiddleware

type IRepositoryAuthzMiddleware

type IRepositoryAuthzMiddleware interface {
	IsRepositoryMember(next http.Handler) http.Handler
	IsRepositoryAdmin(next http.Handler) http.Handler
}

func NewRepositoryAuthzMiddleware

func NewRepositoryAuthzMiddleware(
	databaseRead SQL.InterfaceRead, databaseWrite SQL.InterfaceWrite) IRepositoryAuthzMiddleware

type ITokenAuthz

type ITokenAuthz interface {
	IsAuthorized(next http.Handler) http.Handler
}

func NewTokenAuthz

func NewTokenAuthz(postgresRead relational.InterfaceRead) ITokenAuthz

type TokenAuthz

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

func (*TokenAuthz) IsAuthorized

func (t *TokenAuthz) IsAuthorized(next http.Handler) http.Handler

Jump to

Keyboard shortcuts

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