iauthnzimpl

package
v1.202405300917.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPersonalAccessTokenOnSystemRole = errors.New("personal access token on a system role")
	ErrPersonalAccessTokenOnNullWSID   = errors.New("personal access token on null WSID")
)
View Source
var TestIsDeviceAllowedFuncs = IsDeviceAllowedFuncs{
	istructs.AppQName_test1_app1: func(as istructs.IAppStructs, requestWSID istructs.WSID, deviceProfileWSID istructs.WSID) (ok bool, err error) {
		return true, nil
	},
}
View Source
var TestSubjectRolesGetter = func(context.Context, string, istructs.IAppStructs, istructs.WSID) ([]appdef.QName, error) {
	return nil, nil
}

Functions

func IssueAPIToken

func IssueAPIToken(appTokens istructs.IAppTokens, duration time.Duration, roles []appdef.QName, wsid istructs.WSID, currentPrincipalPayload payloads.PrincipalPayload) (token string, err error)

func NewDefaultAuthenticator

func NewDefaultAuthenticator(subjectRolesGetter SubjectGetterFunc, isDeviceAllowedFuncs IsDeviceAllowedFuncs) iauthnz.IAuthenticator

func NewDefaultAuthorizer

func NewDefaultAuthorizer() iauthnz.IAuthorizer

Types

type ACElem

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

type ACL

type ACL []ACElem

func (ACL) IsAllowed

func (acl ACL) IsAllowed(principals []iauthnz.Principal, req iauthnz.AuthzRequest) bool

type ACPolicyType

type ACPolicyType int
const (
	ACPolicy_Deny ACPolicyType = iota
	ACPolicy_Allow
)

type IsDeviceAllowedFunc

type IsDeviceAllowedFunc = func(as istructs.IAppStructs, requestWSID istructs.WSID, deviceProfileWSID istructs.WSID) (ok bool, err error)

type IsDeviceAllowedFuncs

type IsDeviceAllowedFuncs map[istructs.AppQName]IsDeviceAllowedFunc

type PatternType

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

type SubjectGetterFunc

type SubjectGetterFunc = func(requestContext context.Context, name string, as istructs.IAppStructs, wsid istructs.WSID) ([]appdef.QName, error)

Jump to

Keyboard shortcuts

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