authv1

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package authv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_auth_v1_auth_proto protoreflect.FileDescriptor
View Source
var IdentityService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "auth.v1.IdentityService",
	HandlerType: (*IdentityServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Challenge",
			Handler:    _IdentityService_Challenge_Handler,
		},
		{
			MethodName: "Authenticate",
			Handler:    _IdentityService_Authenticate_Handler,
		},
		{
			MethodName: "SupportedServices",
			Handler:    _IdentityService_SupportedServices_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "auth/v1/auth.proto",
}

IdentityService_ServiceDesc is the grpc.ServiceDesc for IdentityService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterIdentityServiceHandler

func RegisterIdentityServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterIdentityServiceHandler registers the http handlers for service IdentityService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterIdentityServiceHandlerClient

func RegisterIdentityServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client IdentityServiceClient) error

RegisterIdentityServiceHandlerClient registers the http handlers for service IdentityService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "IdentityServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "IdentityServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "IdentityServiceClient" to call the correct interceptors.

func RegisterIdentityServiceHandlerFromEndpoint

func RegisterIdentityServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterIdentityServiceHandlerFromEndpoint is same as RegisterIdentityServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterIdentityServiceHandlerServer

func RegisterIdentityServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IdentityServiceServer) error

RegisterIdentityServiceHandlerServer registers the http handlers for service IdentityService to "mux". UnaryRPC :call IdentityServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterIdentityServiceHandlerFromEndpoint instead.

func RegisterIdentityServiceServer

func RegisterIdentityServiceServer(s grpc.ServiceRegistrar, srv IdentityServiceServer)

Types

type AuthenticateRequest

