iam

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const UsernameSetSuccessFmt = "Username set to %q"

UsernameSetSuccessFmt is the confirmation format shown after a username is set.

Variables

This section is empty.

Functions

func AddMember

func AddMember(ac *client.AlpaconClient, memberRequest MemberAddRequest) error

func CreateGroup

func CreateGroup(ac *client.AlpaconClient, groupRequest GroupCreateRequest) error

func CreateUser

func CreateUser(ac *client.AlpaconClient, userRequest UserCreateRequest) error

func DeleteGroup

func DeleteGroup(ac *client.AlpaconClient, groupName string) error

func DeleteMember

func DeleteMember(ac *client.AlpaconClient, memberDeleteRequest MemberDeleteRequest) error

func DeleteUser

func DeleteUser(ac *client.AlpaconClient, userName string) error

func GetGroupDetail

func GetGroupDetail(ac *client.AlpaconClient, groupId string) ([]byte, error)

func GetGroupIDByName

func GetGroupIDByName(ac *client.AlpaconClient, groupName string) (string, error)

func GetUserDetail

func GetUserDetail(ac *client.AlpaconClient, userId string) ([]byte, error)

func GetUserIDByName

func GetUserIDByName(ac *client.AlpaconClient, userName string) (string, error)

func InviteUser added in v1.4.2

func InviteUser(ac *client.AlpaconClient, request UserInviteRequest) error

func UpdateGroup added in v1.2.0

func UpdateGroup(ac *client.AlpaconClient, groupName string) ([]byte, error)

func UpdateUser

func UpdateUser(ac *client.AlpaconClient, userName string) ([]byte, error)

func UsernameErrorMessage added in v1.8.0

func UsernameErrorMessage(code string) (string, bool)

UsernameErrorMessage maps a server username error code to a human-readable message; ok is false for unrecognized codes.

Types

type CurrentUserResponse added in v1.4.2

type CurrentUserResponse struct {
	ID            string `json:"id"`
	Username      string `json:"username"`
	Email         string `json:"email"`
	Phone         string `json:"phone"`
	UID           int    `json:"uid"`
	Shell         string `json:"shell"`
	HomeDirectory string `json:"home_directory"`
	IsStaff       bool   `json:"is_staff"`
	IsSuperuser   bool   `json:"is_superuser"`
}

func GetCurrentUser added in v1.4.2

func GetCurrentUser(ac *client.AlpaconClient) (*CurrentUserResponse, error)

type GroupAttributes

type GroupAttributes struct {
	Name        string `json:"name"`
	DisplayName string `json:"display_name" table:"Display Name"`
	Tags        string `json:"tags"`
	Members     int    `json:"members"`
	Servers     int    `json:"servers"`
	GID         int    `json:"gid" table:"GID"`
	LDAPStatus  string `json:"ldap_status" table:"LDAP"`
}

func GetGroupList

func GetGroupList(ac *client.AlpaconClient) ([]GroupAttributes, error)

type GroupCreateRequest

type GroupCreateRequest struct {
	Name        string   `json:"name"`
	DisplayName string   `json:"display_name"`
	Tags        string   `json:"tags"`
	Description string   `json:"description"`
	IsLdapGroup bool     `json:"is_ldap_group"`
	Servers     []string `json:"servers"`
}

type GroupMembership added in v1.4.2

type GroupMembership struct {
	Name string `json:"name"`
	Role string `json:"role"`
}

func GetUserMemberships added in v1.4.2

func GetUserMemberships(ac *client.AlpaconClient, userID string) ([]GroupMembership, error)

type GroupResponse

type GroupResponse struct {
	ID           string                `json:"id"`
	Name         string                `json:"name"`
	DisplayName  string                `json:"display_name"`
	Description  string                `json:"description"`
	Tags         string                `json:"tags"`
	NumMembers   int                   `json:"num_members"`
	MembersNames []string              `json:"members_names"`
	GID          int                   `json:"gid"`
	IsLDAPGroup  bool                  `json:"is_ldap_group"`
	Servers      []types.ServerSummary `json:"servers"`
	AddedAt      time.Time             `json:"added_at"`
	UpdatedAt    time.Time             `json:"updated_at"`
}

type MemberAddRequest

type MemberAddRequest struct {
	Group string `json:"group"`
	User  string `json:"user"`
	Role  string `json:"role"`
}

type MemberDeleteRequest

type MemberDeleteRequest struct {
	Group string `json:"group"`
	User  string `json:"user"`
}

type MemberDetailResponse

type MemberDetailResponse struct {
	ID        string            `json:"id"`
	Group     string            `json:"group"`
	GroupName string            `json:"group_name"`
	User      types.UserSummary `json:"user"`
	Role      string            `json:"role"`
}

type SetUsernameRequest added in v1.0.0

type SetUsernameRequest struct {
	Username string `json:"username"`
}

type SetUsernameResponse added in v1.0.0

type SetUsernameResponse struct {
	ID       string `json:"id"`
	Username string `json:"username"`
}

func HandleUsernameRequired added in v1.0.0

func HandleUsernameRequired() (*SetUsernameResponse, error)

func SetUsername added in v1.0.0

func SetUsername(username string) (*SetUsernameResponse, error)

type UserAttributes

type UserAttributes struct {
	Username   string `json:"username"`
	Name       string `json:"name"`
	Email      string `json:"email"`
	Tags       string `json:"tags"`
	Groups     int    `json:"groups"`
	UID        int    `json:"uid" table:"UID"`
	Status     string `json:"status"`
	LDAPStatus string `json:"ldap_status" table:"LDAP"`
}

func GetUserList

func GetUserList(ac *client.AlpaconClient) ([]UserAttributes, error)

type UserCreateRequest

type UserCreateRequest struct {
	Username    string `json:"username"`
	Password    string `json:"password"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
	Email       string `json:"email"`
	Phone       string `json:"phone"`
	Tags        string `json:"tags"`
	Description string `json:"description"`
	Shell       string `json:"shell"`
	IsActive    bool   `json:"is_active"`
	IsStaff     bool   `json:"is_staff"`
	IsSuperuser bool   `json:"is_superuser"`
	IsLdapUser  bool   `json:"is_ldap_user"`
}

type UserDetailAttributes

type UserDetailAttributes struct {
	Username      string   `json:"username"`
	Name          string   `json:"name"`
	Description   string   `json:"description"`
	Email         string   `json:"email"`
	Phone         string   `json:"phone"`
	UID           int      `json:"uid"`
	Shell         string   `json:"shell"`
	HomeDirectory string   `json:"home_directory"`
	NumGroups     int      `json:"num_groups"`
	Groups        []string `json:"groups"`
	Tags          string   `json:"tags"`
	Status        string   `json:"status"`
	LDAPStatus    string   `json:"ldap_status"`
}

type UserInviteRequest added in v1.4.2

type UserInviteRequest struct {
	Email string `json:"email"`
}

type UserResponse

type UserResponse struct {
	ID          string    `json:"id"`
	Username    string    `json:"username"`
	FirstName   string    `json:"first_name"`
	LastName    string    `json:"last_name"`
	Email       string    `json:"email"`
	Phone       string    `json:"phone"`
	Tags        string    `json:"tags"`
	NumGroups   int       `json:"num_groups"`
	UID         int       `json:"uid"`
	IsActive    bool      `json:"is_active"`
	IsStaff     bool      `json:"is_staff"`
	IsSuperuser bool      `json:"is_superuser"`
	IsLDAPUser  bool      `json:"is_ldap_user"`
	DateJoined  time.Time `json:"date_joined"`
}

Jump to

Keyboard shortcuts

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