secret

package
v1.0.0-beta.26 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Overview

Package secret provides methods and message types of the secret v1alpha1 API.

Index

Constants

View Source
const (
	EphemeralPolicyActionUnknownAction = EphemeralPolicyAction("unknown_action")
	// The version is deleted once it expires.
	EphemeralPolicyActionDelete = EphemeralPolicyAction("delete")
	// The version is disabled once it expires.
	EphemeralPolicyActionDisable = EphemeralPolicyAction("disable")
)
View Source
const (
	ListFoldersRequestOrderByCreatedAtAsc  = ListFoldersRequestOrderBy("created_at_asc")
	ListFoldersRequestOrderByCreatedAtDesc = ListFoldersRequestOrderBy("created_at_desc")
	ListFoldersRequestOrderByNameAsc       = ListFoldersRequestOrderBy("name_asc")
	ListFoldersRequestOrderByNameDesc      = ListFoldersRequestOrderBy("name_desc")
)
View Source
const (
	ListSecretsRequestOrderByNameAsc       = ListSecretsRequestOrderBy("name_asc")
	ListSecretsRequestOrderByNameDesc      = ListSecretsRequestOrderBy("name_desc")
	ListSecretsRequestOrderByCreatedAtAsc  = ListSecretsRequestOrderBy("created_at_asc")
	ListSecretsRequestOrderByCreatedAtDesc = ListSecretsRequestOrderBy("created_at_desc")
	ListSecretsRequestOrderByUpdatedAtAsc  = ListSecretsRequestOrderBy("updated_at_asc")
	ListSecretsRequestOrderByUpdatedAtDesc = ListSecretsRequestOrderBy("updated_at_desc")
)
View Source
const (
	ProductUnknown      = Product("unknown")
	ProductEdgeServices = Product("edge_services")
)
View Source
const (
	SecretStatusReady  = SecretStatus("ready")
	SecretStatusLocked = SecretStatus("locked")
)
View Source
const (
	SecretTypeUnknownSecretType = SecretType("unknown_secret_type")
	// Default type.
	SecretTypeOpaque = SecretType("opaque")
	// List of concatenated PEM blocks. They can contain certificates, private keys or any other PEM block types.
	SecretTypeCertificate = SecretType("certificate")
	// Flat JSON that allows you to set any number of first level key and a scalar type as a value (string, numeric, boolean).
	SecretTypeKeyValue = SecretType("key_value")
)
View Source
const (
	SecretVersionStatusUnknown   = SecretVersionStatus("unknown")
	SecretVersionStatusEnabled   = SecretVersionStatus("enabled")
	SecretVersionStatusDisabled  = SecretVersionStatus("disabled")
	SecretVersionStatusDestroyed = SecretVersionStatus("destroyed")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

This API allows you to conveniently store, access and share sensitive data.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) AccessSecretVersion

func (s *API) AccessSecretVersion(req *AccessSecretVersionRequest, opts ...scw.RequestOption) (*AccessSecretVersionResponse, error)

AccessSecretVersion: Access sensitive data in a secret's version specified by the `region`, `secret_id` and `revision` parameters.

func (*API) AccessSecretVersionByName deprecated

func (s *API) AccessSecretVersionByName(req *AccessSecretVersionByNameRequest, opts ...scw.RequestOption) (*AccessSecretVersionResponse, error)

Deprecated: AccessSecretVersionByName: Access sensitive data in a secret's version specified by the `region`, `secret_name`, `revision` and `project_id` parameters.

This method is deprecated.

Scaleway recommends that you use the `ListSecrets` request with the `name` filter to specify the secret version desired, then use the `AccessSecretVersion` request.

func (*API) AddSecretOwner

func (s *API) AddSecretOwner(req *AddSecretOwnerRequest, opts ...scw.RequestOption) error

AddSecretOwner: Allow a product to use the secret.

func (*API) CreateFolder

func (s *API) CreateFolder(req *CreateFolderRequest, opts ...scw.RequestOption) (*Folder, error)

CreateFolder: Create folder.

func (*API) CreateSecret

