sshcert

package module
v0.0.0-...-8df540d Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultUserCertExtUIDKey              = "uid@swoossh.com"
	DefaultUserCertExtPrimaryGroupKey     = "primary_group@swoossh.com"
	DefaultUserCertExtSecondaryGroupsKey  = "secondary_groups@swoossh.com"
	DefaultUserCertExtSudoClaimsKey       = "sudo_claims@swoossh.com"
	DefaultUserCertExtLatestPasswdHashKey = "passwd_hash@swoossh.com"
)

Functions

func DefaultCertPosixAccountGetGroupsClaim

func DefaultCertPosixAccountGetGroupsClaim(cert *ssh.Certificate, secondaryGroupsKey string) ([]*group.DefaultPosixGroup, error)

func DefaultCertPosixAccountGetLatestPasswdHash

func DefaultCertPosixAccountGetLatestPasswdHash(cert *ssh.Certificate, latestPasswdHashKey string) (string, error)

func DefaultCertPosixAccountGetPrimaryGroupClaim

func DefaultCertPosixAccountGetPrimaryGroupClaim(cert *ssh.Certificate, primaryGroupKey string) (*group.DefaultPosixGroup, error)

func DefaultCertPosixAccountGetPrincipalName

func DefaultCertPosixAccountGetPrincipalName(cert *ssh.Certificate) string

func DefaultCertPosixAccountGetSUDOClaims

func DefaultCertPosixAccountGetSUDOClaims(cert *ssh.Certificate, sudoClaimsKey string) ([]string, error)

func DefaultCertPosixAccountGetUIDClaim

func DefaultCertPosixAccountGetUIDClaim(cert *ssh.Certificate, uidKey string) (uint32, error)

func DefaultCertPosixAccountSetGroupsClaim

func DefaultCertPosixAccountSetGroupsClaim(cert *ssh.Certificate, secGrps []*group.DefaultPosixGroup, secondaryGroupsKey string) error

func DefaultCertPosixAccountSetLatestPasswdHash

func DefaultCertPosixAccountSetLatestPasswdHash(cert *ssh.Certificate, latestPasswdHash string, latestPasswdHashKey string) error

func DefaultCertPosixAccountSetPrimaryGroupClaim

func DefaultCertPosixAccountSetPrimaryGroupClaim(cert *ssh.Certificate, grp *group.DefaultPosixGroup, primaryGroupKey string) error

func DefaultCertPosixAccountSetPrincipalName

func DefaultCertPosixAccountSetPrincipalName(cert *ssh.Certificate, principalName string) error

func DefaultCertPosixAccountSetSUDOClaims

func DefaultCertPosixAccountSetSUDOClaims(cert *ssh.Certificate, sudoClaims []string, sudoClaimsKey string) error

func DefaultCertPosixAccountSetUIDClaim

func DefaultCertPosixAccountSetUIDClaim(cert *ssh.Certificate, uid uint32, uidKey string) error

func UnmarshalCert

func UnmarshalCert(certType string, base64Cert string) (*ssh.Certificate, error)

Types

type Cert

type Cert interface {
	GetPrincipalName() (string, error)
	SetPrincipalName(string) error
}

type CertPosixAccount

type CertPosixAccount interface {
	Cert
	GetUIDClaim() (uint32, error)
	SetUIDClaim(uint32) error
	GetPrimaryGroupClaim() (group.PosixGroup, error)
	SetPrimaryGroupClaim(group.PosixGroup) error
}

type DefaultCertPosixAccount

type DefaultCertPosixAccount struct {
	Cert                *ssh.Certificate
	UIDKey              string
	PrimaryGroupKey     string
	SecondaryGroupsKey  string
	SudoClaimsKey       string
	LatestPasswdHashKey string
}

func NewDefaultCertPosixAccount

func NewDefaultCertPosixAccount(certType, base64Cert, uidKey, primaryGroupKey,
	secondaryGroupsKey, sudoClaimsKey, latestPasswdHashKey string) (DefaultCertPosixAccount, error)

func (*DefaultCertPosixAccount) GetGroupsClaim

func (c *DefaultCertPosixAccount) GetGroupsClaim() ([]group.PosixGroup, error)

func (*DefaultCertPosixAccount) GetLatestPasswdHash

func (c *DefaultCertPosixAccount) GetLatestPasswdHash() (string, error)

func (*DefaultCertPosixAccount) GetPrimaryGroupClaim

func (c *DefaultCertPosixAccount) GetPrimaryGroupClaim() (group.PosixGroup, error)

func (*DefaultCertPosixAccount) GetPrincipalName

func (c *DefaultCertPosixAccount) GetPrincipalName() (string, error)

func (*DefaultCertPosixAccount) GetSUDOClaims

func (c *DefaultCertPosixAccount) GetSUDOClaims() ([]string, error)

func (*DefaultCertPosixAccount) GetUIDClaim

func (c *DefaultCertPosixAccount) GetUIDClaim() (uint32, error)

func (*DefaultCertPosixAccount) SetGroupsClaim

func (c *DefaultCertPosixAccount) SetGroupsClaim(secGrps []group.PosixGroup) error

func (*DefaultCertPosixAccount) SetLatestPasswdHash

func (c *DefaultCertPosixAccount) SetLatestPasswdHash(latestPasswdHash string) error

func (*DefaultCertPosixAccount) SetPrimaryGroupClaim

func (c *DefaultCertPosixAccount) SetPrimaryGroupClaim(grp group.PosixGroup) error

func (*DefaultCertPosixAccount) SetPrincipalName

func (c *DefaultCertPosixAccount) SetPrincipalName(principalName string) error

func (*DefaultCertPosixAccount) SetSUDOClaims

func (c *DefaultCertPosixAccount) SetSUDOClaims(sudoClaims []string) error

func (*DefaultCertPosixAccount) SetUIDClaim

func (c *DefaultCertPosixAccount) SetUIDClaim(uid uint32) error

type GetLatestPasswdHash

type GetLatestPasswdHash interface {
	GetLatestPasswdHash() (string, error)
	SetLatestPasswdHash(string) error
}

type GetPosixGroupsClaim

type GetPosixGroupsClaim interface {
	GetGroupsClaim() ([]group.PosixGroup, error)
	SetGroupsClaim([]group.PosixGroup) error
}

type GetSUDOClaim

type GetSUDOClaim interface {
	GetSUDOClaims() ([]string, error)
	SetSUDOClaims([]string) error
}

Jump to

Keyboard shortcuts

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