Documentation
¶
Index ¶
- Variables
- func GetMachineName() (string, error)
- func VerifierFromToken(key crypto.PublicKey, token *Token) ([]byte, error)
- func VerifyToken(key crypto.PublicKey, token *Token, sig []byte) error
- type Credential
- func (*Credential) Descriptor() ([]byte, []int)deprecated
- func (x *Credential) GetOrigin() string
- func (x *Credential) GetToken() *Token
- func (x *Credential) GetVerifier() *Token
- func (*Credential) ProtoMessage()
- func (x *Credential) ProtoReflect() protoreflect.Message
- func (x *Credential) Reset()
- func (x *Credential) String() string
- type CredentialRequest
- type Flavor
- type GetCredResp
- func (*GetCredResp) Descriptor() ([]byte, []int)deprecated
- func (x *GetCredResp) GetCred() *Credential
- func (x *GetCredResp) GetStatus() int32
- func (*GetCredResp) ProtoMessage()
- func (x *GetCredResp) ProtoReflect() protoreflect.Message
- func (x *GetCredResp) Reset()
- func (x *GetCredResp) String() string
- type Sys
- func (*Sys) Descriptor() ([]byte, []int)deprecated
- func (x *Sys) GetGroup() string
- func (x *Sys) GetGroups() []string
- func (x *Sys) GetMachinename() string
- func (x *Sys) GetSecctx() string
- func (x *Sys) GetStamp() uint64
- func (x *Sys) GetUser() string
- func (*Sys) ProtoMessage()
- func (x *Sys) ProtoReflect() protoreflect.Message
- func (x *Sys) Reset()
- func (x *Sys) String() string
- type Token
- type ValidateCredReq
- type ValidateCredResp
- func (*ValidateCredResp) Descriptor() ([]byte, []int)deprecated
- func (x *ValidateCredResp) GetStatus() int32
- func (x *ValidateCredResp) GetToken() *Token
- func (*ValidateCredResp) ProtoMessage()
- func (x *ValidateCredResp) ProtoReflect() protoreflect.Message
- func (x *ValidateCredResp) Reset()
- func (x *ValidateCredResp) String() string
Constants ¶
This section is empty.
Variables ¶
var ( Flavor_name = map[int32]string{ 0: "AUTH_NONE", 1: "AUTH_SYS", } Flavor_value = map[string]int32{ "AUTH_NONE": 0, "AUTH_SYS": 1, } )
Enum value maps for Flavor.
var File_auth_proto protoreflect.FileDescriptor
Functions ¶
func GetMachineName ¶
GetMachineName returns the "short" hostname by stripping the domain from the FQDN.
func VerifierFromToken ¶
VerifierFromToken will return a SHA512 hash of the token data. If a signing key is passed in it will additionally sign the hash of the token.
Types ¶
type Credential ¶
type Credential struct { Token *Token `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // authentication token Verifier *Token `protobuf:"bytes,2,opt,name=verifier,proto3" json:"verifier,omitempty"` // to verify integrity of the token Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` // the agent that created this credential // contains filtered or unexported fields }
Token and verifier are expected to have the same flavor type.
func GetSignedCredential ¶
func GetSignedCredential(ctx context.Context, req *CredentialRequest) (*Credential, error)
GetSignedCredential returns a credential based on the provided domain info and signing key.
func (*Credential) Descriptor
deprecated
func (*Credential) Descriptor() ([]byte, []int)
Deprecated: Use Credential.ProtoReflect.Descriptor instead.
func (*Credential) GetOrigin ¶
func (x *Credential) GetOrigin() string
func (*Credential) GetToken ¶
func (x *Credential) GetToken() *Token
func (*Credential) GetVerifier ¶
func (x *Credential) GetVerifier() *Token
func (*Credential) ProtoMessage ¶
func (*Credential) ProtoMessage()
func (*Credential) ProtoReflect ¶
func (x *Credential) ProtoReflect() protoreflect.Message
func (*Credential) Reset ¶
func (x *Credential) Reset()
func (*Credential) String ¶
func (x *Credential) String() string
type CredentialRequest ¶
type CredentialRequest struct { DomainInfo *security.DomainInfo SigningKey crypto.PrivateKey // contains filtered or unexported fields }
CredentialRequest defines the request parameters for GetSignedCredential.
func NewCredentialRequest ¶
func NewCredentialRequest(info *security.DomainInfo, key crypto.PrivateKey) *CredentialRequest
NewCredentialRequest returns a properly initialized CredentialRequest.
func (*CredentialRequest) WithUserAndGroup ¶
func (r *CredentialRequest) WithUserAndGroup(userStr, groupStr string, groupStrs ...string)
WithUserAndGroup provides an override to set the user, group, and optional list of group names to be used for the request.
type Flavor ¶
type Flavor int32
Types of authentication token
func (Flavor) Descriptor ¶
func (Flavor) Descriptor() protoreflect.EnumDescriptor
func (Flavor) EnumDescriptor
deprecated
func (Flavor) Number ¶
func (x Flavor) Number() protoreflect.EnumNumber
func (Flavor) Type ¶
func (Flavor) Type() protoreflect.EnumType
type GetCredResp ¶
type GetCredResp struct { Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` // Status of the request Cred *Credential `protobuf:"bytes,2,opt,name=cred,proto3" json:"cred,omitempty"` // Caller's authentication credential // contains filtered or unexported fields }
GetCredResp represents the result of a request to fetch authentication credentials.
func (*GetCredResp) Descriptor
deprecated
func (*GetCredResp) Descriptor() ([]byte, []int)
Deprecated: Use GetCredResp.ProtoReflect.Descriptor instead.
func (*GetCredResp) GetCred ¶
func (x *GetCredResp) GetCred() *Credential
func (*GetCredResp) GetStatus ¶
func (x *GetCredResp) GetStatus() int32
func (*GetCredResp) ProtoMessage ¶
func (*GetCredResp) ProtoMessage()
func (*GetCredResp) ProtoReflect ¶
func (x *GetCredResp) ProtoReflect() protoreflect.Message
func (*GetCredResp) Reset ¶
func (x *GetCredResp) Reset()
func (*GetCredResp) String ¶
func (x *GetCredResp) String() string
type Sys ¶
type Sys struct { Stamp uint64 `protobuf:"varint,1,opt,name=stamp,proto3" json:"stamp,omitempty"` // timestamp Machinename string `protobuf:"bytes,2,opt,name=machinename,proto3" json:"machinename,omitempty"` // machine name User string `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"` // user name Group string `protobuf:"bytes,4,opt,name=group,proto3" json:"group,omitempty"` // primary group name Groups []string `protobuf:"bytes,5,rep,name=groups,proto3" json:"groups,omitempty"` // secondary group names Secctx string `protobuf:"bytes,6,opt,name=secctx,proto3" json:"secctx,omitempty"` // Additional field for MAC label // contains filtered or unexported fields }
Token structure for AUTH_SYS flavor cred
func AuthSysFromAuthToken ¶
AuthSysFromAuthToken takes an opaque AuthToken and turns it into a concrete AuthSys data structure.
func (*Sys) Descriptor
deprecated
func (*Sys) GetMachinename ¶
func (*Sys) ProtoMessage ¶
func (*Sys) ProtoMessage()
func (*Sys) ProtoReflect ¶
func (x *Sys) ProtoReflect() protoreflect.Message
type Token ¶
type Token struct { Flavor Flavor `protobuf:"varint,1,opt,name=flavor,proto3,enum=auth.Flavor" json:"flavor,omitempty"` // flavor of this authentication token Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // packed structure of the specified flavor // contains filtered or unexported fields }
func (*Token) Descriptor
deprecated
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (*Token) ProtoReflect ¶
func (x *Token) ProtoReflect() protoreflect.Message
type ValidateCredReq ¶
type ValidateCredReq struct { Cred *Credential `protobuf:"bytes,1,opt,name=cred,proto3" json:"cred,omitempty"` // Credential to be validated // contains filtered or unexported fields }
ValidateCredReq represents a request to verify a set of authentication credentials.
func (*ValidateCredReq) Descriptor
deprecated
func (*ValidateCredReq) Descriptor() ([]byte, []int)
Deprecated: Use ValidateCredReq.ProtoReflect.Descriptor instead.
func (*ValidateCredReq) GetCred ¶
func (x *ValidateCredReq) GetCred() *Credential
func (*ValidateCredReq) ProtoMessage ¶
func (*ValidateCredReq) ProtoMessage()
func (*ValidateCredReq) ProtoReflect ¶
func (x *ValidateCredReq) ProtoReflect() protoreflect.Message
func (*ValidateCredReq) Reset ¶
func (x *ValidateCredReq) Reset()
func (*ValidateCredReq) String ¶
func (x *ValidateCredReq) String() string
type ValidateCredResp ¶
type ValidateCredResp struct { Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` // Status of the request Token *Token `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // Validated authentication token from the credential // contains filtered or unexported fields }
ValidateCredResp represents the result of a request to validate authentication credentials.
func (*ValidateCredResp) Descriptor
deprecated
func (*ValidateCredResp) Descriptor() ([]byte, []int)
Deprecated: Use ValidateCredResp.ProtoReflect.Descriptor instead.
func (*ValidateCredResp) GetStatus ¶
func (x *ValidateCredResp) GetStatus() int32
func (*ValidateCredResp) GetToken ¶
func (x *ValidateCredResp) GetToken() *Token
func (*ValidateCredResp) ProtoMessage ¶
func (*ValidateCredResp) ProtoMessage()
func (*ValidateCredResp) ProtoReflect ¶
func (x *ValidateCredResp) ProtoReflect() protoreflect.Message
func (*ValidateCredResp) Reset ¶
func (x *ValidateCredResp) Reset()
func (*ValidateCredResp) String ¶
func (x *ValidateCredResp) String() string