func (s *API) CreateSecret(req *CreateSecretRequest, opts ...scw.RequestOption) (*Secret, error)

CreateSecret: You must specify the `region` to create a secret.

func (*API) CreateSecretVersion

func (s *API) CreateSecretVersion(req *CreateSecretVersionRequest, opts ...scw.RequestOption) (*SecretVersion, error)

CreateSecretVersion: Create a version of a given secret specified by the `region` and `secret_id` parameters.

func (*API) DeleteFolder

func (s *API) DeleteFolder(req *DeleteFolderRequest, opts ...scw.RequestOption) error

DeleteFolder: Delete a given folder specified by the `region` and `folder_id` parameters.

func (*API) DeleteSecret

func (s *API) DeleteSecret(req *DeleteSecretRequest, opts ...scw.RequestOption) error

DeleteSecret: Delete a given secret specified by the `region` and `secret_id` parameters.

func (*API) DestroySecretVersion

func (s *API) DestroySecretVersion(req *DestroySecretVersionRequest, opts ...scw.RequestOption) (*SecretVersion, error)

DestroySecretVersion: Delete a secret's version and the sensitive data contained in it. Deleting a version is permanent and cannot be undone.

func (*API) DisableSecretVersion

func (s *API) DisableSecretVersion(req *DisableSecretVersionRequest, opts ...scw.RequestOption) (*SecretVersion, error)

DisableSecretVersion: Make a specific version inaccessible. You must specify the `region`, `secret_id` and `revision` parameters.

func (*API) EnableSecretVersion

func (s *API) EnableSecretVersion(req *EnableSecretVersionRequest, opts ...scw.RequestOption) (*SecretVersion, error)

EnableSecretVersion: Make a specific version accessible. You must specify the `region`, `secret_id` and `revision` parameters.

func (*API) GeneratePassword

func (s *API) GeneratePassword(req *GeneratePasswordRequest, opts ...scw.RequestOption) (*SecretVersion, error)

GeneratePassword: Generate a password for the given secret specified by the `region` and `secret_id` parameters. This will also create a new version of the secret that will store the password.

func (*API) GetSecret

func (s *API) GetSecret(req *GetSecretRequest, opts ...scw.RequestOption) (*Secret, error)

GetSecret: Retrieve the metadata of a secret specified by the `region` and `secret_id` parameters.

func (*API) GetSecretByName deprecated

func (s *API) GetSecretByName(req *GetSecretByNameRequest, opts ...scw.RequestOption) (*Secret, error)

Deprecated: GetSecretByName: Retrieve the metadata of a secret specified by the `region` and `secret_name` parameters.

GetSecretByName usage is now deprecated.

Scaleway recommends that you use the `ListSecrets` request with the `name` filter.

func (*API) GetSecretVersion

func (s *API) GetSecretVersion(req *GetSecretVersionRequest, opts ...scw.RequestOption) (*SecretVersion, error)

GetSecretVersion: Retrieve the metadata of a secret's given version specified by the `region`, `secret_id` and `revision` parameters.

func (*API) GetSecretVersionByName deprecated

func (s *API) GetSecretVersionByName(req *GetSecretVersionByNameRequest, opts ...scw.RequestOption) (*SecretVersion, error)

Deprecated: GetSecretVersionByName: Retrieve the metadata of a secret's given version specified by the `region`, `secret_name`, `revision` and `project_id` parameters.

This method is deprecated.

Scaleway recommends that you use the `ListSecrets` request with the `name` filter to specify the secret version desired, then use the `GetSecretVersion` request.

func (*API) ListFolders

func (s *API) ListFolders(req *ListFoldersRequest, opts ...scw.RequestOption) (*ListFoldersResponse, error)

ListFolders: Retrieve the list of folders created within a Project.

func (*API) ListSecretVersions

func (s *API) ListSecretVersions(req *ListSecretVersionsRequest, opts ...scw.RequestOption) (*ListSecretVersionsResponse, error)

ListSecretVersions: Retrieve the list of a given secret's versions specified by the `secret_id` and `region` parameters.

func (*API) ListSecretVersionsByName deprecated

