authn

package
v0.0.0-...-315b2c7 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthAuthn = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAuthn   = fmt.Errorf("proto: integer overflow")
)
View Source
var CredentialType_name = map[int32]string{
	0: "NONE",
	1: "PASSWORD",
}
View Source
var CredentialType_value = map[string]int32{
	"NONE":     0,
	"PASSWORD": 1,
}

Functions

func RegisterAuthnHandler

func RegisterAuthnHandler(s server.Server, hdlr AuthnHandler, opts ...server.HandlerOption) error

func RegisterAuthnServer

func RegisterAuthnServer(s *grpc.Server, srv AuthnServer)

Types

type AuthnClient

type AuthnClient interface {
	Create(ctx context.Context, in *Credential, opts ...grpc.CallOption) (*CredentialResponse, error)
	Validate(ctx context.Context, in *Credential, opts ...grpc.CallOption) (*CredentialResponse, error)
	Update(ctx context.Context, in *CredentialUpdate, opts ...grpc.CallOption) (*CredentialResponse, error)
}

AuthnClient is the client API for Authn service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewAuthnClient

func NewAuthnClient(cc *grpc.ClientConn) AuthnClient

type AuthnServer

AuthnServer is the server API for Authn service.

type AuthnService

type AuthnService interface {
	Create(ctx context.Context, in *Credential, opts ...client.CallOption) (*CredentialResponse, error)
	Validate(ctx context.Context, in *Credential, opts ...client.CallOption) (*CredentialResponse, error)
	Update(ctx context.Context, in *CredentialUpdate, opts ...client.CallOption) (*CredentialResponse, error)
}

func NewAuthnService

func NewAuthnService(name string, c client.Client) AuthnService

type Credential

type Credential struct {
	Id             *uuid.UUID     `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" bson:"_id"`
	UserID         *uuid.UUID     `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID,omitempty"`
	CredentialType CredentialType `protobuf:"varint,3,opt,name=credentialType,proto3,enum=authn.CredentialType" json:"credentialType,omitempty"`
	Credential     []byte         `protobuf:"bytes,4,opt,name=credential,proto3" json:"credential,omitempty"`
}

func (*Credential) Descriptor

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

func (*Credential) GetCredential

func (m *Credential) GetCredential() []byte

func (*Credential) GetCredentialType

func (m *Credential) GetCredentialType() CredentialType

func (*Credential) GetId

func (m *Credential) GetId() *uuid.UUID

func (*Credential) GetUserID

func (m *Credential) GetUserID() *uuid.UUID

func (*Credential) Marshal

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

func (*Credential) MarshalTo

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

func (*Credential) ProtoMessage

func (*Credential) ProtoMessage()

func (*Credential) Reset

func (m *Credential) Reset()

func (*Credential) Size

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

func (*Credential) String

func (m *Credential) String() string

func (*Credential) Unmarshal

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

func (*Credential) XXX_DiscardUnknown

func (m *Credential) XXX_DiscardUnknown()

func (*Credential) XXX_Marshal

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

func (*Credential) XXX_Merge

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

func (*Credential) XXX_Size

func (m *Credential) XXX_Size() int

func (*Credential) XXX_Unmarshal

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

type CredentialResponse

type CredentialResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
}

func (*CredentialResponse) Descriptor

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

func (*CredentialResponse) GetSuccess

func (m *CredentialResponse) GetSuccess() bool

func (*CredentialResponse) Marshal

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

func (*CredentialResponse) MarshalTo

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

func (*CredentialResponse) ProtoMessage

func (*CredentialResponse) ProtoMessage()

func (*CredentialResponse) Reset

func (m *CredentialResponse) Reset()

func (*CredentialResponse) Size

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

func (*CredentialResponse) String

func (m *CredentialResponse) String() string

func (*CredentialResponse) Unmarshal

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

func (*CredentialResponse) XXX_DiscardUnknown

func (m *CredentialResponse) XXX_DiscardUnknown()

func (*CredentialResponse) XXX_Marshal

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

func (*CredentialResponse) XXX_Merge

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

func (*CredentialResponse) XXX_Size

func (m *CredentialResponse) XXX_Size() int

func (*CredentialResponse) XXX_Unmarshal

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

type CredentialType

type CredentialType int32
const (
	CredentialType_NONE     CredentialType = 0
	CredentialType_PASSWORD CredentialType = 1
)

func (CredentialType) EnumDescriptor

func (CredentialType) EnumDescriptor() ([]byte, []int)

func (CredentialType) String

func (x CredentialType) String() string

type CredentialUpdate

type CredentialUpdate struct {
	Current *Credential `protobuf:"bytes,1,opt,name=current,proto3" json:"current,omitempty"`
	New     *Credential `protobuf:"bytes,2,opt,name=new,proto3" json:"new,omitempty"`
}

func (*CredentialUpdate) Descriptor

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

func (*CredentialUpdate) GetCurrent

func (m *CredentialUpdate) GetCurrent() *Credential

func (*CredentialUpdate) GetNew

func (m *CredentialUpdate) GetNew() *Credential

func (*CredentialUpdate) Marshal

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

func (*CredentialUpdate) MarshalTo

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

func (*CredentialUpdate) ProtoMessage

func (*CredentialUpdate) ProtoMessage()

func (*CredentialUpdate) Reset

func (m *CredentialUpdate) Reset()

func (*CredentialUpdate) Size

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

func (*CredentialUpdate) String

func (m *CredentialUpdate) String() string

func (*CredentialUpdate) Unmarshal

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

func (*CredentialUpdate) XXX_DiscardUnknown

func (m *CredentialUpdate) XXX_DiscardUnknown()

func (*CredentialUpdate) XXX_Marshal

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

func (*CredentialUpdate) XXX_Merge

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

func (*CredentialUpdate) XXX_Size

func (m *CredentialUpdate) XXX_Size() int

func (*CredentialUpdate) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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