identity

package
v0.3.10-0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0, Apache-2.0 Imports: 19 Imported by: 42

Documentation

Index

Constants

View Source
const (
	DEFAULT_PROJECT = api.DEFAULT_PROJECT

	ACCESS_SECRET_TYPE    = api.ACCESS_SECRET_TYPE
	TOTP_TYPE             = api.TOTP_TYPE
	RECOVERY_SECRETS_TYPE = api.RECOVERY_SECRETS_TYPE
	OIDC_CREDENTIAL_TYPE  = api.OIDC_CREDENTIAL_TYPE
	ENCRYPT_KEY_TYPE      = api.ENCRYPT_KEY_TYPE
)

Variables

View Source
var (
	Users   UserManager
	UsersV3 UserManagerV3
)
View Source
var (
	ServiceCertificatesV3 modulebase.ResourceManager
)

Functions

This section is empty.

Types

type DomainManager

type DomainManager struct {
	modulebase.ResourceManager
}
var (
	Domains DomainManager
)

type GroupManager

type GroupManager struct {
	modulebase.ResourceManager
}
var (
	Groups GroupManager
)

func (*GroupManager) GetProjects

func (this *GroupManager) GetProjects(session *mcclient.ClientSession, uid string) (*modulebase.ListResult, error)

func (*GroupManager) GetUsers

type IdentityProviderManager

type IdentityProviderManager struct {
	modulebase.ResourceManager
}
var (
	IdentityProviders IdentityProviderManager
)

type ProjectManagerV3

type ProjectManagerV3 struct {
	modulebase.ResourceManager
}
var (
	Projects ProjectManagerV3
)

func (*ProjectManagerV3) AddTags

func (this *ProjectManagerV3) AddTags(session *mcclient.ClientSession, id string, tags []string) error

func (*ProjectManagerV3) DoCreateProject

create project and attach users & roles

func (*ProjectManagerV3) DoJoinProject

Add one user to Many Projects

func (*ProjectManagerV3) DoLeaveProject

func (*ProjectManagerV3) DoProjectBatchDeleteUserGroup