func (s *API) ListSecretVersionsByName(req *ListSecretVersionsByNameRequest, opts ...scw.RequestOption) (*ListSecretVersionsResponse, error)

Deprecated: ListSecretVersionsByName: Retrieve the list of a given secret's versions specified by the `secret_name`,`region` and `project_id` parameters.

This method is deprecated.

Scaleway recommends that you use the `ListSecrets` request with the `name` filter to specify the secret version desired, then use the `ListSecretVersions` request.

func (*API) ListSecrets

func (s *API) ListSecrets(req *ListSecretsRequest, opts ...scw.RequestOption) (*ListSecretsResponse, error)

ListSecrets: Retrieve the list of secrets created within an Organization and/or Project. You must specify either the `organization_id` or the `project_id` and the `region`.

func (*API) ListTags

func (s *API) ListTags(req *ListTagsRequest, opts ...scw.RequestOption) (*ListTagsResponse, error)

ListTags: List all tags associated with secrets within a given Project.

func (*API) ProtectSecret

func (s *API) ProtectSecret(req *ProtectSecretRequest, opts ...scw.RequestOption) (*Secret, error)

ProtectSecret: Protect a given secret specified by the `secret_id` parameter. A protected secret can be read and modified but cannot be deleted.

func (*API) Regions

func (s *API) Regions() []scw.Region

func (*API) UnprotectSecret

func (s *API) UnprotectSecret(req *UnprotectSecretRequest, opts ...scw.RequestOption) (*Secret, error)

UnprotectSecret: Unprotect a given secret specified by the `secret_id` parameter. An unprotected secret can be read, modified and deleted.

func (*API) UpdateSecret

func (s *API) UpdateSecret(req *UpdateSecretRequest, opts ...scw.RequestOption) (*Secret, error)

UpdateSecret: Edit a secret's metadata such as name, tag(s), description and ephemeral policy. The secret to update is specified by the `secret_id` and `region` parameters.

func (*API) UpdateSecretVersion

func (s *API) UpdateSecretVersion(req *UpdateSecretVersionRequest, opts ...scw.RequestOption) (*SecretVersion, error)

UpdateSecretVersion: Edit the metadata of a secret's given version, specified by the `region`, `secret_id` and `revision` parameters.

type AccessSecretVersionByNameRequest

type AccessSecretVersionByNameRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretName: name of the secret.
	SecretName string `json:"-"`

	// Revision: the first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be either:
	// - a number (the revision number)
	// - "latest" (the latest revision)
	// - "latest_enabled" (the latest enabled revision).
	Revision string `json:"-"`

	// ProjectID: (Optional.) If not specified, Secret Manager will look for the secret version in all Projects.
	ProjectID *string `json:"project_id,omitempty"`
}

AccessSecretVersionByNameRequest: access secret version by name request.

type AccessSecretVersionRequest

type AccessSecretVersionRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret.
	SecretID string `json:"-"`

	// Revision: the first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be either:
	// - a number (the revision number)
	// - "latest" (the latest revision)
	// - "latest_enabled" (the latest enabled revision).
	Revision string `json:"-"`
}

AccessSecretVersionRequest: access secret version request.

type AccessSecretVersionResponse

type AccessSecretVersionResponse struct {
	// SecretID: ID of the secret.
	SecretID string `json:"secret_id"`

	// Revision: the first version of the secret is numbered 1, and all subsequent revisions augment by 1.
	Revision uint32 `json:"revision"`

	// Data: the base64-encoded secret payload of the version.
	Data []byte `json:"data"`

	// DataCrc32: this field is only available if a CRC32 was supplied during the creation of the version.
	DataCrc32 *uint32 `json:"data_crc32"`
}

AccessSecretVersionResponse: access secret version response.

type AddSecretOwnerRequest

type AddSecretOwnerRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret.
	SecretID string `json:"-"`

	// Deprecated: ProductName: (Deprecated: use `product` field) Name of the product to add.
	ProductName *string `json:"product_name,omitempty"`

	// Product: see `Product` enum for description of values.
	// Default value: unknown
	Product Product `json:"product"`
}

