iamv1

package
v0.0.0-...-9e96525 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 37

Documentation

Index

Constants

View Source
const ErrCodeAPICreation = "APICreationError"

ErrCodeAPICreation ...

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeyEntity

type APIKeyEntity struct {
	Name         string `json:"name"`
	Description  string `json:"description"`
	BoundTo      string `json:"boundTo"`
	Format       string `json:"format"`
	APIKey       string `json:"apiKey"`
	APIKeyID     string `json:"apiKeyId"`
	APIKeySecret string `json:"apiKeySecret"`
}

type APIKeyMetadata

type APIKeyMetadata struct {
	UUID       string `json:"uuid"`
	Version    string `json:"version"`
	Crn        string `json:"crn"`
	CreatedAt  string `json:"createdAt"`
	ModifiedAt string `json:"modifiedAt"`
}

type APIKeyRepository

type APIKeyRepository interface {
	Get(uuid string) (*models.APIKey, error)
	List(boundTo string) ([]models.APIKey, error)
	FindByName(name string, boundTo string) ([]models.APIKey, error)
	Create(key models.APIKey) (*models.APIKey, error)
	Delete(uuid string) error
	Update(uuid string, version string, key models.APIKey) (*models.APIKey, error)
}

func NewAPIKeyRepository

func NewAPIKeyRepository(c *client.Client) APIKeyRepository

type APIKeyResource

type APIKeyResource struct {
	Metadata APIKeyMetadata `json:"metadata"`
	Entity   APIKeyEntity   `json:"entity"`
}

func (APIKeyResource) ToModel

func (r APIKeyResource) ToModel() models.APIKey

type AccountInfo

type AccountInfo struct {
	Bss string `json:"bss"`
	Ims string `json:"ims"`
}

type IAMMetadata

type IAMMetadata struct {
	UUID       string `json:"uuid"`
	IAMID      string `json:"iam_id"`
	Version    string `json:"version"`
	CRN        string `json:"crn"`
	CreatedAt  string `json:"createdAt"`
	ModifiedAt string `json:"modifiedAt"`
}

type IAMPaginatedResourcesHandler

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

func NewIAMPaginatedResources

func NewIAMPaginatedResources(resource interface{}) IAMPaginatedResourcesHandler

func (IAMPaginatedResourcesHandler) Resources

func (pr IAMPaginatedResourcesHandler) Resources(bytes []byte, curPath string) ([]interface{}, string, error)

type IAMResponseContext

type IAMResponseContext struct {
	RequestID   string `json:"requestId"`
	RequestType string `json:"requestType"`
	UserAgent   string `json:"userAgent"`
	ClientIP    string `json:"clientIp"`
	InstanceID  string `json:"instanceId"`
	ThreadID    string `json:"threadId"`
	Host        string `json:"host"`
	StartTime   string `json:"startTime"`
	EndTime     string `json:"endTime"`
	ElapsedTime string `json:"elapsedTime"`
	Locale      string `json:"locale"`
}

type IAMServiceAPI

type IAMServiceAPI interface {
	ServiceRoles() ServiceRoleRepository
	ServiceIds() ServiceIDRepository
	APIKeys() APIKeyRepository
	ServicePolicies() ServicePolicyRepository
	UserPolicies() UserPolicyRepository
	Identity() Identity
}

IAMServiceAPI is the resource client ...

func New

func New(sess *session.Session) (IAMServiceAPI, error)

New ...

type Identity

type Identity interface {
	UserInfo() (*UserInfo, error)
}

func NewIdentity

func NewIdentity(c *client.Client) Identity

type PoliciesQueryResult

type PoliciesQueryResult struct {
	Policies []models.Policy `json:"policies"`
}

type ServiceIDEntity

