applicationcredentials

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *gophercloud.ServiceClient, userID string, opts ListOptsBuilder) pagination.Pager

List enumerates the ApplicationCredentials to which the current token has access.

func ListAccessRules

func ListAccessRules(client *gophercloud.ServiceClient, userID string) pagination.Pager

ListAccessRules enumerates the AccessRules to which the current user has access.

Types

type AccessRule

type AccessRule struct {
	// The ID of the access rule
	ID string `json:"id,omitempty"`
	// The API path that the application credential is permitted to access
	Path string `json:"path,omitempty"`
	// The request method that the application credential is permitted to use for a
	// given API endpoint
	Method string `json:"method,omitempty"`
	// The service type identifier for the service that the application credential
	// is permitted to access
	Service string `json:"service,omitempty"`
}

ApplicationCredential represents the access rule object

func ExtractAccessRules

func ExtractAccessRules(r pagination.Page) ([]AccessRule, error)

ExtractAccessRules returns a slice of AccessRules contained in a single page of results.

type AccessRulePage

type AccessRulePage struct {
	pagination.LinkedPageBase
}

an AccessRulePage is a single page of an AccessRule results.

func (AccessRulePage) IsEmpty

func (r AccessRulePage) IsEmpty() (bool, error)

IsEmpty determines whether or not a an AccessRulePage contains any results.

func (AccessRulePage) NextPageURL

func (r AccessRulePage) NextPageURL() (string, error)

NextPageURL extracts the "next" link from the links section of the result.

type ApplicationCredential

type ApplicationCredential struct {
	// The ID of the application credential.
	ID string `json:"id"`
	// The name of the application credential.
	Name string `json:"name"`
	// A description of the application credential’s purpose.
	Description string `json:"description"`
	// A flag indicating whether the application credential may be used for creation or destruction of other application credentials or trusts.
	// Defaults to false
	Unrestricted bool `json:"unrestricted"`
	// The secret for the application credential, either generated by the server or provided by the user.
	// This is only ever shown once in the response to a create request. It is not stored nor ever shown again.
	// If the secret is lost, a new application credential must be created.
	Secret string `json:"secret"`
	// The ID of the project the application credential was created for and that authentication requests using this application credential will be scoped to.
	ProjectID string `json:"project_id"`
	// A list of one or more roles that this application credential has associated with its project.
	// A token using this application credential will have these same roles.
	Roles []Role `json:"roles"`
	// The expiration time of the application credential, if one was specified.
	ExpiresAt time.Time `json:"-"`
	// A list of access rules objects.
	AccessRules []AccessRule `json:"access_rules,omitempty"`
	// Links contains referencing links to the application credential.
	Links map[string]interface{} `json:"links"`
}

ApplicationCredential represents the application credential object

func ExtractApplicationCredentials

func ExtractApplicationCredentials(r pagination.Page) ([]ApplicationCredential, error)

Extractan ApplicationCredentials returns a slice of ApplicationCredentials contained in a single page of results.

func (*ApplicationCredential) UnmarshalJSON

func (r *ApplicationCredential) UnmarshalJSON(b []byte) error

type ApplicationCredentialPage

type ApplicationCredentialPage struct {
	pagination.LinkedPageBase
}

an ApplicationCredentialPage is a single page of an ApplicationCredential results.

func (ApplicationCredentialPage) IsEmpty

func (r ApplicationCredentialPage) IsEmpty() (bool, error)

IsEmpty determines whether or not a an ApplicationCredentialPage contains any results.

func (ApplicationCredentialPage) NextPageURL

func (r ApplicationCredentialPage) NextPageURL() (string, error)

NextPageURL extracts the "next" link from the links section of the result.

type CreateOpts

type CreateOpts struct {
	// The name of the application credential.
	Name string `json:"name,omitempty" required:"true"`
	// A description of the application credential’s purpose.
	Description string `json:"description,omitempty"`
	// A flag indicating whether the application credential may be used for creation or destruction of other application credentials or trusts.
	// Defaults to false
	Unrestricted bool `json:"unrestricted"`
	// The secret for the application credential, either generated by the server or provided by the user.
	// This is only ever shown once in the response to a create request. It is not stored nor ever shown again.
	// If the secret is lost, a new application credential must be created.
	Secret string `json:"secret,omitempty"`
	// A list of one or more roles that this application credential has associated with its project.
	// A token using this application credential will have these same roles.
	Roles []Role `json:"roles,omitempty"`
	// A list of access rules objects.
	AccessRules []AccessRule `json:"access_rules,omitempty"`
	// The expiration time of the application credential, if one was specified.
	ExpiresAt *time.Time `json:"-"`
}

CreateOpts provides options used to create an application credential.

func (CreateOpts) ToApplicationCredentialCreateMap

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

ToApplicationCredentialCreateMap formats a CreateOpts into a create request.

type CreateOptsBuilder

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

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

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

CreateResult is the response from a Create operation. Call its Extract method to interpret it as an ApplicationCredential.

func Create

func Create(client *gophercloud.ServiceClient, userID string, opts CreateOptsBuilder) (r CreateResult)

Create creates a new ApplicationCredential.

func (CreateResult) Extract

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

Extract interprets any application_credential results as an ApplicationCredential.

type DeleteResult

type DeleteResult struct {
	gophercloud.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 *gophercloud.ServiceClient, userID string, id string) (r DeleteResult)

Delete deletes an application credential.

func DeleteAccessRule

func DeleteAccessRule(client *gophercloud.ServiceClient, userID string, id string) (r DeleteResult)

DeleteAccessRule deletes an access rule.

type GetAccessRuleResult

type GetAccessRuleResult struct {
	gophercloud.Result
}

GetAccessRuleResult is the response from a Get operation. Call its Extract method to interpret it as an AccessRule.

func GetAccessRule

func GetAccessRule(client *gophercloud.ServiceClient, userID string, id string) (r GetAccessRuleResult)

GetAccessRule retrieves details on a single access rule by ID.

func (GetAccessRuleResult) Extract

func (r GetAccessRuleResult) Extract() (*AccessRule, error)

Extract interprets any access_rule results as an AccessRule.

type GetResult

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

GetResult is the response from a Get operation. Call its Extract method to interpret it as an ApplicationCredential.

func Get

func Get(client *gophercloud.ServiceClient, userID string, id string) (r GetResult)

Get retrieves details on a single user, by ID.

func (GetResult) Extract

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

Extract interprets any application_credential results as an ApplicationCredential.

type ListOpts

type ListOpts struct {
	// Name filters the response by an application credential name
	Name string `q:"name"`
}

ListOpts provides options to filter the List results.

func (ListOpts) ToApplicationCredentialListQuery

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

ToApplicationCredentialListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

ListOptsBuilder allows extensions to add additional parameters to the List request

type Role

type Role struct {
	// DomainID is the domain ID the role belongs to.
	DomainID string `json:"domain_id,omitempty"`
	// ID is the unique ID of the role.
	ID string `json:"id,omitempty"`
	// Name is the role name
	Name string `json:"name,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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