AddSecretOwnerRequest: add secret owner request.

type CreateFolderRequest

type CreateFolderRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: ID of the Project containing the folder.
	ProjectID string `json:"project_id"`

	// Name: name of the folder.
	Name string `json:"name"`

	// Path: (Optional.) Location of the folder in the directory structure. If not specified, the path is `/`.
	Path *string `json:"path,omitempty"`
}

CreateFolderRequest: create folder request.

type CreateSecretRequest

type CreateSecretRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: ID of the Project containing the secret.
	ProjectID string `json:"project_id"`

	// Name: name of the secret.
	Name string `json:"name"`

	// Tags: list of the secret's tags.
	Tags []string `json:"tags"`

	// Description: description of the secret.
	Description *string `json:"description,omitempty"`

	// Type: (Optional.) See `Secret.Type` enum for description of values. If not specified, the type is `Opaque`.
	// Default value: unknown_secret_type
	Type SecretType `json:"type"`

	// Path: (Optional.) Location of the secret in the directory structure. If not specified, the path is `/`.
	Path *string `json:"path,omitempty"`

	// EphemeralPolicy: (Optional.) Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
	EphemeralPolicy *EphemeralPolicy `json:"ephemeral_policy,omitempty"`

	// IsProtected: a protected secret cannot be deleted.
	IsProtected bool `json:"is_protected"`
}

CreateSecretRequest: create secret request.

type CreateSecretVersionRequest

type CreateSecretVersionRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret.
	SecretID string `json:"-"`

	// Data: the base64-encoded secret payload of the version.
	Data []byte `json:"data"`

	// Description: description of the version.
	Description *string `json:"description,omitempty"`

	// DisablePrevious: (Optional.) If there is no previous version or if the previous version was already disabled, does nothing.
	DisablePrevious *bool `json:"disable_previous,omitempty"`

	// Deprecated: PasswordGeneration: (Optional.) If specified, a random password will be generated. The `data` and `data_crc32` fields must be empty. By default, the generator will use upper and lower case letters, and digits. This behavior can be tuned using the generation parameters.
	PasswordGeneration *PasswordGenerationParams `json:"password_generation,omitempty"`

	// DataCrc32: if specified, Secret Manager will verify the integrity of the data received against the given CRC32 checksum. An error is returned if the CRC32 does not match. If, however, the CRC32 matches, it will be stored and returned along with the SecretVersion on future access requests.
	DataCrc32 *uint32 `json:"data_crc32,omitempty"`
}

CreateSecretVersionRequest: create secret version request.

type DeleteFolderRequest

type DeleteFolderRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// FolderID: ID of the folder.
	FolderID string `json:"-"`
}

DeleteFolderRequest: delete folder request.

type DeleteSecretRequest

type DeleteSecretRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret.
	SecretID string `json:"-"`
}

DeleteSecretRequest: delete secret request.

type DestroySecretVersionRequest

type DestroySecretVersionRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret.
	SecretID string `json:"-"`

	// Revision: the first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be either:
	// - a number (the revision number)
	// - "latest" (the latest revision)
	// - "latest_enabled" (the latest enabled revision).
	Revision string `json:"-"`
}

DestroySecretVersionRequest: destroy secret version request.

type DisableSecretVersionRequest

type DisableSecretVersionRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret.
	SecretID string `json:"-"`

	// Revision: the first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be either:
	// - a number (the revision number)
	// - "latest" (the latest revision)
	// - "latest_enabled" (the latest enabled revision).
	Revision string `json:"-"`
}

DisableSecretVersionRequest: disable secret version request.

type EnableSecretVersionRequest

type EnableSecretVersionRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret.
	SecretID string `json:"-"`

	// Revision: the first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be either:
	// - a number (the revision number)
	// - "latest" (the latest revision)
	// - "latest_enabled" (the latest enabled revision).
	Revision string `json:"-"`
}

EnableSecretVersionRequest: enable secret version request.

type EphemeralPolicy

