Documentation ¶
Index ¶
- func AppendIdentityToOutgoingStreamContext() grpc.StreamClientInterceptor
- func AppendIdentityToOutgoingUnaryContext() grpc.UnaryClientInterceptor
- func GrantAccessForStreamRequest(permission identity.Permission) grpc.StreamServerInterceptor
- func GrantAccessForUnaryRequest(permission identity.Permission) grpc.UnaryServerInterceptor
- func SetIdentityFromStreamRequest() grpc.StreamServerInterceptor
- func SetIdentityFromUnaryRequest() grpc.UnaryServerInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendIdentityToOutgoingStreamContext ¶
func AppendIdentityToOutgoingStreamContext() grpc.StreamClientInterceptor
AppendIdentityToOutgoingStreamContext appends identity to outgoing context
https://godoc.org/google.golang.org/grpc#WithStreamInterceptor
conn, err := grpc.Dial("localhost:5000", grpc.WithStreamInterceptor(AppendIdentityToOutgoingStreamContext()))
func AppendIdentityToOutgoingUnaryContext ¶
func AppendIdentityToOutgoingUnaryContext() grpc.UnaryClientInterceptor
AppendIdentityToOutgoingUnaryContext appends identity to outgoing context
https://godoc.org/google.golang.org/grpc#WithUnaryInterceptor
conn, err := grpc.Dial("localhost:5000", grpc.WithUnaryInterceptor(AppendIdentityToOutgoingUnaryContext()))
func GrantAccessForStreamRequest ¶
func GrantAccessForStreamRequest(permission identity.Permission) grpc.StreamServerInterceptor
GrantAccessForStreamRequest returns error if Identity not set within context or user does not have required permission
https://godoc.org/google.golang.org/grpc#StreamInterceptor
opts := []grpc.ServerOption{ grpc.StreamInterceptor(GrantAccessForStreamRequest(identity.PermissionUserRead)), }
s := grpc.NewServer(opts...) pb.RegisterGreeterServer(s, &server{})
func GrantAccessForUnaryRequest ¶
func GrantAccessForUnaryRequest(permission identity.Permission) grpc.UnaryServerInterceptor
CheckAccessForUnaryRequest returns error if Identity not set within context or user does not have required permission
https://godoc.org/google.golang.org/grpc#UnaryInterceptor
opts := []grpc.ServerOption{ grpc.UnaryInterceptor(CheckAccessForUnaryRequest(identity.PermissionUserRead)), }
s := grpc.NewServer(opts...) pb.RegisterGreeterServer(s, &server{})
func SetIdentityFromStreamRequest ¶
func SetIdentityFromStreamRequest() grpc.StreamServerInterceptor
SetIdentityFromStreamRequest updates context with identity
https://godoc.org/google.golang.org/grpc#StreamInterceptor
opts := []grpc.ServerOption{ grpc.UnaryInterceptor(SetIdentityFromStreamRequest()), }
s := grpc.NewServer(opts...) pb.RegisterGreeterServer(s, &server{})
func SetIdentityFromUnaryRequest ¶
func SetIdentityFromUnaryRequest() grpc.UnaryServerInterceptor
SetIdentityFromUnaryRequest updates context with identity
https://godoc.org/google.golang.org/grpc#UnaryInterceptor
opts := []grpc.ServerOption{ grpc.UnaryInterceptor(SetIdentityFromUnaryRequest()), }
s := grpc.NewServer(opts...) pb.RegisterGreeterServer(s, &server{})
Types ¶
This section is empty.