Documentation ¶
Index ¶
- Constants
- func TemplateRoles() string
- func TemplateStates() string
- type AccessReq
- func (accessReq *AccessReq) Copy() (*AccessReq, error)
- func (accessReq *AccessReq) Equal(accessReqTwo *AccessReq) bool
- func (accessReq *AccessReq) FromString(data string) error
- func (accessReq *AccessReq) Normalize(toleratesEmptyFields bool) error
- func (accessReq AccessReq) String() string
- func (accessReq *AccessReq) Test(toleratesEmptyFields bool) error
- func (accessReq *AccessReq) TestSubject(toleratesEmptyFields bool) error
- type AccessReqDB
- type AccessReqInner
- type DirConnSettings
- type ESAMPubKey
- func (key *ESAMPubKey) Copy() (*ESAMPubKey, error)
- func (key *ESAMPubKey) Equal(keyTwo *ESAMPubKey) bool
- func (key *ESAMPubKey) EqualConstantTime(keyTwo *ESAMPubKey) bool
- func (key *ESAMPubKey) Len() int
- func (key ESAMPubKey) MarshalYAML() (interface{}, error)
- func (key *ESAMPubKey) Normalize(toleratesEmptyFields bool) error
- func (key *ESAMPubKey) Template() error
- func (key *ESAMPubKey) Test(toleratesEmptyFields bool) error
- func (key *ESAMPubKey) UnmarshalYAML(value *yaml.Node) error
- type Node
- func (node *Node) Copy() (*Node, error)
- func (node *Node) Equal(nodeTwo *Node) bool
- func (node *Node) FromString(data string) error
- func (node *Node) Normalize(toleratesEmptyFields bool) error
- func (node Node) String() string
- func (node *Node) Template() error
- func (node *Node) Test(toleratesEmptyFields bool) error
- type NodeAuth
- type NodeDB
- type NodeSign
- type Tester
- type User
- func (user *User) Copy() (*User, error)
- func (user *User) Equal(userTwo *User) bool
- func (user *User) EqualWithIgnoreFields(userTwo *User, ignoreFields map[string]bool) bool
- func (user *User) FromString(data string) error
- func (user *User) Normalize(toleratesEmptyFields bool) error
- func (user User) String() string
- func (user *User) Template() error
- func (user *User) Test(toleratesEmptyFields bool) error
- func (user *User) TestRole(toleratesEmptyFields bool) error
- func (user *User) TestState(toleratesEmptyFields bool) error
- type UserAuth
- type UserDB
- func (user *UserDB) Copy() (*UserDB, error)
- func (user *UserDB) Equal(userTwo *UserDB) bool
- func (user *UserDB) EqualWithIgnoreFields(userTwo *UserDB, ignoreFields map[string]bool) bool
- func (user *UserDB) Normalize() error
- func (user *UserDB) Sign(key *rsa.PrivateKey, selfSignedFields map[string]bool) error
- func (user *UserDB) Template() error
- func (user *UserDB) Test() error
- func (user *UserDB) Verify(selfSignedFields map[string]bool) error
- type UserSign
Constants ¶
View Source
const ( AccessReqSubjectUser = "user" AccessReqSubjectAgent = "agent" )
View Source
const ( ToleratesEmptyFieldsYes = true ToleratesEmptyFieldsNo = false )
ToleratesEmptyFieldsYes used when using structures as filters
View Source
const ( ESAMPubKeyFieldName = "ESAMPubKey" SignSubjectFieldName = "SignSubject" )
Signing process constants
View Source
const ( UserRoleOwner = "owner" UserRoleSecAdmin = "sec_admin" UserRoleEngineer = "engineer" )
View Source
const ( UserStateEnabled = "enabled" UserStateSuspended = "suspended" UserStateDisabled = "disabled" )
Variables ¶
This section is empty.
Functions ¶
func TemplateRoles ¶
func TemplateRoles() string
func TemplateStates ¶
func TemplateStates() string
Types ¶
type AccessReq ¶
type AccessReq struct { ESAMPubKey ESAMPubKey `yaml:"ESAM public key" json:"esam_pub_key" db:"esam_pub_key" sqltype:"VARBINARY(6144) NOT NULL PRIMARY KEY"` Subject string `yaml:"Subject" json:"subject" db:"subject" sqltype:"CHAR(16) NOT NULL"` Name string `yaml:"Name" json:"name" db:"name" sqltype:"CHAR(63)"` }
func (*AccessReq) FromString ¶
func (*AccessReq) TestSubject ¶
type AccessReqDB ¶
type AccessReqDB struct { AccessReq `yaml:",inline"` AccessReqInner `yaml:",inline"` }
func (*AccessReqDB) Copy ¶
func (accessReq *AccessReqDB) Copy() (*AccessReqDB, error)
func (*AccessReqDB) Equal ¶
func (accessReq *AccessReqDB) Equal(accessReqTwo *AccessReqDB) bool
func (*AccessReqDB) FromString ¶
func (accessReq *AccessReqDB) FromString(data string) error
func (AccessReqDB) String ¶
func (accessReq AccessReqDB) String() string
type AccessReqInner ¶
type DirConnSettings ¶
type ESAMPubKey ¶
type ESAMPubKey []byte
func (*ESAMPubKey) Copy ¶
func (key *ESAMPubKey) Copy() (*ESAMPubKey, error)
func (*ESAMPubKey) Equal ¶
func (key *ESAMPubKey) Equal(keyTwo *ESAMPubKey) bool
func (*ESAMPubKey) EqualConstantTime ¶
func (key *ESAMPubKey) EqualConstantTime(keyTwo *ESAMPubKey) bool
func (*ESAMPubKey) Len ¶
func (key *ESAMPubKey) Len() int
func (ESAMPubKey) MarshalYAML ¶
func (key ESAMPubKey) MarshalYAML() (interface{}, error)
func (*ESAMPubKey) Normalize ¶
func (key *ESAMPubKey) Normalize(toleratesEmptyFields bool) error
func (*ESAMPubKey) Template ¶
func (key *ESAMPubKey) Template() error
func (*ESAMPubKey) Test ¶
func (key *ESAMPubKey) Test(toleratesEmptyFields bool) error
func (*ESAMPubKey) UnmarshalYAML ¶
func (key *ESAMPubKey) UnmarshalYAML(value *yaml.Node) error
type Node ¶
type Node struct { ESAMPubKey ESAMPubKey `yaml:"ESAM public key" json:"esam_pub_key" db:"esam_pub_key" sqltype:"VARBINARY(6144) NOT NULL PRIMARY KEY"` Name string `yaml:"Name" json:"name" db:"name" sqltype:"CHAR(63) NOT NULL UNIQUE"` SSHAddr string `yaml:"SSH address" json:"ssh_addr" db:"ssh_addr" sqltype:"CHAR(45)"` SSHPort string `yaml:"SSH port" json:"ssh_port" db:"ssh_port" sqltype:"CHAR(5)"` }
func (*Node) FromString ¶
type NodeAuth ¶
type NodeAuth struct { Node `yaml:",inline"` TrustedData string `yaml:"Trusted data" json:"trusted_data"` }
Validated to data authenticity
func (*NodeAuth) FromString ¶
type NodeSign ¶
type NodeSign struct { ESAMPubKeySign []byte `json:"esam_pub_key_sign" db:"esam_pub_key_sign" sqltype:"VARBINARY(4096)"` NameSign []byte `json:"name_sign" db:"name_sign" sqltype:"VARBINARY(4096)"` SSHAddrSign []byte `json:"ssh_addr_sign" db:"ssh_addr_sign" sqltype:"VARBINARY(4096)"` SSHPortSign []byte `json:"ssh_port_sign" db:"ssh_port_sign" sqltype:"VARBINARY(4096)"` SignSubject ESAMPubKey `json:"sign_subject" db:"sign_subject" sqltype:"VARBINARY(6144) NOT NULL"` }
type User ¶
type User struct { ESAMPubKey ESAMPubKey `yaml:"ESAM public key" json:"esam_pub_key" db:"esam_pub_key" sqltype:"VARBINARY(6144) NOT NULL PRIMARY KEY"` Name string `yaml:"Name" json:"name" db:"name" sqltype:"CHAR(63) NOT NULL UNIQUE"` Role string `yaml:"Role" json:"role" db:"role" sqltype:"CHAR(32) NOT NULL"` State string `yaml:"State" json:"state" db:"state" sqltype:"CHAR(32) NOT NULL"` SSHPubKey string `yaml:"SSH public key" json:"ssh_pub_key" db:"ssh_pub_key" sqltype:"TEXT"` PasswordHash string `yaml:"Password hash" json:"password_hash" db:"password_hash" sqltype:"TEXT"` ElevatePrivileges bool `yaml:"Can elevate privileges" json:"elevate_privileges" db:"elevate_privileges" sqltype:"BOOLEAN"` }
func (*User) EqualWithIgnoreFields ¶
Ugly but worked and simple implementation
func (*User) FromString ¶
type UserAuth ¶
type UserAuth struct { User `yaml:",inline"` TrustedData string `yaml:"Trusted data" json:"trusted_data"` }
Validated to data authenticity
func (*UserAuth) FromString ¶
type UserSign ¶
type UserSign struct { ESAMPubKeySign []byte `json:"esam_pub_key_sign" db:"esam_pub_key_sign" sqltype:"VARBINARY(4096)"` NameSign []byte `json:"name_sign" db:"name_sign" sqltype:"VARBINARY(4096)"` RoleSign []byte `json:"role_sign" db:"role_sign" sqltype:"VARBINARY(4096)"` StateSign []byte `json:"state_sign" db:"state_sign" sqltype:"VARBINARY(4096)"` SSHPubKeySign []byte `json:"ssh_pub_key_sign" db:"ssh_pub_key_sign" sqltype:"VARBINARY(4096)"` PasswordHashSign []byte `json:"password_hash_sign" db:"password_hash_sign" sqltype:"VARBINARY(4096)"` ElevatePrivilegesSign []byte `json:"elevate_privileges_sign" db:"elevate_privileges_sign" sqltype:"VARBINARY(4096)"` SignSubject ESAMPubKey `json:"sign_subject" db:"sign_subject" sqltype:"VARBINARY(6144) NOT NULL"` }
Click to show internal directories.
Click to hide internal directories.