type EphemeralPolicy struct {
	// TimeToLive: time frame, from one second and up to one year, during which the secret's versions are valid.
	TimeToLive *scw.Duration `json:"time_to_live"`

	// ExpiresOnceAccessed: returns `true` if the version expires after a single user access.
	ExpiresOnceAccessed *bool `json:"expires_once_accessed"`

	// Action: see the `EphemeralPolicy.Action` enum for a description of values.
	// Default value: unknown_action
	Action EphemeralPolicyAction `json:"action"`
}

EphemeralPolicy: ephemeral policy.

type EphemeralPolicyAction

type EphemeralPolicyAction string

func (EphemeralPolicyAction) MarshalJSON

func (enum EphemeralPolicyAction) MarshalJSON() ([]byte, error)

func (EphemeralPolicyAction) String

func (enum EphemeralPolicyAction) String() string

func (*EphemeralPolicyAction) UnmarshalJSON

func (enum *EphemeralPolicyAction) UnmarshalJSON(data []byte) error

type EphemeralProperties

type EphemeralProperties struct {
	// ExpiresAt: (Optional.) If not specified, the version does not have an expiration date.
	ExpiresAt *time.Time `json:"expires_at"`

	// ExpiresOnceAccessed: (Optional.) If not specified, the version can be accessed an unlimited amount of times.
	ExpiresOnceAccessed *bool `json:"expires_once_accessed"`

	// Action: see `EphemeralPolicy.Action` enum for a description of values.
	// Default value: unknown_action
	Action EphemeralPolicyAction `json:"action"`
}

EphemeralProperties: ephemeral properties.

type Folder

type Folder struct {
	// ID: ID of the folder.
	ID string `json:"id"`

	// ProjectID: ID of the Project containing the folder.
	ProjectID string `json:"project_id"`

	// Name: name of the folder.
	Name string `json:"name"`

	// Path: location of the folder in the directory structure.
	Path string `json:"path"`

	// CreatedAt: date and time of the folder's creation.
	CreatedAt *time.Time `json:"created_at"`

	// Region: region of the folder.
	Region scw.Region `json:"region"`
}

Folder: folder.

type GeneratePasswordRequest

type GeneratePasswordRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret.
	SecretID string `json:"-"`

	// Description: description of the version.
	Description *string `json:"description,omitempty"`

	// DisablePrevious: this has no effect if there is no previous version or if the previous version was already disabled.
	DisablePrevious *bool `json:"disable_previous,omitempty"`

	// Length: length of the password to generate (between 1 and 1024 characters).
	Length uint32 `json:"length"`

	// NoLowercaseLetters: (Optional.) Exclude lower case letters by default in the password character set.
	NoLowercaseLetters *bool `json:"no_lowercase_letters,omitempty"`

	// NoUppercaseLetters: (Optional.) Exclude upper case letters by default in the password character set.
	NoUppercaseLetters *bool `json:"no_uppercase_letters,omitempty"`

	// NoDigits: (Optional.) Exclude digits by default in the password character set.
	NoDigits *bool `json:"no_digits,omitempty"`

	// AdditionalChars: (Optional.) Additional ASCII characters to be included in the password character set.
	AdditionalChars *string `json:"additional_chars,omitempty"`
}

GeneratePasswordRequest: generate password request.

type GetSecretByNameRequest

type GetSecretByNameRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretName: name of the secret.
	SecretName string `json:"-"`

	// ProjectID: (Optional.) If not specified, Secret Manager will look for the secret in all Projects.
	ProjectID *string `json:"project_id,omitempty"`
}

GetSecretByNameRequest: get secret by name request.

type GetSecretRequest

type GetSecretRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret.
	SecretID string `json:"-"`
}

GetSecretRequest: get secret request.

type GetSecretVersionByNameRequest

type GetSecretVersionByNameRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretName: name of the secret.
	SecretName string `json:"-"`

	// Revision: the first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be either:
	// - a number (the revision number)
	// - "latest" (the latest revision)
	// - "latest_enabled" (the latest enabled revision).
	Revision string `json:"-"`

	// ProjectID: (Optional.) If not specified, Secret Manager will look for the secret version in all Projects.
	ProjectID *string `json:"project_id,omitempty"`
}

