Documentation ¶
Overview ¶
Package authorization contains the authorization module implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamServerInterceptor ¶
func StreamServerInterceptor(authFuncs map[string]AuthPair) grpc.StreamServerInterceptor
StreamServerInterceptor returns a new stream server interceptor that performs per-request auth.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(authFuncs map[string]AuthPair) grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a new unary server interceptor that performs per-request auth.
Types ¶
type AuthzPolicy ¶
type AuthzPolicy struct {
Policy *authzpb.AuthorizationPolicy
}
AuthzPolicy contains the authorization policy.
func (*AuthzPolicy) Authorize ¶
func (a *AuthzPolicy) Authorize(ctx context.Context, m interface{}) error
Authorize verifies that the identity issuing the call. ctx must contain an authentication.SecurityContext. A call is authorized if:
- userID matches SecurityContext.Email,
- or, SecurityContext.Email is authorized to do the action in directories/directoryID.
Click to show internal directories.
Click to hide internal directories.