iam

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 GetUserNameByID

func GetUserNameByID(ac *client.AlpaconClient, userID string) (string, 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)

Types

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 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 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