jc

package
v0.0.0-...-8505860 Latest Latest
Warning

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

Go to latest
Published: May 8, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const TypeGroup string = "group"
View Source
const TypeUser string = "user"

Variables

View Source
var (
	ErrEmptyResponse = errors.New("empty response")
	ErrStatusNotOK   = errors.New("status not OK")
)

Functions

This section is empty.

Types

type BaseUser

type BaseUser struct {
	IID         string `json:"_id"`
	ID          string `json:"id"`
	Type        string `json:"type"`
	DisplayName string `json:"displayname"`
	Email       string `json:"email"`
	Username    string `json:"username"`
}

type Group

type Group struct {
	ID          string      `json:"id"`
	Name        string      `json:"name"`
	Type        string      `json:"type"`
	Description string      `json:"description,omitempty"`
	Email       string      `json:"email,omitempty"`
	Attributes  interface{} `json:"attributes,omitempty"`
}

type GroupType

type GroupType int
const (
	AllGroups GroupType = iota + 1
	SystemGroups
	UserGroups
)

type JumpCloudClient

type JumpCloudClient struct {
	// contains filtered or unexported fields
}

func NewJumpCloudClient

func NewJumpCloudClient(ctx context.Context, apiKey string) (*JumpCloudClient, error)

func (*JumpCloudClient) ExpandUsersInGroup

func (c *JumpCloudClient) ExpandUsersInGroup(ctx context.Context, groupID string, idLookup map[string]*BaseUser) ([]*BaseUser, error)

func (*JumpCloudClient) GetBaseUserByID

func (c *JumpCloudClient) GetBaseUserByID(ctx context.Context, id string) (*BaseUser, error)

func (*JumpCloudClient) GetUserByEmail

func (c *JumpCloudClient) GetUserByEmail(_ context.Context, _ string) (*User, error)

func (*JumpCloudClient) GetUserByID

func (c *JumpCloudClient) GetUserByID(ctx context.Context, id string) (*User, error)

func (*JumpCloudClient) ListDirectories

func (c *JumpCloudClient) ListDirectories(ctx context.Context) ([]any, error)

func (*JumpCloudClient) ListGroups

func (c *JumpCloudClient) ListGroups(ctx context.Context, groupType GroupType) ([]*Group, error)

func (*JumpCloudClient) ListUsers

func (c *JumpCloudClient) ListUsers(ctx context.Context) ([]*User, error)

type Members

type Members []struct {
	To struct {
		Type string `json:"type"`
		ID   string `json:"id"`
	} `json:"to"`
}

type User

type User struct {
	BaseUser
	SystemUsername                string        `json:"systemUsername"`
	Activated                     bool          `json:"activated"`
	FirstName                     string        `json:"firstname"`
	MiddleName                    string        `json:"middlename"`
	LastName                      string        `json:"lastname"`
	Organization                  string        `json:"organization"`
	JobTitle                      string        `json:"jobTitle"`
	Description                   string        `json:"description"`
	AccountLocked                 bool          `json:"account_locked"`
	AccountLockedDate             interface{}   `json:"account_locked_date"`
	Addresses                     []interface{} `json:"addresses"`
	AllowPublicKey                bool          `json:"allow_public_key"`
	AlternateEmail                interface{}   `json:"alternateEmail"`
	Attributes                    []interface{} `json:"attributes"`
	Company                       string        `json:"company"`
	CostCenter                    string        `json:"costCenter"`
	Created                       time.Time     `json:"created"`
	Department                    string        `json:"department"`
	DisableDeviceMaxLoginAttempts bool          `json:"disableDeviceMaxLoginAttempts"`
	EmployeeIdentifier            interface{}   `json:"employeeIdentifier"`
	EmployeeType                  string        `json:"employeeType"`
	EnableManagedUID              bool          `json:"enable_managed_uid"`
	EnableUserPortalMultiFactor   bool          `json:"enable_user_portal_multifactor"`
	ExternalDn                    string        `json:"external_dn"`
	ExternalSourceType            string        `json:"external_source_type"`
	ExternallyManaged             bool          `json:"externally_managed"`
	LdapBindingUser               bool          `json:"ldap_binding_user"`
	Location                      string        `json:"location"`
	ManagedAppleID                string        `json:"managedAppleId"`
	Manager                       interface{}   `json:"manager"`
	Mfa                           struct {
		Configured bool `json:"configured,omitempty"`
		Exclusion  bool `json:"exclusion,omitempty"`
	} `json:"mfa,omitempty"`
	MfaEnrollment struct {
		OverallStatus  string `json:"overallStatus,omitempty"`
		PushStatus     string `json:"pushStatus,omitempty"`
		TotpStatus     string `json:"totpStatus,omitempty"`
		WebAuthnStatus string `json:"webAuthnStatus,omitempty"`
	} `json:"mfaEnrollment,omitempty"`
	PasswordDate         time.Time     `json:"password_date"`
	PasswordExpired      bool          `json:"password_expired"`
	PasswordNeverExpires bool          `json:"password_never_expires"`
	PasswordlessSudo     bool          `json:"passwordless_sudo"`
	PhoneNumbers         []interface{} `json:"phoneNumbers"`
	RestrictedFields     []interface{} `json:"restrictedFields,omitempty"`
	SambaServiceUser     bool          `json:"samba_service_user"`
	SSHKeys              []interface{} `json:"ssh_keys"`
	State                string        `json:"state"`
	Sudo                 bool          `json:"sudo"`
	Suspended            bool          `json:"suspended"`
	TotpEnabled          bool          `json:"totp_enabled"`
	UnixGUID             int           `json:"unix_guid"`
	UnixUID              int           `json:"unix_uid"`
}

Jump to

Keyboard shortcuts

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