secret

package
v1.0.0-beta.13 Latest Latest
Warning

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

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

Documentation

Overview

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

Index

Constants

View Source
const (
	// ListSecretsRequestOrderByNameAsc is [insert doc].
	ListSecretsRequestOrderByNameAsc = ListSecretsRequestOrderBy("name_asc")
	// ListSecretsRequestOrderByNameDesc is [insert doc].
	ListSecretsRequestOrderByNameDesc = ListSecretsRequestOrderBy("name_desc")
	// ListSecretsRequestOrderByCreatedAtAsc is [insert doc].
	ListSecretsRequestOrderByCreatedAtAsc = ListSecretsRequestOrderBy("created_at_asc")
	// ListSecretsRequestOrderByCreatedAtDesc is [insert doc].
	ListSecretsRequestOrderByCreatedAtDesc = ListSecretsRequestOrderBy("created_at_desc")
	// ListSecretsRequestOrderByUpdatedAtAsc is [insert doc].
	ListSecretsRequestOrderByUpdatedAtAsc = ListSecretsRequestOrderBy("updated_at_asc")
	// ListSecretsRequestOrderByUpdatedAtDesc is [insert doc].
	ListSecretsRequestOrderByUpdatedAtDesc = ListSecretsRequestOrderBy("updated_at_desc")
)
View Source
const (
	// SecretStatusReady is [insert doc].
	SecretStatusReady = SecretStatus("ready")
	// SecretStatusLocked is [insert doc].
	SecretStatusLocked = SecretStatus("locked")
)
View Source
const (
	// SecretVersionStatusUnknown is [insert doc].
	SecretVersionStatusUnknown = SecretVersionStatus("unknown")
	// SecretVersionStatusEnabled is [insert doc].
	SecretVersionStatusEnabled = SecretVersionStatus("enabled")
	// SecretVersionStatusDisabled is [insert doc].
	SecretVersionStatusDisabled = SecretVersionStatus("disabled")
	// SecretVersionStatusDestroyed is [insert doc].
	SecretVersionStatusDestroyed = SecretVersionStatus("destroyed")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API: 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 a SecretVersion, returning the sensitive data

func (*API) CreateSecret

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

CreateSecret: create a Secret containing no versions

func (*API) CreateSecretVersion

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

CreateSecretVersion: create a SecretVersion

func (*API) DeleteSecret

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

DeleteSecret: delete a secret

func (*API) DestroySecretVersion

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

DestroySecretVersion: destroy a SecretVersion, permanently destroying the sensitive data

func (*API) DisableSecretVersion

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

DisableSecretVersion: disable a SecretVersion

func (*API) EnableSecretVersion

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

EnableSecretVersion: enable a SecretVersion

func (*API) GetSecret

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

GetSecret: get metadata of a Secret

func (*API) GetSecretVersion

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

GetSecretVersion: get metadata of a SecretVersion

func (*API) ListSecretVersions

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

ListSecretVersions: list versions of a secret, not returning any sensitive data

func (*API) ListSecrets

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

ListSecrets: list Secrets

func (*API) Regions

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

Regions list localities the api is available in

func (*API) UpdateSecret

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

UpdateSecret: update metadata of a Secret

func (*API) UpdateSecretVersion

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

UpdateSecretVersion: update metadata of a SecretVersion

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: revision of the SecretVersion (may be a number or "latest")
	Revision string `json:"-"`
}

type AccessSecretVersionResponse

type AccessSecretVersionResponse struct {
	// SecretID: ID of the Secret
	SecretID string `json:"secret_id"`
	// Revision: revision of the SecretVersion
	Revision uint32 `json:"revision"`
	// Data: the base64-encoded secret payload of the SecretVersion
	Data []byte `json:"data"`
}

AccessSecretVersionResponse: access secret version response

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 tags associated to this Secret
	Tags []string `json:"tags"`
	// Description: description of the Secret
	Description *string `json:"description"`
}

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 SecretVersion
	Data []byte `json:"data"`
	// Description: description of the SecretVersion
	Description *string `json:"description"`
}

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:"-"`
}

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: revision of the SecretVersion (may be a number or "latest")
	Revision string `json:"-"`
}

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: revision of the SecretVersion (may be a number or "latest")
	Revision string `json:"-"`
}

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: revision of the SecretVersion (may be a number or "latest")
	Revision string `json:"-"`
}

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:"-"`
}

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: revision of the SecretVersion (may be a number or "latest")
	Revision string `json:"-"`
}

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:"-"`
}

type ListSecretVersionsResponse

type ListSecretVersionsResponse struct {
	// TotalCount: count of all SecretVersions
	TotalCount uint32 `json:"total_count"`
	// Versions: single page of SecretVersions
	Versions []*SecretVersion `json:"versions"`
}

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: ID of an organization to filter on (optional)
	OrganizationID *string `json:"-"`
	// ProjectID: ID of a project to filter on (optional)
	ProjectID *string `json:"-"`
	// Tags: list of tags to filter on (optional)
	Tags []string `json:"-"`
	// OrderBy:
	//
	// Default value: name_asc
	OrderBy ListSecretsRequestOrderBy `json:"-"`

	Page *int32 `json:"-"`

	PageSize *uint32 `json:"-"`
}

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 {
	// TotalCount: count of all Secrets matching the requested criteria
	TotalCount uint32 `json:"total_count"`
	// Secrets: single page of Secrets matching the requested criteria
	Secrets []*Secret `json:"secrets"`
}

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 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: current status of the Secret
	//
	// * `ready`: the Secret is ready.
	// * `locked`: the Secret is locked.
	//
	// Default value: ready
	Status SecretStatus `json:"status"`
	// CreatedAt: the time at which the Secret was created
	CreatedAt *time.Time `json:"created_at"`
	// UpdatedAt: the time at which the Secret was updated
	UpdatedAt *time.Time `json:"updated_at"`
	// Tags: list of tags associated to this Secret
	Tags []string `json:"tags"`
	// Region: region of the Secret
	Region scw.Region `json:"region"`
	// VersionCount: the number of versions for this Secret
	VersionCount uint32 `json:"version_count"`
	// Description: description of the Secret
	Description *string `json:"description"`
}

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 SecretVersion

type SecretVersion struct {
	// SecretID: ID of the Secret
	SecretID string `json:"secret_id"`
	// Revision: revision of the SecretVersion
	Revision uint32 `json:"revision"`
	// Status: current status of the SecretVersion
	//
	// * `unknown`: the SecretVersion is in an invalid state.
	// * `enabled`: the SecretVersion is accessible.
	// * `disabled`: the SecretVersion is not accessible but can be enabled.
	// * `destroyed`: the SecretVersion is permanently destroyed.
	//
	// Default value: unknown
	Status SecretVersionStatus `json:"status"`
	// CreatedAt: the time at which the SecretVersion was created
	CreatedAt *time.Time `json:"created_at"`
	// UpdatedAt: the time at which the SecretVersion was updated
	UpdatedAt *time.Time `json:"updated_at"`
	// Description: description of the SecretVersion
	Description *string `json:"description"`
}

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 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: new name of the Secret (optional)
	Name *string `json:"name"`
	// Tags: new list of tags associated to this Secret (optional)
	Tags *[]string `json:"tags"`
	// Description: description of the Secret
	Description *string `json:"description"`
}

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: revision of the SecretVersion (may be a number or "latest")
	Revision string `json:"-"`
	// Description: description of the SecretVersion
	Description *string `json:"description"`
}

Jump to

Keyboard shortcuts

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