type AuthenticateRequest struct {

	// unique identifier for the ChallengeRequest
	ChallengeId string `protobuf:"bytes,1,opt,name=challenge_id,json=challengeId,proto3" json:"challenge_id,omitempty"`
	// EC Public key that correspond to the private key used to make a signature of the challenge
	PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	// EC signature of the challenge bytes
	Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
	// list of services to access to with auth token.
	Services []string `protobuf:"bytes,4,rep,name=services,proto3" json:"services,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthenticateRequest) Descriptor deprecated

func (*AuthenticateRequest) Descriptor() ([]byte, []int)

Deprecated: Use AuthenticateRequest.ProtoReflect.Descriptor instead.

func (*AuthenticateRequest) GetChallengeId

func (x *AuthenticateRequest) GetChallengeId() string

func (*AuthenticateRequest) GetPublicKey

func (x *AuthenticateRequest) GetPublicKey() []byte

func (*AuthenticateRequest) GetServices added in v0.2.0

func (x *AuthenticateRequest) GetServices() []string

func (*AuthenticateRequest) GetSignature

func (x *AuthenticateRequest) GetSignature() []byte

func (*AuthenticateRequest) ProtoMessage

func (*AuthenticateRequest) ProtoMessage()

func (*AuthenticateRequest) ProtoReflect

func (x *AuthenticateRequest) ProtoReflect() protoreflect.Message

func (*AuthenticateRequest) Reset

func (x *AuthenticateRequest) Reset()

func (*AuthenticateRequest) String

func (x *AuthenticateRequest) String() string

type AuthenticateResponse

type AuthenticateResponse struct {

	// authorization token to connect with other xdex services
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthenticateResponse) Descriptor deprecated

func (*AuthenticateResponse) Descriptor() ([]byte, []int)

Deprecated: Use AuthenticateResponse.ProtoReflect.Descriptor instead.

func (*AuthenticateResponse) GetToken

func (x *AuthenticateResponse) GetToken() string

func (*AuthenticateResponse) ProtoMessage

func (*AuthenticateResponse) ProtoMessage()

func (*AuthenticateResponse) ProtoReflect

func (x *AuthenticateResponse) ProtoReflect() protoreflect.Message

func (*AuthenticateResponse) Reset

func (x *AuthenticateResponse) Reset()

func (*AuthenticateResponse) String

func (x *AuthenticateResponse) String() string

type ChallengeRequest

type ChallengeRequest struct {
	// contains filtered or unexported fields
}

func (*ChallengeRequest) Descriptor deprecated

func (*ChallengeRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChallengeRequest.ProtoReflect.Descriptor instead.

func (*ChallengeRequest) ProtoMessage

func (*ChallengeRequest) ProtoMessage()

func (*ChallengeRequest) ProtoReflect

func (x *ChallengeRequest) ProtoReflect() protoreflect.Message

func (*ChallengeRequest) Reset

func (x *ChallengeRequest) Reset()

func (*ChallengeRequest) String

func (x *ChallengeRequest) String() string

type ChallengeResponse

type ChallengeResponse struct {

	// unique identifier for the request to register new identity
	ChallengeId string `protobuf:"bytes,1,opt,name=challenge_id,json=challengeId,proto3" json:"challenge_id,omitempty"`
	// random challenge to be signed
	Challenge []byte `protobuf:"bytes,2,opt,name=challenge,proto3" json:"challenge,omitempty"`
	// contains filtered or unexported fields
}

func (*ChallengeResponse) Descriptor deprecated

func (*ChallengeResponse) Descriptor() ([]byte, []int)

Deprecated: Use ChallengeResponse.ProtoReflect.Descriptor instead.

func (*ChallengeResponse) GetChallenge

func (x *ChallengeResponse) GetChallenge() []byte

func (*ChallengeResponse) GetChallengeId

func (x *ChallengeResponse) GetChallengeId() string

func (*ChallengeResponse) ProtoMessage

func (*ChallengeResponse) ProtoMessage()

func (*ChallengeResponse) ProtoReflect

func (x *ChallengeResponse) ProtoReflect() protoreflect.Message

func (*ChallengeResponse) Reset

func (x *ChallengeResponse) Reset()

func (*ChallengeResponse) String

func (x *ChallengeResponse) String() string

type IdentityServiceClient

type IdentityServiceClient interface {
	// Request to start the registration process asking for a challenge
	Challenge(ctx context.Context, in *ChallengeRequest, opts ...grpc.CallOption) (*ChallengeResponse, error)
	// Authenticate using a signature of the challenge as a proof
	Authenticate(ctx context.Context, in *AuthenticateRequest, opts ...grpc.CallOption) (*AuthenticateResponse, error)
	SupportedServices(ctx context.Context, in *SupportedServicesRequest, opts ...grpc.CallOption) (*SupportedServicesResponse, error)
}

IdentityServiceClient is the client API for IdentityService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type IdentityServiceServer

type IdentityServiceServer interface {
	// Request to start the registration process asking for a challenge
	Challenge(context.Context, *ChallengeRequest) (*ChallengeResponse, error)
	// Authenticate using a signature of the challenge as a proof
	Authenticate(context.Context, *AuthenticateRequest) (*AuthenticateResponse, error)
	SupportedServices(context.Context, *SupportedServicesRequest) (*SupportedServicesResponse, error)
}

IdentityServiceServer is the server API for IdentityService service. All implementations should embed UnimplementedIdentityServiceServer for forward compatibility

type SupportedServicesRequest added in v0.2.0

type SupportedServicesRequest struct {
	// contains filtered or unexported fields
}

func (*SupportedServicesRequest) Descriptor deprecated added in v0.2.0

func (*SupportedServicesRequest) Descriptor() ([]byte, []int)

Deprecated: Use SupportedServicesRequest.ProtoReflect.Descriptor instead.

func (*SupportedServicesRequest) ProtoMessage added in v0.2.0

func (*SupportedServicesRequest) ProtoMessage()

func (*SupportedServicesRequest) ProtoReflect added in v0.2.0

func (x *SupportedServicesRequest) ProtoReflect() protoreflect.Message

func (*SupportedServicesRequest) Reset added in v0.2.0

func (x *SupportedServicesRequest) Reset()

func (*SupportedServicesRequest) String added in v0.2.0

func (x *SupportedServicesRequest) String() string

type SupportedServicesResponse added in v0.2.0

type SupportedServicesResponse struct {

	// list of supported services for which granting access with auth token.
	Services []string `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"`
	// contains filtered or unexported fields
}

func (*SupportedServicesResponse) Descriptor deprecated added in v0.2.0

func (*SupportedServicesResponse) Descriptor() ([]byte, []int)

Deprecated: Use SupportedServicesResponse.ProtoReflect.Descriptor instead.

func (*SupportedServicesResponse) GetServices added in v0.2.0

func (x *SupportedServicesResponse) GetServices() []string

func (*SupportedServicesResponse) ProtoMessage added in v0.2.0

func (*SupportedServicesResponse) ProtoMessage()

func (*SupportedServicesResponse) ProtoReflect added in v0.2.0

func (*SupportedServicesResponse) Reset added in v0.2.0

func (x *SupportedServicesResponse) Reset()

func (*SupportedServicesResponse) String added in v0.2.0

func (x *SupportedServicesResponse) String() string

type UnimplementedIdentityServiceServer

type UnimplementedIdentityServiceServer struct {
}

UnimplementedIdentityServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedIdentityServiceServer) Authenticate

func (UnimplementedIdentityServiceServer) Challenge

func (UnimplementedIdentityServiceServer) SupportedServices added in v0.2.0

type UnsafeIdentityServiceServer

type UnsafeIdentityServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeIdentityServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IdentityServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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