user

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	Name string
}

Group holds a user group metadata

func (*Group) Ensure

func (g *Group) Ensure() error

Ensure a group is configured in the system

func (*Group) EnsureUser

func (g *Group) EnsureUser(user *User) error

EnsureUser ensures an user is member of a system group

func (*Group) RemoveUser

func (g *Group) RemoveUser(user *User) error

RemoveUser removes an user from the group

type IAM

type IAM interface {
	GetGroup(input *iam.GetGroupInput) (*iam.GetGroupOutput, error)
	GetSSHPublicKey(input *iam.GetSSHPublicKeyInput) (*iam.GetSSHPublicKeyOutput, error)
	ListGroupsForUser(input *iam.ListGroupsForUserInput) (*iam.ListGroupsForUserOutput, error)
	ListSSHPublicKeys(input *iam.ListSSHPublicKeysInput) (*iam.ListSSHPublicKeysOutput, error)
}

IAM interface holds required method signatures of IAM for easier test mocking

type User

type User struct {
	Groups   []*Group
	Username string
}

User represents a mirrored user between AWS IAM and the local system

func (*User) Ensure

func (u *User) Ensure(sandboxed bool, additionalGroups []string) error

Ensure ensure a user is correctly configured on the system

func (User) HomeDir added in v0.2.0

func (u User) HomeDir() string

HomeDir returns the user's home directory

func (*User) Remove

func (u *User) Remove() error

Remove removes an user from the system

func (User) Uid added in v0.2.0

func (u User) Uid() uint16

Uid returns the user unique id

type Users

type Users []*User

Users holds a collection of User

func FromIAMGroups

func FromIAMGroups(svc IAM, groups ...*Group) (Users, error)

FromIAMGroups returns a single Users collection for the given AWS IAM groups

func FromSystemGroups

func FromSystemGroups(groups ...*Group) (Users, error)

FromSystemGroups returns a single Users collection for the given system groups

func (Users) Diff

func (self Users) Diff(users Users) Users

Diff returns the difference between self and another Users collection

Jump to

Keyboard shortcuts

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