auth

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MPL-2.0 Imports: 18 Imported by: 1

Documentation

Overview

Package auth is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	AuthService_RegisterPublicKey_FullMethodName          = "/auth.AuthService/RegisterPublicKey"
	AuthService_AwaitPublicKeyConfirmation_FullMethodName = "/auth.AuthService/AwaitPublicKeyConfirmation"
	AuthService_ConfirmPublicKey_FullMethodName           = "/auth.AuthService/ConfirmPublicKey"
)

Variables

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)
View Source
var AuthService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "auth.AuthService",
	HandlerType: (*AuthServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegisterPublicKey",
			Handler:    _AuthService_RegisterPublicKey_Handler,
		},
		{
			MethodName: "AwaitPublicKeyConfirmation",
			Handler:    _AuthService_AwaitPublicKeyConfirmation_Handler,
		},
		{
			MethodName: "ConfirmPublicKey",
			Handler:    _AuthService_ConfirmPublicKey_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "auth/auth.proto",
}

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

View Source
var File_auth_auth_proto protoreflect.FileDescriptor

Functions

func RegisterAuthServiceHandler

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

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

func RegisterAuthServiceHandlerClient

func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error

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

func RegisterAuthServiceHandlerFromEndpoint

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

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

func RegisterAuthServiceHandlerServer

func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error

RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux". UnaryRPC :call AuthServiceServer 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 RegisterAuthServiceHandlerFromEndpoint instead.

func RegisterAuthServiceServer

func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)

Types

type AuthServiceClient

