Documentation ¶
Index ¶
- Variables
- func ContextWithAuthClaims(parent context.Context, claims *AuthClaims) context.Context
- type Action
- type Actions
- type AuthClaims
- type AuthErrorCode
- type Authorizer
- type Engine
- type Pair
- type Pairs
- type PolicyMap
- type Project
- type Projects
- type Resource
- type Resources
- type RoleMap
- type Subject
- type Subjects
- type Type
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingAuthClaims = status.Error(codes.Code(AuthErrorCodeMissingAuthClaims), "context missing authz claims") ErrInvalidClaims = status.Error(codes.Code(AuthErrorCodeInvalidClaims), "invalid claims") )
Functions ¶
func ContextWithAuthClaims ¶
func ContextWithAuthClaims(parent context.Context, claims *AuthClaims) context.Context
ContextWithAuthClaims injects the provided AuthClaims into the parent context.
Types ¶
type AuthClaims ¶
type AuthClaims struct { Subjects *Subjects Pairs *Pairs Projects *Projects Subject *Subject Action *Action Resource *Resource Project *Project }
func AuthClaimsFromContext ¶
func AuthClaimsFromContext(ctx context.Context) (*AuthClaims, bool)
AuthClaimsFromContext extracts the AuthClaims from the provided ctx (if any).
type AuthErrorCode ¶
type AuthErrorCode int32
const ( AuthErrorCodeMissingAuthClaims AuthErrorCode = 2001 AuthErrorCodeInvalidClaims AuthErrorCode = 2002 )
type Authorizer ¶
type Authorizer interface { ProjectsAuthorized(context.Context, Subjects, Action, Resource, Projects) (Projects, error) FilterAuthorizedPairs(context.Context, Subjects, Pairs) (Pairs, error) FilterAuthorizedProjects(context.Context, Subjects) (Projects, error) IsAuthorized(context.Context, Subject, Action, Resource, Project) (bool, error) }
type Engine ¶
type Engine interface { Authorizer Writer }
Click to show internal directories.
Click to hide internal directories.