GetSecretVersionByNameRequest: get secret version by name request.

type GetSecretVersionRequest

type GetSecretVersionRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret.
	SecretID string `json:"-"`

	// Revision: the first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be either:
	// - a number (the revision number)
	// - "latest" (the latest revision)
	// - "latest_enabled" (the latest enabled revision).
	Revision string `json:"-"`
}

GetSecretVersionRequest: get secret version request.

type ListFoldersRequest

type ListFoldersRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: filter by Project ID (optional).
	ProjectID *string `json:"-"`

	// Path: filter by path (optional).
	Path *string `json:"-"`

	Page *int32 `json:"-"`

	PageSize *uint32 `json:"-"`

	// OrderBy: default value: created_at_asc
	OrderBy ListFoldersRequestOrderBy `json:"-"`
}

ListFoldersRequest: list folders request.

type ListFoldersRequestOrderBy

type ListFoldersRequestOrderBy string

func (ListFoldersRequestOrderBy) MarshalJSON

func (enum ListFoldersRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListFoldersRequestOrderBy) String

func (enum ListFoldersRequestOrderBy) String() string

func (*ListFoldersRequestOrderBy) UnmarshalJSON

func (enum *ListFoldersRequestOrderBy) UnmarshalJSON(data []byte) error

type ListFoldersResponse

type ListFoldersResponse struct {
	// Folders: list of folders.
	Folders []*Folder `json:"folders"`

	// TotalCount: count of all folders matching the requested criteria.
	TotalCount uint32 `json:"total_count"`
}

ListFoldersResponse: list folders response.

func (*ListFoldersResponse) UnsafeAppend

func (r *ListFoldersResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListFoldersResponse) UnsafeGetTotalCount

func (r *ListFoldersResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListSecretVersionsByNameRequest

type ListSecretVersionsByNameRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretName: name of the secret.
	SecretName string `json:"-"`

	Page *int32 `json:"-"`

	PageSize *uint32 `json:"-"`

	// Status: filter results by status.
	Status []SecretVersionStatus `json:"-"`

	// ProjectID: (Optional.) If not specified, Secret Manager will look for the secret in all Projects.
	ProjectID *string `json:"-"`
}

ListSecretVersionsByNameRequest: list secret versions by name request.

type ListSecretVersionsRequest

type ListSecretVersionsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret.
	SecretID string `json:"-"`

	Page *int32 `json:"-"`

	PageSize *uint32 `json:"-"`

	// Status: filter results by status.
	Status []SecretVersionStatus `json:"-"`
}

ListSecretVersionsRequest: list secret versions request.

type ListSecretVersionsResponse

type ListSecretVersionsResponse struct {
	// Versions: single page of versions.
	Versions []*SecretVersion `json:"versions"`

	// TotalCount: number of versions.
	TotalCount uint32 `json:"total_count"`
}

ListSecretVersionsResponse: list secret versions response.

func (*ListSecretVersionsResponse) UnsafeAppend

func (r *ListSecretVersionsResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListSecretVersionsResponse) UnsafeGetTotalCount

func (r *ListSecretVersionsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListSecretsRequest

type ListSecretsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// OrganizationID: filter by Organization ID (optional).
	OrganizationID *string `json:"-"`

	// ProjectID: filter by Project ID (optional).
	ProjectID *string `json:"-"`

	// OrderBy: default value: name_asc
	OrderBy ListSecretsRequestOrderBy `json:"-"`

	Page *int32 `json:"-"`

	PageSize *uint32 `json:"-"`

	// Tags: list of tags to filter on (optional).
	Tags []string `json:"-"`

	// Name: filter by secret name (optional).
	Name *string `json:"-"`

	// IsManaged: filter by managed / not managed (optional).
	IsManaged *bool `json:"-"`

	// Path: filter by path (optional).
	Path *string `json:"-"`

	// IsEphemeral: filter by ephemeral / not ephemeral (optional).
	IsEphemeral *bool `json:"-"`
}

ListSecretsRequest: list secrets request.

type ListSecretsRequestOrderBy