type ServiceIDEntity struct {
	BoundTo     string `json:"boundTo"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type ServiceIDRepository

type ServiceIDRepository interface {
	Get(uuid string) (models.ServiceID, error)
	List(boundTo string) ([]models.ServiceID, error)
	FindByName(boundTo string, name string) ([]models.ServiceID, error)
	Create(serviceId models.ServiceID) (models.ServiceID, error)
	Update(uuid string, serviceId models.ServiceID, version string) (models.ServiceID, error)
	Delete(uuid string) error
}

func NewServiceIDRepository

func NewServiceIDRepository(c *client.Client) ServiceIDRepository

type ServiceIDResource

type ServiceIDResource struct {
	Metadata IAMMetadata     `json:"metadata"`
	Entity   ServiceIDEntity `json:"entity"`
}

func (*ServiceIDResource) ToModel

func (r *ServiceIDResource) ToModel() models.ServiceID

type ServiceIDResponse

type ServiceIDResponse struct {
	IAMResponseContext
	ServiceIDResource
}

type ServiceIDSearchResults

type ServiceIDSearchResults struct {
	Context    IAMResponseContext  `json:"context"`
	ServiceIDs []ServiceIDResource `json:"items"`
}

type ServicePolicyIdentifier

type ServicePolicyIdentifier struct {
	Scope    string
	IAMID    string
	PolicyID string
}

identifier to specify the exact service policy following hierarchy "scope/service ID/policy ID"

type ServicePolicyQueryResult

type ServicePolicyQueryResult struct {
	Policies []models.Policy `json:"policies"`
}

type ServicePolicyRepository

type ServicePolicyRepository interface {
	List(scope string, serviceID string) ([]models.Policy, error)
	Get(scope string, serviceID string, policyID string) (models.Policy, error)
	Create(scope string, serviceID string, policy models.Policy) (models.Policy, error)
	Update(identifier ServicePolicyIdentifier, policy models.Policy, version string) (models.Policy, error)
	Delete(identifier ServicePolicyIdentifier) error
}

func NewServicePolicyRepository

func NewServicePolicyRepository(c *client.Client) ServicePolicyRepository

type ServiceRoleRepository

type ServiceRoleRepository interface {
	// List all roles of a given service, including those supported system defined roles
	ListServiceRoles(serviceName string) ([]models.PolicyRole, error)
	// List all system defined roles
	ListSystemDefinedRoles() ([]models.PolicyRole, error)
	// List servie specific roles
	ListServiceSpecificRoles(serviceName string) ([]models.PolicyRole, error)
	// List authorization roles
	ListAuthorizationRoles(sourceServiceName string, targetServiceName string) ([]models.PolicyRole, error)
}

func NewServiceRoleRepository

func NewServiceRoleRepository(c *client.Client) ServiceRoleRepository

type UserInfo

type UserInfo struct {
	Active     bool        `json:"active"`
	RealmID    string      `json:"realmId"`
	Identifier string      `json:"identifier"`
	IamID      string      `json:"iam_id"`
	GivenName  string      `json:"given_name"`
	FamilyName string      `json:"family_name"`
	Name       string      `json:"name"`
	Email      string      `json:"email"`
	Sub        string      `json:"sub"`
	Account    AccountInfo `json:"account"`
	Iat        int         `json:"iat"`
	Exp        int         `json:"exp"`
	Iss        string      `json:"iss"`
	GrantType  string      `json:"grant_type"`
	ClientID   string      `json:"client_id"`
	Scope      string      `json:"scope"`
	Acr        int         `json:"acr"`
	Amr        []string    `json:"amr"`
}

type UserPolicyRepository

type UserPolicyRepository interface {
	List(scope string, ibmUniqueID string) ([]models.Policy, error)
	Get(scope string, ibmUniqueID string, policyID string) (models.Policy, error)
	Create(scope string, ibmUniqueID string, policy models.Policy) (models.Policy, error)
	Update(scope string, ibmUniqueID string, policyID string, policy models.Policy, version string) (models.Policy, error)
	Delete(scope string, ibmUniqueID string, policyID string) error
}

func NewUserPolicyRepository

func NewUserPolicyRepository(c *client.Client) UserPolicyRepository

Jump to

Keyboard shortcuts

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