Help us shape the future of Go! Take the 2026 Go Developer Survey

credentials

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOpts

type CreateOpts struct {
	UserID      string `json:"user_id"`
	Description string `json:"description"`
}

func (CreateOpts) ToCredentialCreateMap

func (opts CreateOpts) ToCredentialCreateMap() (map[string]interface{}, error)

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToCredentialCreateMap() (map[string]interface{}, error)
}

type CreateResult

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

CreateResult is the response of a Get operations. Call its Extract method to interpret it as a Credential.

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

func Update

func Update(client *golangsdk.ServiceClient, credentialID string, opts UpdateOptsBuilder) (r CreateResult)

func (CreateResult) Extract

func (r CreateResult) Extract() (*Credential, error)

Extract provides access to the individual Flavor returned by the Get and Create functions.

type CreateTemporaryOpts added in v0.2.0

type CreateTemporaryOpts struct {
	// For obtaining a temporary AK/SK with an agency token for use "assume_role"
	// For user with federated token fill "token" in this field
	Methods []string `json:"methods"`

	// Common token or federated token required for obtaining a temporary AK/SK.
	// You need to choose either the ID in this object or X-Auth-Token in the request header.
	// X-Auth-Token takes priority over the ID in this object.
	Token string `json:"token,omitempty"`
	// Validity period (in seconds) of an AK/SK and security token.
	// The value ranges from 15 minutes to 24 hours.
	// The default value is 15 minutes.
	Duration int `json:"duration-seconds,omitempty"`

	// Name or ID of the domain to which the delegating party belongs
	DomainName string `json:"domain_name,omitempty"`
	DomainID   string `json:"domain_id,omitempty"`

	// Name of the agency created by a delegating party
	AgencyName string `json:"agency_name,omitempty"`
}

func (CreateTemporaryOpts) ToTempCredentialCreateMap added in v0.2.0

func (opts CreateTemporaryOpts) ToTempCredentialCreateMap() (map[string]interface{}, error)

ToTempCredentialCreateMap

type CreateTemporaryOptsBuilder added in v0.2.0

type CreateTemporaryOptsBuilder interface {
	ToTempCredentialCreateMap() (map[string]interface{}, error)
}

type CreateTemporaryResult added in v0.2.0

type CreateTemporaryResult struct {
	golangsdk.Result
}

func CreateTemporary added in v0.2.0

func CreateTemporary(client *golangsdk.ServiceClient, opts CreateTemporaryOptsBuilder) (r CreateTemporaryResult)

func (CreateTemporaryResult) Extract added in v0.2.0

type Credential

type Credential struct {
	// IAM user ID
	UserID string `json:"user_id"`

	// Description of the access key
	Description string `json:"description"`

	// Time when the access key was created
	CreateTime string `json:"create_time"`

	// Time when the access key was last used
	LastUseTime string `json:"last_use_time,omitempty"`

	// AK
	AccessKey string `json:"access"`

	// SK, returned only during creation
	SecretKey string `json:"secret,omitempty"`

	// Status of the access key, active/inactive
	Status Status `json:"status"`
}

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult is the response from a Delete operation. Call its ExtractErr to determine if the request succeeded or failed.

func Delete

func Delete(client *golangsdk.ServiceClient, credentialID string) (r DeleteResult)

type GetResult

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

GetResult is the response of a Get operations. Call its Extract method to interpret it as a Credential.

func Get

func Get(client *golangsdk.ServiceClient, credentialID string) (r GetResult)

func (GetResult) Extract

func (r GetResult) Extract() (*Credential, error)

Extract provides access to the individual Flavor returned by the Get and Create functions.

type ListOpts

type ListOpts struct {
	UserID string `json:"user_id,omitempty"`
}

func (ListOpts) ToCredentialListQuery

func (opts ListOpts) ToCredentialListQuery() (string, error)

type ListOptsBuilder

type ListOptsBuilder interface {
	ToCredentialListQuery() (string, error)
}

type ListResult

type ListResult struct {
	golangsdk.Result
}

func List

func List(client *golangsdk.ServiceClient, opts ListOptsBuilder) (l ListResult)

func (ListResult) Extract

func (lr ListResult) Extract() ([]Credential, error)

type Status

type Status string

type TemporaryCredential added in v0.2.0

type TemporaryCredential struct {
	// Expiration time
	ExpiresAt string `json:"expires_at"`

	// AK
	AccessKey string `json:"access"`

	// SK, returned only during creation
	SecretKey string `json:"secret"`

	// Used for subsequent replacement of an SK or token.
	SecurityToken string `json:"securitytoken"`
}

type UpdateOpts

type UpdateOpts struct {
	Status      string `json:"status,omitempty"`
	Description string `json:"description,omitempty"`
}

func (UpdateOpts) ToCredentialUpdateMap

func (opts UpdateOpts) ToCredentialUpdateMap() (map[string]interface{}, error)

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToCredentialUpdateMap() (map[string]interface{}, error)
}

type UpdateResult

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

UpdateResult is the response from an Update operation. Call its Extract method to interpret it as a Role.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Credential, error)

Extract provides access to the individual Flavor returned by the Get and Create functions.

Jump to

Keyboard shortcuts

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