type ListSecretsRequestOrderBy string

func (ListSecretsRequestOrderBy) MarshalJSON

func (enum ListSecretsRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListSecretsRequestOrderBy) String

func (enum ListSecretsRequestOrderBy) String() string

func (*ListSecretsRequestOrderBy) UnmarshalJSON

func (enum *ListSecretsRequestOrderBy) UnmarshalJSON(data []byte) error

type ListSecretsResponse

type ListSecretsResponse struct {
	// Secrets: single page of secrets matching the requested criteria.
	Secrets []*Secret `json:"secrets"`

	// TotalCount: count of all secrets matching the requested criteria.
	TotalCount uint32 `json:"total_count"`
}

ListSecretsResponse: list secrets response.

func (*ListSecretsResponse) UnsafeAppend

func (r *ListSecretsResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListSecretsResponse) UnsafeGetTotalCount

func (r *ListSecretsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListTagsRequest

type ListTagsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: (Optional.) If not specified, Secret Manager will look for tags in all Projects.
	ProjectID *string `json:"-"`

	Page *int32 `json:"-"`

	PageSize *uint32 `json:"-"`
}

ListTagsRequest: list tags request.

type ListTagsResponse

type ListTagsResponse struct {
	// Tags: list of tags.
	Tags []string `json:"tags"`

	// TotalCount: count of all tags matching the requested criteria.
	TotalCount uint32 `json:"total_count"`
}

ListTagsResponse: list tags response.

func (*ListTagsResponse) UnsafeAppend

func (r *ListTagsResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListTagsResponse) UnsafeGetTotalCount

func (r *ListTagsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type PasswordGenerationParams

type PasswordGenerationParams struct {
	// Length: length of the password to generate (between 1 and 1024).
	Length uint32 `json:"length"`

	// NoLowercaseLetters: do not include lower case letters by default in the alphabet.
	NoLowercaseLetters bool `json:"no_lowercase_letters"`

	// NoUppercaseLetters: do not include upper case letters by default in the alphabet.
	NoUppercaseLetters bool `json:"no_uppercase_letters"`

	// NoDigits: do not include digits by default in the alphabet.
	NoDigits bool `json:"no_digits"`

	// AdditionalChars: additional ascii characters to be included in the alphabet.
	AdditionalChars string `json:"additional_chars"`
}

PasswordGenerationParams: password generation params.

type Product

type Product string

func (Product) MarshalJSON

func (enum Product) MarshalJSON() ([]byte, error)

func (Product) String

func (enum Product) String() string

func (*Product) UnmarshalJSON

func (enum *Product) UnmarshalJSON(data []byte) error

type ProtectSecretRequest

type ProtectSecretRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret to protect.
	SecretID string `json:"-"`
}

ProtectSecretRequest: protect secret request.

type Secret

type Secret struct {
	// ID: ID of the secret.
	ID string `json:"id"`

	// ProjectID: ID of the Project containing the secret.
	ProjectID string `json:"project_id"`

	// Name: name of the secret.
	Name string `json:"name"`

	// Status: * `ready`: the secret can be read, modified and deleted.
	// * `locked`: no action can be performed on the secret. This status can only be applied and removed by Scaleway.
	// Default value: ready
	Status SecretStatus `json:"status"`

	// CreatedAt: date and time of the secret's creation.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: last update of the secret.
	UpdatedAt *time.Time `json:"updated_at"`

	// Tags: list of the secret's tags.
	Tags []string `json:"tags"`

	// VersionCount: number of versions for this secret.
	VersionCount uint32 `json:"version_count"`

	// Description: updated description of the secret.
	Description *string `json:"description"`

	// IsManaged: returns `true` for secrets that are managed by another product.
	IsManaged bool `json:"is_managed"`

	// IsProtected: returns `true` for protected secrets that cannot be deleted.
	IsProtected bool `json:"is_protected"`

	// Type: see `Secret.Type` enum for description of values.
	// Default value: unknown_secret_type
	Type SecretType `json:"type"`

	// Path: location of the secret in the directory structure.
	Path string `json:"path"`

	// EphemeralPolicy: (Optional.) Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
	EphemeralPolicy *EphemeralPolicy `json:"ephemeral_policy"`

	// Region: region of the secret.
	Region scw.Region `json:"region"`
}

