secrets

package
v0.0.0-...-57791d6 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestOpts = golangsdk.RequestOpts{
	MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"},
}

Functions

func Delete

func Delete(c *golangsdk.ServiceClient, secretName string) error

Types

type CreateSecretOpts

type CreateSecretOpts struct {
	Name                string   `json:"name" required:"true"`
	KmsKeyID            string   `json:"kms_key_id,omitempty"`
	Description         string   `json:"description,omitempty"`
	SecretType          string   `json:"secret_type,omitempty"`
	EnterpriseProjectID string   `json:"enterprise_project_id,omitempty"`
	EventSubscriptions  []string `json:"event_subscriptions,omitempty"`
	SecretBinary        string   `json:"secret_binary,omitempty" xor:"SecretString"`
	SecretString        string   `json:"secret_string,omitempty" xor:"SecretBinary"`
}

type CreateVersionOpts

type CreateVersionOpts struct {
	SecretBinary  string   `json:"secret_binary,omitempty" xor:"SecretString"`
	SecretString  string   `json:"secret_string,omitempty" xor:"SecretBinary"`
	VersionStages []string `json:"version_stages,omitempty"`
	ExpireTime    int      `json:"expire_time,omitempty"`
}

type Secret

type Secret struct {
	ID                  string        `json:"id"`
	Name                string        `json:"name"`
	State               string        `json:"state"`
	KmsKeyID            string        `json:"kms_key_id"`
	Description         string        `json:"description"`
	CreateTime          int           `json:"create_time"`
	UpdateTime          int           `json:"update_time"`
	ScheduledDeleteTime int           `json:"scheduled_delete_time"`
	SecretType          string        `json:"secret_type"`
	EnterpriseProjectID string        `json:"enterprise_project_id"`
	EventSubscriptions  []interface{} `json:"event_subscriptions"`
}

func Create

func Get

func Get(c *golangsdk.ServiceClient, secretName string) (*Secret, error)

func Update

func Update(c *golangsdk.ServiceClient, secretName string, opts UpdateSecretOpts) (*Secret, error)

type SecretRst

type SecretRst struct {
	Secret Secret `json:"secret"`
}

type UpdateSecretOpts

type UpdateSecretOpts struct {
	KmsKeyID           string   `json:"kms_key_id,omitempty"`
	Description        *string  `json:"description,omitempty"`
	EventSubscriptions []string `json:"event_subscriptions"`
}

type UpdateVersionOpts

type UpdateVersionOpts struct {
	ExpireTime int `json:"expire_time" required:"true"`
}

type Version

type Version struct {
	VersionMetadata VersionMetadata `json:"version_metadata"`
	SecretBinary    string          `json:"secret_binary"`
	SecretString    string          `json:"secret_string"`
}

func ShowSecretVersion

func ShowSecretVersion(c *golangsdk.ServiceClient, secretName string, versionId string) (*Version, error)

func UpdateSecretVersion

func UpdateSecretVersion(c *golangsdk.ServiceClient, secretName string, versionId string, opts UpdateVersionOpts) (*Version, error)

UpdateSecretVersion only support update expire_time field. The current method can only update secret in the ENABLED state

type VersionMetadata

type VersionMetadata struct {
	ID            string   `json:"id"`
	CreateTime    int      `json:"create_time"`
	KmsKeyID      string   `json:"kms_key_id"`
	SecretName    string   `json:"secret_name"`
	VersionStages []string `json:"version_stages"`
	ExpireTime    int      `json:"expire_time"`
}

VersionMetadata 凭据版本被标记的状态。

func CreateSecretVersion

func CreateSecretVersion(c *golangsdk.ServiceClient, secretName string, opts CreateVersionOpts) (*VersionMetadata, error)

func ListSecretVersions

func ListSecretVersions(c *golangsdk.ServiceClient, secretName string) ([]VersionMetadata, error)

ListSecretVersions 查询凭据的版本列表

Jump to

Keyboard shortcuts

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