Documentation ¶
Index ¶
- Constants
- func CheckOrgFeatures(ctx context.Context, t *TokenVerifier, orgID string, ...) error
- func CheckUserAuthorization(ctx context.Context, req interface{}, token, orgID string, ...) (ctxSetter func(context.Context) context.Context, err error)
- func ExistsPerm(existingPermissions []string, perm string) bool
- func GetAllPermissionCtxIDs(perms []string) []string
- func GetAllPermissionsFromCtx(ctx context.Context) []string
- func GetExplicitPermissionCtxIDs(perms []string, searchPerm string) []string
- func GetRequestPermissionsFromCtx(ctx context.Context) []string
- func HasGlobalExplicitPermission(perms []string, permToCheck string) bool
- func HasGlobalPermission(perms []string) bool
- func NewMockContext(orgID, userID string) context.Context
- func NewMockContextWithPermissions(orgID, userID string, permissions []string) context.Context
- func SetCtxData(ctx context.Context, ctxData CtxData) context.Context
- func SplitPermission(perm string) (string, string)
- type Config
- type CtxData
- type Grant
- type Grants
- type MemberType
- type Membership
- type Memberships
- type MethodMapping
- type Option
- type RoleMapping
- type TokenVerifier
- func (v *TokenVerifier) CheckAuthMethod(method string) (Option, bool)
- func (v *TokenVerifier) ExistsOrg(ctx context.Context, orgID string) (err error)
- func (v *TokenVerifier) ProjectIDAndOriginsByClientID(ctx context.Context, clientID string) (_ string, _ []string, err error)
- func (v *TokenVerifier) RegisterServer(appName, methodPrefix string, mappings MethodMapping)
- func (v *TokenVerifier) SearchMyMemberships(ctx context.Context) (_ []*Membership, err error)
- func (v *TokenVerifier) VerifyAccessToken(ctx context.Context, token string, method string) (userID, clientID, agentID, prefLang, resourceOwner string, err error)
Constants ¶
View Source
const (
BearerPrefix = "Bearer "
)
Variables ¶
This section is empty.
Functions ¶
func CheckOrgFeatures ¶
func CheckUserAuthorization ¶
func ExistsPerm ¶
func GetAllPermissionCtxIDs ¶
func HasGlobalPermission ¶
func NewMockContext ¶
func SplitPermission ¶
Types ¶
type Config ¶
type Config struct {
RolePermissionMappings []RoleMapping
}
type CtxData ¶
type CtxData struct { UserID string OrgID string ProjectID string AgentID string PreferredLanguage string ResourceOwner string }
func GetCtxData ¶
type MemberType ¶
type MemberType int32
const ( MemberTypeUnspecified MemberType = iota MemberTypeOrganisation MemberTypeProject MemberTypeProjectGrant MemberTypeIam )
type Membership ¶
type Membership struct { MemberType MemberType AggregateID string //ObjectID differs from aggregate id if obejct is sub of an aggregate ObjectID string Roles []string }
type Memberships ¶
type Memberships []*Membership
type MethodMapping ¶
type RoleMapping ¶
type TokenVerifier ¶
type TokenVerifier struct {
// contains filtered or unexported fields
}
func Start ¶
func Start(authZRepo authZRepo) (v *TokenVerifier)
func (*TokenVerifier) CheckAuthMethod ¶
func (v *TokenVerifier) CheckAuthMethod(method string) (Option, bool)
func (*TokenVerifier) ExistsOrg ¶
func (v *TokenVerifier) ExistsOrg(ctx context.Context, orgID string) (err error)
func (*TokenVerifier) ProjectIDAndOriginsByClientID ¶
func (*TokenVerifier) RegisterServer ¶
func (v *TokenVerifier) RegisterServer(appName, methodPrefix string, mappings MethodMapping)
func (*TokenVerifier) SearchMyMemberships ¶
func (v *TokenVerifier) SearchMyMemberships(ctx context.Context) (_ []*Membership, err error)
func (*TokenVerifier) VerifyAccessToken ¶
Click to show internal directories.
Click to hide internal directories.