Documentation ¶
Index ¶
- Constants
- func CheckInternal(ctx context.Context) bool
- func CheckUserAuthorization(ctx context.Context, req interface{}, token, orgID string, ...) (context.Context, error)
- func ExistsPerm(existing []string, perm string) bool
- func GetPermissionCtxIDs(perms []string) []string
- func GetPermissionsFromCtx(ctx context.Context) []string
- func HasGlobalPermission(perms []string) bool
- func NewMockContext(orgID, userID string) context.Context
- func SetCtxData(ctx context.Context, ctxData CtxData) context.Context
- func SplitPermission(perm string) (string, string)
- func VerifyTokenAndWriteCtxData(ctx context.Context, token, orgID string, t TokenVerifier) (_ context.Context, err error)
- type Config
- type CtxData
- type Grant
- type Grants
- type MethodMapping
- type Option
- type RoleMapping
- type TokenVerifier
Constants ¶
View Source
const (
BearerPrefix = "Bearer "
)
Variables ¶
This section is empty.
Functions ¶
func CheckInternal ¶
TODO: Remove as soon an authentification is implemented
func CheckUserAuthorization ¶
func ExistsPerm ¶ added in v0.20.0
func GetPermissionCtxIDs ¶
func GetPermissionsFromCtx ¶
func HasGlobalPermission ¶
func NewMockContext ¶
func SetCtxData ¶ added in v0.15.0
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 }
func GetCtxData ¶
type MethodMapping ¶
type RoleMapping ¶
Click to show internal directories.
Click to hide internal directories.