type AuthServiceClient interface {
	RegisterPublicKey(ctx context.Context, in *RegisterPublicKeyRequest, opts ...grpc.CallOption) (*RegisterPublicKeyResponse, error)
	AwaitPublicKeyConfirmation(ctx context.Context, in *AwaitPublicKeyConfirmationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	ConfirmPublicKey(ctx context.Context, in *ConfirmPublicKeyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

AuthServiceClient is the client API for AuthService 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 AuthServiceServer

type AuthServiceServer interface {
	RegisterPublicKey(context.Context, *RegisterPublicKeyRequest) (*RegisterPublicKeyResponse, error)
	AwaitPublicKeyConfirmation(context.Context, *AwaitPublicKeyConfirmationRequest) (*emptypb.Empty, error)
	ConfirmPublicKey(context.Context, *ConfirmPublicKeyRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

AuthServiceServer is the server API for AuthService service. All implementations must embed UnimplementedAuthServiceServer for forward compatibility

type AwaitPublicKeyConfirmationRequest

type AwaitPublicKeyConfirmationRequest struct {
	PublicKeyId string `protobuf:"bytes,1,opt,name=public_key_id,json=publicKeyId,proto3" json:"public_key_id,omitempty"`
	// contains filtered or unexported fields
}

func (*AwaitPublicKeyConfirmationRequest) Descriptor deprecated

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

Deprecated: Use AwaitPublicKeyConfirmationRequest.ProtoReflect.Descriptor instead.

func (*AwaitPublicKeyConfirmationRequest) EqualMessageVT added in v0.2.3

func (this *AwaitPublicKeyConfirmationRequest) EqualMessageVT(thatMsg proto.Message) bool

func (*AwaitPublicKeyConfirmationRequest) EqualVT added in v0.2.3

func (*AwaitPublicKeyConfirmationRequest) GetPublicKeyId

func (x *AwaitPublicKeyConfirmationRequest) GetPublicKeyId() string

func (*AwaitPublicKeyConfirmationRequest) MarshalToSizedBufferVT

func (m *AwaitPublicKeyConfirmationRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*AwaitPublicKeyConfirmationRequest) MarshalToVT

func (m *AwaitPublicKeyConfirmationRequest) MarshalToVT(dAtA []byte) (int, error)

func (*AwaitPublicKeyConfirmationRequest) MarshalVT

func (m *AwaitPublicKeyConfirmationRequest) MarshalVT() (dAtA []byte, err error)

func (*AwaitPublicKeyConfirmationRequest) ProtoMessage

func (*AwaitPublicKeyConfirmationRequest) ProtoMessage()

func (*AwaitPublicKeyConfirmationRequest) ProtoReflect

func (*AwaitPublicKeyConfirmationRequest) Reset

func (*AwaitPublicKeyConfirmationRequest) SizeVT

func (m *AwaitPublicKeyConfirmationRequest) SizeVT() (n int)

func (*AwaitPublicKeyConfirmationRequest) String

func (*AwaitPublicKeyConfirmationRequest) UnmarshalVT

func (m *AwaitPublicKeyConfirmationRequest) UnmarshalVT(dAtA []byte) error

type ConfirmPublicKeyRequest

type ConfirmPublicKeyRequest struct {
	PublicKeyId string `protobuf:"bytes,1,opt,name=public_key_id,json=publicKeyId,proto3" json:"public_key_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfirmPublicKeyRequest) Descriptor deprecated

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

Deprecated: Use ConfirmPublicKeyRequest.ProtoReflect.Descriptor instead.

func (*ConfirmPublicKeyRequest) EqualMessageVT added in v0.2.3

func (this *ConfirmPublicKeyRequest) EqualMessageVT(thatMsg proto.Message) bool

func (*ConfirmPublicKeyRequest) EqualVT added in v0.2.3

func (*ConfirmPublicKeyRequest) GetPublicKeyId

func (x *ConfirmPublicKeyRequest) GetPublicKeyId() string

func (*ConfirmPublicKeyRequest) MarshalToSizedBufferVT

func (m *ConfirmPublicKeyRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ConfirmPublicKeyRequest) MarshalToVT

func (m *ConfirmPublicKeyRequest) MarshalToVT(dAtA []byte) (int, error)

func (*ConfirmPublicKeyRequest) MarshalVT

func (m *ConfirmPublicKeyRequest) MarshalVT() (dAtA []byte, err error)

func (*ConfirmPublicKeyRequest) ProtoMessage

func (*ConfirmPublicKeyRequest) ProtoMessage()

func (*ConfirmPublicKeyRequest) ProtoReflect

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

func (*ConfirmPublicKeyRequest) Reset

func (x *ConfirmPublicKeyRequest) Reset()

func (*ConfirmPublicKeyRequest) SizeVT

func (m *ConfirmPublicKeyRequest) SizeVT() (n int)

func (*ConfirmPublicKeyRequest) String

func (x *ConfirmPublicKeyRequest) String() string

func (*ConfirmPublicKeyRequest) UnmarshalVT

func (m *ConfirmPublicKeyRequest) UnmarshalVT(dAtA []byte) error

type Identity

type Identity struct {
	Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	// contains filtered or unexported fields
}

func (*Identity) Descriptor deprecated

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

Deprecated: Use Identity.ProtoReflect.Descriptor instead.

func (*Identity) EqualMessageVT added in v0.2.3

func (this *Identity) EqualMessageVT(thatMsg proto.Message) bool

func (*Identity) EqualVT added in v0.2.3

func (this *Identity) EqualVT(that *Identity) bool

func (*Identity) GetEmail

func (x *Identity) GetEmail() string

func (*Identity) MarshalToSizedBufferVT

func (m *Identity) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Identity) MarshalToVT

func (m *Identity) MarshalToVT(dAtA []byte) (int, error)

func (*Identity) MarshalVT

func (m *Identity) MarshalVT() (dAtA []byte, err error)

func (*Identity) ProtoMessage

func (*Identity) ProtoMessage()

func (*Identity) ProtoReflect

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

func (*Identity) Reset

func (x *Identity) Reset()

func (*Identity) SizeVT

func (m *Identity) SizeVT() (n int)

func (*Identity) String

func (x *Identity) String() string

func (*Identity) UnmarshalVT

func (m *Identity) UnmarshalVT(dAtA []byte) error

type PublicKey

type PublicKey struct {
	PgpData      []byte `protobuf:"bytes,1,opt,name=pgp_data,json=pgpData,proto3" json:"pgp_data,omitempty"`
	WebauthnData []byte `protobuf:"bytes,2,opt,name=webauthn_data,json=webauthnData,proto3" json:"webauthn_data,omitempty"`
	// contains filtered or unexported fields
}

func (*PublicKey) Descriptor deprecated

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

Deprecated: Use PublicKey.ProtoReflect.Descriptor instead.

func (*PublicKey) EqualMessageVT added in v0.2.3

func (this *PublicKey) EqualMessageVT(thatMsg proto.Message) bool

func (*PublicKey) EqualVT added in v0.2.3

func (this *PublicKey) EqualVT(that *PublicKey) bool

func (*PublicKey) GetPgpData

func (x *PublicKey) GetPgpData() []byte

func (*PublicKey) GetWebauthnData

func (x *PublicKey) GetWebauthnData() []byte

func (*PublicKey) MarshalToSizedBufferVT

func (m *PublicKey) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*PublicKey) MarshalToVT

func (m *PublicKey) MarshalToVT(dAtA []byte) (int, error)

func (*PublicKey) MarshalVT

func (m *PublicKey) MarshalVT() (dAtA []byte, err error)

func (*PublicKey) ProtoMessage

func (*PublicKey) ProtoMessage()

func (*PublicKey) ProtoReflect

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

func (*PublicKey) Reset

func (x *PublicKey) Reset()

func (*PublicKey) SizeVT

func (m *PublicKey) SizeVT() (n int)

func (*PublicKey) String

func (x *PublicKey) String() string

func (*PublicKey) UnmarshalVT

func (m *PublicKey) UnmarshalVT(dAtA []byte) error

type RegisterPublicKeyRequest

type RegisterPublicKeyRequest struct {
	PublicKey *PublicKey `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	Identity  *Identity  `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"`
	// The role of the public key. When skip_user_role is true, this field is ignored.
	Role string `protobuf:"bytes,5,opt,name=role,proto3" json:"role,omitempty"`
	// If true, the role field will be used to determine the role of the public key.
	SkipUserRole bool `protobuf:"varint,6,opt,name=skip_user_role,json=skipUserRole,proto3" json:"skip_user_role,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterPublicKeyRequest) Descriptor deprecated

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

Deprecated: Use RegisterPublicKeyRequest.ProtoReflect.Descriptor instead.

func (*RegisterPublicKeyRequest) EqualMessageVT added in v0.2.3

func (this *RegisterPublicKeyRequest) EqualMessageVT(thatMsg proto.Message) bool

func (*RegisterPublicKeyRequest) EqualVT added in v0.2.3

func (*RegisterPublicKeyRequest) GetIdentity

func (x *RegisterPublicKeyRequest) GetIdentity() *Identity

func (*RegisterPublicKeyRequest) GetPublicKey

func (x *RegisterPublicKeyRequest) GetPublicKey() *PublicKey

func (*RegisterPublicKeyRequest) GetRole added in v0.2.5

func (x *RegisterPublicKeyRequest) GetRole() string

func (*RegisterPublicKeyRequest) GetSkipUserRole added in v0.2.5

func (x *RegisterPublicKeyRequest) GetSkipUserRole() bool

func (*RegisterPublicKeyRequest) MarshalToSizedBufferVT

func (m *RegisterPublicKeyRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*RegisterPublicKeyRequest) MarshalToVT

func (m *RegisterPublicKeyRequest) MarshalToVT(dAtA []byte) (int, error)

func (*RegisterPublicKeyRequest) MarshalVT

func (m *RegisterPublicKeyRequest) MarshalVT() (dAtA []byte, err error)

func (*RegisterPublicKeyRequest) ProtoMessage

func (*RegisterPublicKeyRequest) ProtoMessage()

func (*RegisterPublicKeyRequest) ProtoReflect

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

func (*RegisterPublicKeyRequest) Reset

func (x *RegisterPublicKeyRequest) Reset()

func (*RegisterPublicKeyRequest) SizeVT

func (m *RegisterPublicKeyRequest) SizeVT() (n int)

func (*RegisterPublicKeyRequest) String

func (x *RegisterPublicKeyRequest) String() string

func (*RegisterPublicKeyRequest) UnmarshalVT

func (m *RegisterPublicKeyRequest) UnmarshalVT(dAtA []byte) error

type RegisterPublicKeyResponse

type RegisterPublicKeyResponse struct {
	LoginUrl    string `protobuf:"bytes,1,opt,name=login_url,json=loginUrl,proto3" json:"login_url,omitempty"`
	PublicKeyId string `protobuf:"bytes,2,opt,name=public_key_id,json=publicKeyId,proto3" json:"public_key_id,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterPublicKeyResponse) Descriptor deprecated

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

Deprecated: Use RegisterPublicKeyResponse.ProtoReflect.Descriptor instead.

func (*RegisterPublicKeyResponse) EqualMessageVT added in v0.2.3

func (this *RegisterPublicKeyResponse) EqualMessageVT(thatMsg proto.Message) bool

func (*RegisterPublicKeyResponse) EqualVT added in v0.2.3

func (*RegisterPublicKeyResponse) GetLoginUrl

func (x *RegisterPublicKeyResponse) GetLoginUrl() string

func (*RegisterPublicKeyResponse) GetPublicKeyId

func (x *RegisterPublicKeyResponse) GetPublicKeyId() string

func (*RegisterPublicKeyResponse) MarshalToSizedBufferVT

func (m *RegisterPublicKeyResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*RegisterPublicKeyResponse) MarshalToVT

func (m *RegisterPublicKeyResponse) MarshalToVT(dAtA []byte) (int, error)

func (*RegisterPublicKeyResponse) MarshalVT

func (m *RegisterPublicKeyResponse) MarshalVT() (dAtA []byte, err error)

func (*RegisterPublicKeyResponse) ProtoMessage

func (*RegisterPublicKeyResponse) ProtoMessage()

func (*RegisterPublicKeyResponse) ProtoReflect

func (*RegisterPublicKeyResponse) Reset

func (x *RegisterPublicKeyResponse) Reset()

func (*RegisterPublicKeyResponse) SizeVT

func (m *RegisterPublicKeyResponse) SizeVT() (n int)

func (*RegisterPublicKeyResponse) String

func (x *RegisterPublicKeyResponse) String() string

func (*RegisterPublicKeyResponse) UnmarshalVT

func (m *RegisterPublicKeyResponse) UnmarshalVT(dAtA []byte) error

type UnimplementedAuthServiceServer

type UnimplementedAuthServiceServer struct {
}

UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthServiceServer) AwaitPublicKeyConfirmation

func (UnimplementedAuthServiceServer) ConfirmPublicKey

func (UnimplementedAuthServiceServer) RegisterPublicKey

type UnsafeAuthServiceServer

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

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

Jump to

Keyboard shortcuts

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