authorization

package
v1.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2020 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package authorization defines the protocol buffers API for the authorization service.

Index

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 AuthorizationHandler interface {
	Create(context.Context, *Claims, *Token) error
	Validate(context.Context, *Token, *Claims) error
	Invalidate(context.Context, *Claims, *Claims) error
}

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) Descriptor() ([]byte, []int)

func (*Claims) GetExpiresAt added in v1.3.0

func (m *Claims) GetExpiresAt() *time.Time

func (*Claims) GetID added in v1.3.0

func (m *Claims) GetID() *uuid.UUID

func (*Claims) GetSubject added in v1.3.0

func (m *Claims) GetSubject() *uuid.UUID

func (*Claims) Marshal added in v1.3.0

func (m *Claims) Marshal() (dAtA []byte, err error)

func (*Claims) MarshalTo added in v1.3.0

func (m *Claims) MarshalTo(dAtA []byte) (int, error)

func (*Claims) ProtoMessage added in v1.3.0

func (*Claims) ProtoMessage()

func (*Claims) Reset added in v1.3.0

func (m *Claims) Reset()

func (*Claims) Size added in v1.3.0

func (m *Claims) Size() (n int)

func (*Claims) String added in v1.3.0

func (m *Claims) String() string

func (*Claims) Unmarshal added in v1.3.0

func (m *Claims) Unmarshal(dAtA []byte) error

func (*Claims) XXX_DiscardUnknown added in v1.3.0

func (m *Claims) XXX_DiscardUnknown()

func (*Claims) XXX_Marshal added in v1.3.0

func (m *Claims) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Claims) XXX_Merge added in v1.3.0

func (m *Claims) XXX_Merge(src proto.Message)

func (*Claims) XXX_Size added in v1.3.0

func (m *Claims) XXX_Size() int

func (*Claims) XXX_Unmarshal added in v1.3.0

func (m *Claims) XXX_Unmarshal(b []byte) error

type Client added in v1.4.1

type Client struct {
	AuthorizationService
}

Client defines a client for the Authorization service.

func NewClient added in v1.4.1

func NewClient(client client.Client) *Client

NewClient creates a new client for the Authorization service.

func (*Client) Name added in v1.4.1

func (c *Client) Name() string

Name returns the name of 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) Descriptor() ([]byte, []int)

func (*Token) GetToken

func (m *Token) GetToken() string

func (*Token) Marshal

func (m *Token) Marshal() (dAtA []byte, err error)

func (*Token) MarshalTo

func (m *Token) MarshalTo(dAtA []byte) (int, error)

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) Reset

func (m *Token) Reset()

func (*Token) Size

func (m *Token) Size() (n int)

func (*Token) String

func (m *Token) String() string

func (*Token) Unmarshal

func (m *Token) Unmarshal(dAtA []byte) error

func (*Token) XXX_DiscardUnknown

func (m *Token) XXX_DiscardUnknown()

func (*Token) XXX_Marshal

func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Token) XXX_Merge

func (m *Token) XXX_Merge(src proto.Message)

func (*Token) XXX_Size

func (m *Token) XXX_Size() int

func (*Token) XXX_Unmarshal

func (m *Token) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL