keys

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKeysServer

func NewKeysServer(service Service, log *zap.Logger) api.KeysServer

NewKeysServer creates new KeysServer instance

func NewPBFromAuthRequest

func NewPBFromAuthRequest(msg *AuthRequest) *pb.AuthRequest

NewPBFromAuthRequest transformer *AuthRequest to *pb.AuthRequest

func NewPBFromAuthResponse

func NewPBFromAuthResponse(msg *AuthResponse) *pb.AuthResponse

NewPBFromAuthResponse transformer *AuthResponse to *pb.AuthResponse

func NewPBFromDelKeysRequest

func NewPBFromDelKeysRequest(msg *DelKeysRequest) *pb.DelKeysRequest

NewPBFromDelKeysRequest transformer *DelKeysRequest to *pb.DelKeysRequest

func NewPBFromDelKeysResponse

func NewPBFromDelKeysResponse(msg *DelKeysResponse) *pb.DelKeysResponse

NewPBFromDelKeysResponse transformer *DelKeysResponse to *pb.DelKeysResponse

func NewPBFromListKeysRequest

func NewPBFromListKeysRequest(msg *ListKeysRequest) *pb.ListKeysRequest

NewPBFromListKeysRequest transformer *ListKeysRequest to *pb.ListKeysRequest

func NewPBFromListKeysResponse

func NewPBFromListKeysResponse(msg *ListKeysResponse) *pb.ListKeysResponse

NewPBFromListKeysResponse transformer *ListKeysResponse to *pb.ListKeysResponse

func NewPBFromPublicKeysRequest

func NewPBFromPublicKeysRequest(msg *PublicKeysRequest) *pb.PublicKeysRequest

NewPBFromPublicKeysRequest transformer *PublicKeysRequest to *pb.PublicKeysRequest

func NewPBFromPublicKeysResponse

func NewPBFromPublicKeysResponse(msg *PublicKeysResponse) *pb.PublicKeysResponse

NewPBFromPublicKeysResponse transformer *PublicKeysResponse to *pb.PublicKeysResponse

func NewPBFromRegisterRequest

func NewPBFromRegisterRequest(msg *RegisterRequest) *pb.RegisterRequest

NewPBFromRegisterRequest transformer *RegisterRequest to *pb.RegisterRequest

func NewPBFromRegisterResponse

func NewPBFromRegisterResponse(msg *RegisterResponse) *pb.RegisterResponse

NewPBFromRegisterResponse transformer *RegisterResponse to *pb.RegisterResponse

func NewPBFromUpdateKeysRequest

func NewPBFromUpdateKeysRequest(msg *UpdateKeysRequest) *pb.UpdateKeysRequest

NewPBFromUpdateKeysRequest transformer *UpdateKeysRequest to *pb.UpdateKeysRequest

func NewPBFromUpdateKeysResponse

func NewPBFromUpdateKeysResponse(msg *UpdateKeysResponse) *pb.UpdateKeysResponse

NewPBFromUpdateKeysResponse transformer *UpdateKeysResponse to *pb.UpdateKeysResponse

func Register

func Register() *services.ServiceInfo

Register func registers KeysServer service

Types

type AuthRequest

type AuthRequest struct {
	KID string `json:"kid"`
}

AuthRequest message type

func NewAuthRequestFromPB

func NewAuthRequestFromPB(msg *pb.AuthRequest) *AuthRequest

NewAuthRequestFromPB transformer *pb.AuthRequest to *AuthRequest

type AuthResponse

type AuthResponse struct {
	AuthJWT string `json:"authJWT"`
}

AuthResponse message type

func NewAuthResponseFromPB

func NewAuthResponseFromPB(msg *pb.AuthResponse) *AuthResponse

NewAuthResponseFromPB transformer *pb.AuthResponse to *AuthResponse

type DelKeysRequest

type DelKeysRequest struct {
	KID string `json:"kid"`
}

DelKeysRequest message type

func NewDelKeysRequestFromPB

func NewDelKeysRequestFromPB(msg *pb.DelKeysRequest) *DelKeysRequest

NewDelKeysRequestFromPB transformer *pb.DelKeysRequest to *DelKeysRequest

type DelKeysResponse

type DelKeysResponse struct {
}

DelKeysResponse message type

func NewDelKeysResponseFromPB

func NewDelKeysResponseFromPB(msg *pb.DelKeysResponse) *DelKeysResponse

NewDelKeysResponseFromPB transformer *pb.DelKeysResponse to *DelKeysResponse

type ListKeysRequest

type ListKeysRequest struct {
	Query string `json:"query"`
}

ListKeysRequest message type

func NewListKeysRequestFromPB

func NewListKeysRequestFromPB(msg *pb.ListKeysRequest) *ListKeysRequest

NewListKeysRequestFromPB transformer *pb.ListKeysRequest to *ListKeysRequest

type ListKeysResponse

type ListKeysResponse struct {
	KID  string       `json:"kid"`
	Keys keys.InfoSet `json:"keys_list"`
}

ListKeysResponse message type

func NewListKeysResponseFromPB

func NewListKeysResponseFromPB(msg *pb.ListKeysResponse) *ListKeysResponse

NewListKeysResponseFromPB transformer *pb.ListKeysResponse to *ListKeysResponse

type PublicKeysRequest

type PublicKeysRequest struct {
	KID string `json:"kid"`
}

PublicKeysRequest message type

func NewPublicKeysRequestFromPB

func NewPublicKeysRequestFromPB(msg *pb.PublicKeysRequest) *PublicKeysRequest

NewPublicKeysRequestFromPB transformer *pb.PublicKeysRequest to *PublicKeysRequest

type PublicKeysResponse

type PublicKeysResponse struct {
	KID  string           `json:"kid"`
	Keys *keys.SigEncKeys `json:"keys"`
}

PublicKeysResponse message type

func NewPublicKeysResponseFromPB

func NewPublicKeysResponseFromPB(msg *pb.PublicKeysResponse) *PublicKeysResponse

NewPublicKeysResponseFromPB transformer *pb.PublicKeysResponse to *PublicKeysResponse

type RegisterRequest

type RegisterRequest struct {
	KID             string        `json:"kid"`
	SigAlg          string        `json:"sigAlg"`
	EncAlg          string        `json:"encAlg"`
	SigBits         int           `json:"sigBits"`
	EncBits         int           `json:"encBits"`
	Expiry          time.Duration `json:"expiry"`
	AuthTTL         time.Duration `json:"authTTL"`
	RefreshTTL      time.Duration `json:"refreshTTL"`
	RefreshStrategy string        `json:"refreshStrategy"`
}

RegisterRequest message type

func NewRegisterRequestFromPB

func NewRegisterRequestFromPB(msg *pb.RegisterRequest) *RegisterRequest

NewRegisterRequestFromPB transformer *pb.RegisterRequest to *RegisterRequest

type RegisterResponse

type RegisterResponse struct {
	KID     string           `json:"kid"`
	AuthJWT string           `json:"authJWT"`
	Keys    *keys.SigEncKeys `json:"keys"`
}

RegisterResponse message type

func NewRegisterResponseFromPB

func NewRegisterResponseFromPB(msg *pb.RegisterResponse) *RegisterResponse

NewRegisterResponseFromPB transformer *pb.RegisterResponse to *RegisterResponse

type Service

type Service interface {
	Auth(ctx context.Context, req *AuthRequest) (*AuthResponse, error)
	Register(ctx context.Context, req *RegisterRequest) (*RegisterResponse, error)
	UpdateKeys(ctx context.Context, req *UpdateKeysRequest) (*UpdateKeysResponse, error)
	ListKeys(ctx context.Context, req *ListKeysRequest) ([]*ListKeysResponse, error)
	DelKeys(ctx context.Context, req *DelKeysRequest) (*DelKeysResponse, error)
	PublicKeys(ctx context.Context, req *PublicKeysRequest) (*PublicKeysResponse, error)
}

Service interface declares keys service type

type UpdateKeysRequest

type UpdateKeysRequest struct {
	KID             string        `json:"kid"`
	SigAlg          string        `json:"sigAlg"`
	EncAlg          string        `json:"encAlg"`
	SigBits         int           `json:"sigBits"`
	EncBits         int           `json:"encBits"`
	ContEnc         string        `json:"contEnc"`
	Expiry          time.Duration `json:"expiry"`
	AuthTTL         time.Duration `json:"authTTL"`
	RefreshTTL      time.Duration `json:"refreshTTL"`
	RefreshStrategy string        `json:"refreshStrategy"`
}

UpdateKeysRequest message type

func NewUpdateKeysRequestFromPB

func NewUpdateKeysRequestFromPB(msg *pb.UpdateKeysRequest) *UpdateKeysRequest

NewUpdateKeysRequestFromPB transformer *pb.UpdateKeysRequest to *UpdateKeysRequest

type UpdateKeysResponse

type UpdateKeysResponse struct {
	KID     string           `json:"kid"`
	AuthJWT string           `json:"authJWT"`
	Keys    *keys.SigEncKeys `json:"keys"`
}

UpdateKeysResponse message type

func NewUpdateKeysResponseFromPB

func NewUpdateKeysResponseFromPB(msg *pb.UpdateKeysResponse) *UpdateKeysResponse

NewUpdateKeysResponseFromPB transformer *pb.UpdateKeysResponse to *UpdateKeysResponse

Jump to

Keyboard shortcuts

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