Secret: secret.

type SecretStatus

type SecretStatus string

func (SecretStatus) MarshalJSON

func (enum SecretStatus) MarshalJSON() ([]byte, error)

func (SecretStatus) String

func (enum SecretStatus) String() string

func (*SecretStatus) UnmarshalJSON

func (enum *SecretStatus) UnmarshalJSON(data []byte) error

type SecretType

type SecretType string

func (SecretType) MarshalJSON

func (enum SecretType) MarshalJSON() ([]byte, error)

func (SecretType) String

func (enum SecretType) String() string

func (*SecretType) UnmarshalJSON

func (enum *SecretType) UnmarshalJSON(data []byte) error

type SecretVersion

type SecretVersion struct {
	// Revision: the first version of the secret is numbered 1, and all subsequent revisions augment by 1.
	Revision uint32 `json:"revision"`

	// SecretID: ID of the secret.
	SecretID string `json:"secret_id"`

	// Status: * `unknown`: the version is in an invalid state.
	// * `enabled`: the version is accessible.
	// * `disabled`: the version is not accessible but can be enabled.
	// * `destroyed`: the version is permanently deleted. It is not possible to recover it.
	// Default value: unknown
	Status SecretVersionStatus `json:"status"`

	// CreatedAt: date and time of the version's creation.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: last update of the version.
	UpdatedAt *time.Time `json:"updated_at"`

	// Description: description of the version.
	Description *string `json:"description"`

	// IsLatest: returns `true` if the version is the latest.
	IsLatest bool `json:"is_latest"`

	// EphemeralProperties: returns the version's expiration date, whether it expires after being accessed once, and the action to perform (disable or delete) once the version expires.
	EphemeralProperties *EphemeralProperties `json:"ephemeral_properties"`
}

SecretVersion: secret version.

type SecretVersionStatus

type SecretVersionStatus string

func (SecretVersionStatus) MarshalJSON

func (enum SecretVersionStatus) MarshalJSON() ([]byte, error)

func (SecretVersionStatus) String

func (enum SecretVersionStatus) String() string

func (*SecretVersionStatus) UnmarshalJSON

func (enum *SecretVersionStatus) UnmarshalJSON(data []byte) error

type UnprotectSecretRequest

type UnprotectSecretRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret to unprotect.
	SecretID string `json:"-"`
}

UnprotectSecretRequest: unprotect secret request.

type UpdateSecretRequest

type UpdateSecretRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret.
	SecretID string `json:"-"`

	// Name: secret's updated name (optional).
	Name *string `json:"name,omitempty"`

	// Tags: secret's updated list of tags (optional).
	Tags *[]string `json:"tags,omitempty"`

	// Description: description of the secret.
	Description *string `json:"description,omitempty"`

	// Path: (Optional.) Location of the folder in the directory structure. If not specified, the path is `/`.
	Path *string `json:"path,omitempty"`

	// EphemeralPolicy: (Optional.) Policy that defines whether/when a secret's versions expire.
	EphemeralPolicy *EphemeralPolicy `json:"ephemeral_policy,omitempty"`
}

UpdateSecretRequest: update secret request.

type UpdateSecretVersionRequest

type UpdateSecretVersionRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// SecretID: ID of the secret.
	SecretID string `json:"-"`

	// Revision: the first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be either:
	// - a number (the revision number)
	// - "latest" (the latest revision)
	// - "latest_enabled" (the latest enabled revision).
	Revision string `json:"-"`

	// Description: description of the version.
	Description *string `json:"description,omitempty"`

	// EphemeralProperties: (Optional.) Properties that defines the version's expiration date, whether it expires after being accessed once, and the action to perform (disable or delete) once the version expires.
	EphemeralProperties *EphemeralProperties `json:"ephemeral_properties,omitempty"`
}

UpdateSecretVersionRequest: update secret version request.

Jump to

Keyboard shortcuts

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