Documentation ¶
Overview ¶
Package authorization defines the protocol buffers API for the authorization service.
Index ¶
- Constants
- Variables
- func RegisterAuthorizationHandler(s server.Server, hdlr AuthorizationHandler, opts ...server.HandlerOption) error
- func RegisterAuthorizationServer(s *grpc.Server, srv AuthorizationServer)
- type AuthorizationClient
- type AuthorizationHandler
- type AuthorizationServer
- type AuthorizationService
- type Claims
- func (*Claims) Descriptor() ([]byte, []int)
- func (m *Claims) GetExpiresAt() *time.Time
- func (m *Claims) GetID() *uuid.UUID
- func (m *Claims) GetSubject() *uuid.UUID
- func (m *Claims) Marshal() (dAtA []byte, err error)
- func (m *Claims) MarshalTo(dAtA []byte) (int, error)
- func (*Claims) ProtoMessage()
- func (m *Claims) Reset()
- func (m *Claims) Size() (n int)
- func (m *Claims) String() string
- func (m *Claims) Unmarshal(dAtA []byte) error
- func (m *Claims) XXX_DiscardUnknown()
- func (m *Claims) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Claims) XXX_Merge(src proto.Message)
- func (m *Claims) XXX_Size() int
- func (m *Claims) XXX_Unmarshal(b []byte) error
- type Client
- type Token
- func (*Token) Descriptor() ([]byte, []int)
- func (m *Token) GetToken() string
- func (m *Token) Marshal() (dAtA []byte, err error)
- func (m *Token) MarshalTo(dAtA []byte) (int, error)
- func (*Token) ProtoMessage()
- func (m *Token) Reset()
- func (m *Token) Size() (n int)
- func (m *Token) String() string
- func (m *Token) Unmarshal(dAtA []byte) error
- func (m *Token) XXX_DiscardUnknown()
- func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Token) XXX_Merge(src proto.Message)
- func (m *Token) XXX_Size() int
- func (m *Token) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const Name = "com.koverto.svc.authorization"
Name is the identifying name of the Authorization service.
Variables ¶
View Source
var ( ErrInvalidLengthAuthorization = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAuthorization = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RegisterAuthorizationHandler ¶
func RegisterAuthorizationHandler(s server.Server, hdlr AuthorizationHandler, opts ...server.HandlerOption) error
func RegisterAuthorizationServer ¶
func RegisterAuthorizationServer(s *grpc.Server, srv AuthorizationServer)
Types ¶
type AuthorizationClient ¶
type AuthorizationClient interface { Create(ctx context.Context, in *Claims, opts ...grpc.CallOption) (*Token, error) Validate(ctx context.Context, in *Token, opts ...grpc.CallOption) (*Claims, error) Invalidate(ctx context.Context, in *Claims, opts ...grpc.CallOption) (*Claims, error) }
AuthorizationClient is the client API for Authorization service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewAuthorizationClient ¶
func NewAuthorizationClient(cc *grpc.ClientConn) AuthorizationClient
type AuthorizationHandler ¶
type AuthorizationServer ¶
type AuthorizationServer interface { Create(context.Context, *Claims) (*Token, error) Validate(context.Context, *Token) (*Claims, error) Invalidate(context.Context, *Claims) (*Claims, error) }
AuthorizationServer is the server API for Authorization service.
type AuthorizationService ¶
type AuthorizationService interface { Create(ctx context.Context, in *Claims, opts ...client.CallOption) (*Token, error) Validate(ctx context.Context, in *Token, opts ...client.CallOption) (*Claims, error) Invalidate(ctx context.Context, in *Claims, opts ...client.CallOption) (*Claims, error) }
func NewAuthorizationService ¶
func NewAuthorizationService(name string, c client.Client) AuthorizationService
type Claims ¶ added in v1.3.0
type Claims struct { ID *uuid.UUID `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` Subject *uuid.UUID `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` ExpiresAt *time.Time `protobuf:"bytes,3,opt,name=expiresAt,proto3,stdtime" json:"expiresAt,omitempty"` }
func (*Claims) Descriptor ¶ added in v1.3.0
func (*Claims) GetExpiresAt ¶ added in v1.3.0
func (*Claims) GetSubject ¶ added in v1.3.0
func (*Claims) ProtoMessage ¶ added in v1.3.0
func (*Claims) ProtoMessage()
func (*Claims) XXX_DiscardUnknown ¶ added in v1.3.0
func (m *Claims) XXX_DiscardUnknown()
func (*Claims) XXX_Marshal ¶ added in v1.3.0
func (*Claims) XXX_Unmarshal ¶ added in v1.3.0
type Client ¶ added in v1.4.1
type Client struct {
AuthorizationService
}
Client defines a client for the Authorization service.
type Token ¶
type Token struct {
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
}
func (*Token) Descriptor ¶
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (*Token) XXX_DiscardUnknown ¶
func (m *Token) XXX_DiscardUnknown()
func (*Token) XXX_Marshal ¶
func (*Token) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.