Documentation ¶
Index ¶
- Constants
- Variables
- func GrpcProtoServiceDesc() *grpc.ServiceDesc
- func RandString(chars []rune, length uint) string
- type Authenticator
- type Code
- type GrpcProtoClient
- type GrpcProtoServer
- type HashedCode
- type Options
- type ProtoCheckOTPRequest
- func (*ProtoCheckOTPRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ProtoCheckOTPRequest) GetCode() string
- func (x *ProtoCheckOTPRequest) GetPrefix() string
- func (x *ProtoCheckOTPRequest) GetReceiver() string
- func (x *ProtoCheckOTPRequest) GetSalt() []byte
- func (x *ProtoCheckOTPRequest) GetType() string
- func (*ProtoCheckOTPRequest) ProtoMessage()
- func (x *ProtoCheckOTPRequest) ProtoReflect() protoreflect.Message
- func (x *ProtoCheckOTPRequest) Reset()
- func (x *ProtoCheckOTPRequest) String() string
- type ProtoCheckOTPResponse
- func (*ProtoCheckOTPResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ProtoCheckOTPResponse) GetDeadline() *timestamppb.Timestamp
- func (x *ProtoCheckOTPResponse) GetValid() bool
- func (*ProtoCheckOTPResponse) ProtoMessage()
- func (x *ProtoCheckOTPResponse) ProtoReflect() protoreflect.Message
- func (x *ProtoCheckOTPResponse) Reset()
- func (x *ProtoCheckOTPResponse) String() string
- type ProtoSendOTPRequest
- func (*ProtoSendOTPRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ProtoSendOTPRequest) GetTo() string
- func (x *ProtoSendOTPRequest) GetType() string
- func (*ProtoSendOTPRequest) ProtoMessage()
- func (x *ProtoSendOTPRequest) ProtoReflect() protoreflect.Message
- func (x *ProtoSendOTPRequest) Reset()
- func (x *ProtoSendOTPRequest) String() string
- type ProtoSendOTPResponse
- func (*ProtoSendOTPResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ProtoSendOTPResponse) GetDeadline() *timestamppb.Timestamp
- func (x *ProtoSendOTPResponse) GetPrefix() string
- func (x *ProtoSendOTPResponse) GetSalt() []byte
- func (*ProtoSendOTPResponse) ProtoMessage()
- func (x *ProtoSendOTPResponse) ProtoReflect() protoreflect.Message
- func (x *ProtoSendOTPResponse) Reset()
- func (x *ProtoSendOTPResponse) String() string
- type Repo
- type Salt
- type Sender
- type SendersMap
- type Token
- type TokenID
Constants ¶
View Source
const ( DefaultPrefixChars = "ABC" DefaultCodeLength = 6 DefaultCodeChars = "1234567890" )
Variables ¶
View Source
var File_api_Authentify_proto protoreflect.FileDescriptor
Functions ¶
func GrpcProtoServiceDesc ¶
func GrpcProtoServiceDesc() *grpc.ServiceDesc
func RandString ¶
Types ¶
type Authenticator ¶
type Authenticator interface { SendCode(ctx context.Context, sender Sender, to string) (_ Token, prefix string, _ error) RetrieveToken(ctx context.Context, receiver string) (Token, error) }
func NewAuthenticator ¶
func NewAuthenticator(opt Options) (Authenticator, error)
type GrpcProtoClient ¶
type GrpcProtoClient interface { SendOTP(ctx context.Context, in *ProtoSendOTPRequest, opts ...grpc.CallOption) (*ProtoSendOTPResponse, error) CheckOTP(ctx context.Context, in *ProtoCheckOTPRequest, opts ...grpc.CallOption) (*ProtoCheckOTPResponse, error) }
func NewGrpcProtoClient ¶
func NewGrpcProtoClient(cc *grpc.ClientConn) GrpcProtoClient
type GrpcProtoServer ¶
type GrpcProtoServer interface { SendOTP(context.Context, *ProtoSendOTPRequest) (*ProtoSendOTPResponse, error) CheckOTP(context.Context, *ProtoCheckOTPRequest) (*ProtoCheckOTPResponse, error) // contains filtered or unexported methods }
func NewGrpcProtoServer ¶
func NewGrpcProtoServer(a Authenticator, senders SendersMap) (GrpcProtoServer, error)
type HashedCode ¶
func AsHashedCode ¶
func AsHashedCode(hash []byte) (HashedCode, error)
type ProtoCheckOTPRequest ¶
type ProtoCheckOTPRequest struct { Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"` Salt []byte `protobuf:"bytes,3,opt,name=salt,proto3" json:"salt,omitempty"` Receiver string `protobuf:"bytes,4,opt,name=receiver,proto3" json:"receiver,omitempty"` Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*ProtoCheckOTPRequest) Descriptor
deprecated
func (*ProtoCheckOTPRequest) Descriptor() ([]byte, []int)
Deprecated: Use ProtoCheckOTPRequest.ProtoReflect.Descriptor instead.
func (*ProtoCheckOTPRequest) GetCode ¶
func (x *ProtoCheckOTPRequest) GetCode() string
func (*ProtoCheckOTPRequest) GetPrefix ¶
func (x *ProtoCheckOTPRequest) GetPrefix() string
func (*ProtoCheckOTPRequest) GetReceiver ¶
func (x *ProtoCheckOTPRequest) GetReceiver() string
func (*ProtoCheckOTPRequest) GetSalt ¶
func (x *ProtoCheckOTPRequest) GetSalt() []byte
func (*ProtoCheckOTPRequest) GetType ¶
func (x *ProtoCheckOTPRequest) GetType() string
func (*ProtoCheckOTPRequest) ProtoMessage ¶
func (*ProtoCheckOTPRequest) ProtoMessage()
func (*ProtoCheckOTPRequest) ProtoReflect ¶
func (x *ProtoCheckOTPRequest) ProtoReflect() protoreflect.Message
func (*ProtoCheckOTPRequest) Reset ¶
func (x *ProtoCheckOTPRequest) Reset()
func (*ProtoCheckOTPRequest) String ¶
func (x *ProtoCheckOTPRequest) String() string
type ProtoCheckOTPResponse ¶
type ProtoCheckOTPResponse struct { Deadline *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=deadline,proto3" json:"deadline,omitempty"` Valid bool `protobuf:"varint,4,opt,name=valid,proto3" json:"valid,omitempty"` // contains filtered or unexported fields }
func (*ProtoCheckOTPResponse) Descriptor
deprecated
func (*ProtoCheckOTPResponse) Descriptor() ([]byte, []int)
Deprecated: Use ProtoCheckOTPResponse.ProtoReflect.Descriptor instead.
func (*ProtoCheckOTPResponse) GetDeadline ¶
func (x *ProtoCheckOTPResponse) GetDeadline() *timestamppb.Timestamp
func (*ProtoCheckOTPResponse) GetValid ¶
func (x *ProtoCheckOTPResponse) GetValid() bool
func (*ProtoCheckOTPResponse) ProtoMessage ¶
func (*ProtoCheckOTPResponse) ProtoMessage()
func (*ProtoCheckOTPResponse) ProtoReflect ¶
func (x *ProtoCheckOTPResponse) ProtoReflect() protoreflect.Message
func (*ProtoCheckOTPResponse) Reset ¶
func (x *ProtoCheckOTPResponse) Reset()
func (*ProtoCheckOTPResponse) String ¶
func (x *ProtoCheckOTPResponse) String() string
type ProtoSendOTPRequest ¶
type ProtoSendOTPRequest struct { To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*ProtoSendOTPRequest) Descriptor
deprecated
func (*ProtoSendOTPRequest) Descriptor() ([]byte, []int)
Deprecated: Use ProtoSendOTPRequest.ProtoReflect.Descriptor instead.
func (*ProtoSendOTPRequest) GetTo ¶
func (x *ProtoSendOTPRequest) GetTo() string
func (*ProtoSendOTPRequest) GetType ¶
func (x *ProtoSendOTPRequest) GetType() string
func (*ProtoSendOTPRequest) ProtoMessage ¶
func (*ProtoSendOTPRequest) ProtoMessage()
func (*ProtoSendOTPRequest) ProtoReflect ¶
func (x *ProtoSendOTPRequest) ProtoReflect() protoreflect.Message
func (*ProtoSendOTPRequest) Reset ¶
func (x *ProtoSendOTPRequest) Reset()
func (*ProtoSendOTPRequest) String ¶
func (x *ProtoSendOTPRequest) String() string
type ProtoSendOTPResponse ¶
type ProtoSendOTPResponse struct { Deadline *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=deadline,proto3" json:"deadline,omitempty"` Salt []byte `protobuf:"bytes,2,opt,name=salt,proto3" json:"salt,omitempty"` Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` // contains filtered or unexported fields }
func (*ProtoSendOTPResponse) Descriptor
deprecated
func (*ProtoSendOTPResponse) Descriptor() ([]byte, []int)
Deprecated: Use ProtoSendOTPResponse.ProtoReflect.Descriptor instead.
func (*ProtoSendOTPResponse) GetDeadline ¶
func (x *ProtoSendOTPResponse) GetDeadline() *timestamppb.Timestamp
func (*ProtoSendOTPResponse) GetPrefix ¶
func (x *ProtoSendOTPResponse) GetPrefix() string
func (*ProtoSendOTPResponse) GetSalt ¶
func (x *ProtoSendOTPResponse) GetSalt() []byte
func (*ProtoSendOTPResponse) ProtoMessage ¶
func (*ProtoSendOTPResponse) ProtoMessage()
func (*ProtoSendOTPResponse) ProtoReflect ¶
func (x *ProtoSendOTPResponse) ProtoReflect() protoreflect.Message
func (*ProtoSendOTPResponse) Reset ¶
func (x *ProtoSendOTPResponse) Reset()
func (*ProtoSendOTPResponse) String ¶
func (x *ProtoSendOTPResponse) String() string
type Repo ¶
type SendersMap ¶
func SendersToMap ¶
func SendersToMap(senders ...Sender) (SendersMap, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.