Documentation ¶
Index ¶
- Variables
- func StreamServerInterceptor(v Authenticator) grpc.StreamServerInterceptor
- func UnaryServerInterceptor(v Authenticator) grpc.UnaryServerInterceptor
- type Access
- func (*Access) Descriptor() ([]byte, []int)
- func (m *Access) GetLevel() AccessLevel
- func (*Access) ProtoMessage()
- func (m *Access) Reset()
- func (m *Access) String() string
- func (m *Access) XXX_DiscardUnknown()
- func (m *Access) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Access) XXX_Merge(src proto.Message)
- func (m *Access) XXX_Size() int
- func (m *Access) XXX_Unmarshal(b []byte) error
- type AccessLevel
- type Authenticator
- type GatewayHandler
- type Implementor
- type Visible
- func (*Visible) Descriptor() ([]byte, []int)
- func (m *Visible) GetScope() VisibleScope
- func (*Visible) ProtoMessage()
- func (m *Visible) Reset()
- func (m *Visible) String() string
- func (m *Visible) XXX_DiscardUnknown()
- func (m *Visible) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Visible) XXX_Merge(src proto.Message)
- func (m *Visible) XXX_Size() int
- func (m *Visible) XXX_Unmarshal(b []byte) error
- type VisibleScope
Constants ¶
This section is empty.
Variables ¶
View Source
var AccessLevel_name = map[int32]string{
0: "_NO_LIMIT",
100: "LOW_ACCESS_LEVEL",
200: "MIDDLE_ACCESS_LEVEL",
300: "HIGH_ACCESS_LEVEL",
400: "SERVER_INTERNAL",
}
View Source
var AccessLevel_value = map[string]int32{
"_NO_LIMIT": 0,
"LOW_ACCESS_LEVEL": 100,
"MIDDLE_ACCESS_LEVEL": 200,
"HIGH_ACCESS_LEVEL": 300,
"SERVER_INTERNAL": 400,
}
View Source
var E_Access = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MethodOptions)(nil), ExtensionType: (*Access)(nil), Field: 2360, Name: "auth.access", Tag: "bytes,2360,opt,name=access", Filename: "auth/annotations.proto", }
View Source
var E_Visible = &proto.ExtensionDesc{ ExtendedType: (*descriptor.ServiceOptions)(nil), ExtensionType: (*Visible)(nil), Field: 1360, Name: "auth.visible", Tag: "bytes,1360,opt,name=visible", Filename: "auth/annotations.proto", }
View Source
var VisibleScope_name = map[int32]string{
0: "PUBLIC_SCOPE",
1: "INTERNAL_SCOPE",
2: "ALL_SCOPE",
}
View Source
var VisibleScope_value = map[string]int32{
"PUBLIC_SCOPE": 0,
"INTERNAL_SCOPE": 1,
"ALL_SCOPE": 2,
}
Functions ¶
func StreamServerInterceptor ¶
func StreamServerInterceptor(v Authenticator) grpc.StreamServerInterceptor
StreamServerInterceptor returns a new streaming server interceptor that authenticates incoming messages.
The stage at which unauthenticated messages will be rejected with `PermissionDenied` varies based on the type of the RPC. For `ServerStream` (1:m) requests, it will happen before reaching any userspace handlers. For `ClientStream` (n:1) or `BidiStream` (n:m) RPCs, the messages will be rejected on calls to `stream.Recv()`.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(v Authenticator) grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a new unary server interceptor that authenticates incoming messages.
Invalid messages will be rejected with `PermissionDenied` before reaching any userspace handlers.
Types ¶
type Access ¶
type Access struct { Level AccessLevel `protobuf:"varint,1,opt,name=level,proto3,enum=auth.AccessLevel" json:"level,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Access) Descriptor ¶
func (*Access) GetLevel ¶
func (m *Access) GetLevel() AccessLevel
func (*Access) ProtoMessage ¶
func (*Access) ProtoMessage()
func (*Access) XXX_DiscardUnknown ¶
func (m *Access) XXX_DiscardUnknown()
func (*Access) XXX_Marshal ¶
func (*Access) XXX_Unmarshal ¶
type AccessLevel ¶
type AccessLevel int32
const ( AccessLevel__NO_LIMIT AccessLevel = 0 AccessLevel_LOW_ACCESS_LEVEL AccessLevel = 100 AccessLevel_MIDDLE_ACCESS_LEVEL AccessLevel = 200 AccessLevel_HIGH_ACCESS_LEVEL AccessLevel = 300 AccessLevel_SERVER_INTERNAL AccessLevel = 400 )
func (AccessLevel) EnumDescriptor ¶
func (AccessLevel) EnumDescriptor() ([]byte, []int)
func (AccessLevel) String ¶
func (x AccessLevel) String() string
type Authenticator ¶
type Authenticator interface { SetAccessLevel(map[string]AccessLevel) Authenticate(ctx context.Context, fullMethod string) error }
Server authenticator interface.
type GatewayHandler ¶
type Implementor ¶
type Implementor interface { ScopedGRPCServer(scope VisibleScope) []*grpc.Server RegisterGateway(scope VisibleScope, handlers GatewayHandler) error }
type Visible ¶
type Visible struct { Scope VisibleScope `protobuf:"varint,1,opt,name=scope,proto3,enum=auth.VisibleScope" json:"scope,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Visible) Descriptor ¶
func (*Visible) GetScope ¶
func (m *Visible) GetScope() VisibleScope
func (*Visible) ProtoMessage ¶
func (*Visible) ProtoMessage()
func (*Visible) XXX_DiscardUnknown ¶
func (m *Visible) XXX_DiscardUnknown()
func (*Visible) XXX_Marshal ¶
func (*Visible) XXX_Unmarshal ¶
type VisibleScope ¶
type VisibleScope int32
const ( VisibleScope_PUBLIC_SCOPE VisibleScope = 0 VisibleScope_INTERNAL_SCOPE VisibleScope = 1 VisibleScope_ALL_SCOPE VisibleScope = 2 )
func (VisibleScope) EnumDescriptor ¶
func (VisibleScope) EnumDescriptor() ([]byte, []int)
func (VisibleScope) String ¶
func (x VisibleScope) String() string
Click to show internal directories.
Click to hide internal directories.