func (this *ProjectManagerV3) DoProjectBatchDeleteUserGroup(s *mcclient.ClientSession, pid string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

Remove Many user[uids] to project(pid) with role(rid)

func (*ProjectManagerV3) DoProjectBatchJoin

func (this *ProjectManagerV3) DoProjectBatchJoin(s *mcclient.ClientSession, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

Add Many user[uids] to project(pid) with role(rid)

func (*ProjectManagerV3) FetchId

func (this *ProjectManagerV3) FetchId(s *mcclient.ClientSession, project string, domain string) (string, error)

func (*ProjectManagerV3) JoinProject

func (this *ProjectManagerV3) JoinProject(s *mcclient.ClientSession, rid, pid, uid string) error

type RegionManager

type RegionManager struct {
	modulebase.ResourceManager
}
var (
	Regions RegionManager
)

type RoleAssignmentManagerV3

type RoleAssignmentManagerV3 struct {
	modulebase.ResourceManager
}
var (
	RoleAssignments RoleAssignmentManagerV3
)

func (*RoleAssignmentManagerV3) GetProjectRole

get projects-roles for given resource, like domain, project, user, group, role

func (*RoleAssignmentManagerV3) GetProjectUsers

get users for given project

type RolesManager

type RolesManager struct {
	modulebase.ResourceManager
}
var (
	Roles   RolesManager
	RolesV3 RolesManager
)

func (*RolesManager) BatchDelete

func (this *RolesManager) BatchDelete(session *mcclient.ClientSession, idlist []string, body jsonutils.JSONObject) []modulebase.SubmitResult

func (*RolesManager) BatchDeleteInContexts

func (this *RolesManager) BatchDeleteInContexts(session *mcclient.ClientSession, idlist []string, body jsonutils.JSONObject, ctxs []modulebase.ManagerContext) []modulebase.SubmitResult

func (*RolesManager) Delete

func (*RolesManager) DeleteInContexts

func (this *RolesManager) DeleteInContexts(session *mcclient.ClientSession, id string, body jsonutils.JSONObject, ctxs []modulebase.ManagerContext) (jsonutils.JSONObject, error)

type SAccessKeySecret

type SAccessKeySecret struct {
	KeyId     string    `json:"-"`
	ProjectId string    `json:"-"`
	TimeStamp time.Time `json:"-"`
	api.SAccessKeySecretBlob
}

func DecodeAccessKeySecret

func DecodeAccessKeySecret(secret jsonutils.JSONObject) (SAccessKeySecret, error)

type SCredentialManager

type SCredentialManager struct {
	modulebase.ResourceManager
}
var (
	Credentials SCredentialManager
)

func (*SCredentialManager) CreateAccessKeySecret

func (manager *SCredentialManager) CreateAccessKeySecret(s *mcclient.ClientSession, uid string, pid string, expireAt time.Time) (SAccessKeySecret, error)

func (*SCredentialManager) CreateEncryptKey

func (manager *SCredentialManager) CreateEncryptKey(s *mcclient.ClientSession, uid string, name string, algName string) (SEncryptKeySecret, error)

func (*SCredentialManager) CreateOIDCSecret

func (manager *SCredentialManager) CreateOIDCSecret(s *mcclient.ClientSession, uid string, pid string, redirectUri string) (SOpenIDConnectCredential, error)

func (*SCredentialManager) CreateTotpSecret

func (manager *SCredentialManager) CreateTotpSecret(s *mcclient.ClientSession, uid string) (string, error)

func (*SCredentialManager) DoCreateAccessKeySecret

func (manager *SCredentialManager) DoCreateAccessKeySecret(s *mcclient.ClientSession, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SCredentialManager) DoCreateEncryptKey

func (manager *SCredentialManager) DoCreateEncryptKey(s *mcclient.ClientSession, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SCredentialManager) DoCreateOidcSecret

func (manager *SCredentialManager) DoCreateOidcSecret(s *mcclient.ClientSession, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SCredentialManager) EncryptKeyDecrypt

func (manager *SCredentialManager) EncryptKeyDecrypt(s *mcclient.ClientSession, keyId string, secret []byte) ([]byte, error)

func (*SCredentialManager) EncryptKeyDecryptBase64

func (manager *SCredentialManager) EncryptKeyDecryptBase64(s *mcclient.ClientSession, keyId string, secret string) ([]byte, error)

func (*SCredentialManager) EncryptKeyEncrypt

func (manager *SCredentialManager) EncryptKeyEncrypt(s *mcclient.ClientSession, keyId string, secret []byte) ([]byte, error)

func (*SCredentialManager) EncryptKeyEncryptBase64

func (manager *SCredentialManager) EncryptKeyEncryptBase64(s *mcclient.ClientSession, keyId string, secret []byte) (string, error)

func (*SCredentialManager) FetchAccessKeySecrets

func (manager *SCredentialManager) FetchAccessKeySecrets(s *mcclient.ClientSession, uid string, pid string) ([]jsonutils.JSONObject, error)

func (*SCredentialManager) FetchEncryptionKeys

func (manager *SCredentialManager) FetchEncryptionKeys(s *mcclient.ClientSession, uid string) ([]jsonutils.JSONObject, error)

func (*SCredentialManager) FetchOIDCSecrets

func (manager *SCredentialManager) FetchOIDCSecrets(s *mcclient.ClientSession, uid string, pid string) ([]jsonutils.JSONObject, error)

func (*SCredentialManager) FetchRecoverySecrets

func (manager *SCredentialManager) FetchRecoverySecrets(s *mcclient.ClientSession, uid string) ([]jsonutils.JSONObject, error)

func (*SCredentialManager) FetchTotpSecrets

func (manager *SCredentialManager) FetchTotpSecrets(s *mcclient.ClientSession, uid string) ([]jsonutils.JSONObject, error)

func (*SCredentialManager) GetAccessKeySecrets

func (manager *SCredentialManager) GetAccessKeySecrets(s *mcclient.ClientSession, uid string, pid string) ([]SAccessKeySecret, error)

func (*SCredentialManager) GetEncryptKey

func (manager *SCredentialManager) GetEncryptKey(s *mcclient.ClientSession, kid string) (SEncryptKeySecret, error)

func (*SCredentialManager) GetEncryptKeys

func (manager *SCredentialManager) GetEncryptKeys(s *mcclient.ClientSession, uid string) ([]SEncryptKeySecret, error)

func (*SCredentialManager) GetEncryptKeysRpc

func (manager *SCredentialManager) GetEncryptKeysRpc(s *mcclient.ClientSession, params jsonutils.JSONObject) (jsonutils.
	JSONObject, error)

func (*SCredentialManager) GetOIDCSecret

func (manager *SCredentialManager) GetOIDCSecret(s *mcclient.ClientSession, uid string, pid string) ([]SOpenIDConnectCredential, error)

func (*SCredentialManager) GetRecoverySecrets

func (manager *SCredentialManager) GetRecoverySecrets(s *mcclient.ClientSession, uid string) ([]SRecoverySecret, error)

func (*SCredentialManager) GetTotpSecret

func (manager *SCredentialManager) GetTotpSecret(s *mcclient.ClientSession, uid string) (string, error)

func (*SCredentialManager) RemoveAccessKeySecrets

func (manager *SCredentialManager) RemoveAccessKeySecrets(s *mcclient.ClientSession, uid string, pid string) error

func (*SCredentialManager) RemoveEncryptKeys

func (manager *SCredentialManager) RemoveEncryptKeys(s *mcclient.ClientSession, uid string) error

func (*SCredentialManager) RemoveOIDCSecrets

func (manager *SCredentialManager) RemoveOIDCSecrets(s *mcclient.ClientSession, uid string, pid string) error

func (*SCredentialManager) RemoveRecoverySecrets

func (manager *SCredentialManager) RemoveRecoverySecrets(s *mcclient.ClientSession, uid string) error

func (*SCredentialManager) RemoveTotpSecrets

func (manager *SCredentialManager) RemoveTotpSecrets(s *mcclient.ClientSession, uid string) error

func (*SCredentialManager) SaveRecoverySecrets

func (manager *SCredentialManager) SaveRecoverySecrets(s *mcclient.ClientSession, uid string, questions []SRecoverySecret) error

type SEncryptKeySecret

type SEncryptKeySecret struct {
	KeyId     string             `json:"-"`
	KeyName   string             `json:"-"`
	Alg       seclib2.TSymEncAlg `json:"alg"`
	Key       string             `json:"key"`
	TimeStamp time.Time          `json:"-"`
	UserId    string             `json:"user_id"`
	User      string             `json:"user"`
	Domain    string             `json:"domain"`
	DomainId  string             `json:"domain_id"`
}

func DecodeEncryptKey

func DecodeEncryptKey(secret jsonutils.JSONObject) (SEncryptKeySecret, error)

func (SEncryptKeySecret) Decrypt

func (key SEncryptKeySecret) Decrypt(secret []byte) ([]byte, error)

func (SEncryptKeySecret) DecryptBase64

func (key SEncryptKeySecret) DecryptBase64(secret string) ([]byte, error)

func (SEncryptKeySecret) Encrypt

func (key SEncryptKeySecret) Encrypt(secret []byte) ([]byte, error)

func (SEncryptKeySecret) EncryptBase64

func (key SEncryptKeySecret) EncryptBase64(secret []byte) (string, error)

func (SEncryptKeySecret) Marshal

func (key SEncryptKeySecret) Marshal() jsonutils.JSONObject

type SIdentityUsageManager

type SIdentityUsageManager struct {
	modulebase.ResourceManager
}
var (
	IdentityUsages SIdentityUsageManager
)

func (*SIdentityUsageManager) GetUsage

type SOpenIDConnectCredential

type SOpenIDConnectCredential struct {
	ClientId string `json:"client_id"`
	// Secret      string `json:"secret"`
	RedirectUri string `json:"redirect_uri"`
	api.SAccessKeySecretBlob
}

func DecodeOIDCSecret

func DecodeOIDCSecret(secret jsonutils.JSONObject) (SOpenIDConnectCredential, error)

type SPolicyManager

type SPolicyManager struct {
	modulebase.ResourceManager
}
var Policies SPolicyManager

type SRecoverySecret

type SRecoverySecret struct {
	Question string `json:"question"`
	Answer   string `json:"answer"`
}

type SRecoverySecretSet

type SRecoverySecretSet struct {
	Questions []SRecoverySecret
	Timestamp int64
}

type SRolePolicyManager

type SRolePolicyManager struct {
	modulebase.ResourceManager
}
var RolePolicies SRolePolicyManager

func (*SRolePolicyManager) FetchMatchedPolicies

func (manager *SRolePolicyManager) FetchMatchedPolicies(s *mcclient.ClientSession, roleIds []string, projectId string, loginIp string) (map[string][]string, error)

type STotpSecret

type STotpSecret struct {
	Totp      string `json:"totp"`
	Timestamp int64  `json:"timestamp"`
}

type ScopeResourceManager

type ScopeResourceManager struct {
	modulebase.ResourceManager
}
var (
	ScopeResource ScopeResourceManager
)

type UserManager

type UserManager struct {
	modulebase.ResourceManager
}

func (*UserManager) GetTenantRoleList

func (this *UserManager) GetTenantRoleList(session *mcclient.ClientSession, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*UserManager) GetTenantRoles

func (this *UserManager) GetTenantRoles(session *mcclient.ClientSession, uid string, tenantId string) (*modulebase.ListResult, error)

type UserManagerV3

type UserManagerV3 struct {
	modulebase.ResourceManager
}

func (*UserManagerV3) DoCreateUser

create user && assgin user with project_domain、project、role

func (*UserManagerV3) DoJoinGroups

func (this *UserManagerV3) DoJoinGroups(s *mcclient.ClientSession, uid string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*UserManagerV3) FetchId

func (this *UserManagerV3) FetchId(s *mcclient.ClientSession, user string, domain string) (string, error)

func (*UserManagerV3) GetGroups

func (this *UserManagerV3) GetGroups(session *mcclient.ClientSession, uid string) (*modulebase.ListResult, error)

func (*UserManagerV3) GetProjects

func (this *UserManagerV3) GetProjects(session *mcclient.ClientSession, uid string) (*modulebase.ListResult, error)

func (*UserManagerV3) GetProjectsRPC

func (this *UserManagerV3) GetProjectsRPC(s *mcclient.ClientSession, uid string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

Jump to

Keyboard shortcuts

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