Documentation
¶
Overview ¶
Package secret provides methods and message types of the secret v1alpha1 API.
Index ¶
- Constants
- type API
- func (s *API) AccessSecretVersion(req *AccessSecretVersionRequest, opts ...scw.RequestOption) (*AccessSecretVersionResponse, error)
- func (s *API) AccessSecretVersionByName(req *AccessSecretVersionByNameRequest, opts ...scw.RequestOption) (*AccessSecretVersionResponse, error)
- func (s *API) CreateSecret(req *CreateSecretRequest, opts ...scw.RequestOption) (*Secret, error)
- func (s *API) CreateSecretVersion(req *CreateSecretVersionRequest, opts ...scw.RequestOption) (*SecretVersion, error)
- func (s *API) DeleteSecret(req *DeleteSecretRequest, opts ...scw.RequestOption) error
- func (s *API) DestroySecretVersion(req *DestroySecretVersionRequest, opts ...scw.RequestOption) (*SecretVersion, error)
- func (s *API) DisableSecretVersion(req *DisableSecretVersionRequest, opts ...scw.RequestOption) (*SecretVersion, error)
- func (s *API) EnableSecretVersion(req *EnableSecretVersionRequest, opts ...scw.RequestOption) (*SecretVersion, error)
- func (s *API) GetSecret(req *GetSecretRequest, opts ...scw.RequestOption) (*Secret, error)
- func (s *API) GetSecretByName(req *GetSecretByNameRequest, opts ...scw.RequestOption) (*Secret, error)
- func (s *API) GetSecretVersion(req *GetSecretVersionRequest, opts ...scw.RequestOption) (*SecretVersion, error)
- func (s *API) GetSecretVersionByName(req *GetSecretVersionByNameRequest, opts ...scw.RequestOption) (*SecretVersion, error)
- func (s *API) ListSecretVersions(req *ListSecretVersionsRequest, opts ...scw.RequestOption) (*ListSecretVersionsResponse, error)
- func (s *API) ListSecretVersionsByName(req *ListSecretVersionsByNameRequest, opts ...scw.RequestOption) (*ListSecretVersionsResponse, error)
- func (s *API) ListSecrets(req *ListSecretsRequest, opts ...scw.RequestOption) (*ListSecretsResponse, error)
- func (s *API) Regions() []scw.Region
- func (s *API) UpdateSecret(req *UpdateSecretRequest, opts ...scw.RequestOption) (*Secret, error)
- func (s *API) UpdateSecretVersion(req *UpdateSecretVersionRequest, opts ...scw.RequestOption) (*SecretVersion, error)
- type AccessSecretVersionByNameRequest
- type AccessSecretVersionRequest
- type AccessSecretVersionResponse
- type CreateSecretRequest
- type CreateSecretVersionRequest
- type DeleteSecretRequest
- type DestroySecretVersionRequest
- type DisableSecretVersionRequest
- type EnableSecretVersionRequest
- type GetSecretByNameRequest
- type GetSecretRequest
- type GetSecretVersionByNameRequest
- type GetSecretVersionRequest
- type ListSecretVersionsByNameRequest
- type ListSecretVersionsRequest
- type ListSecretVersionsResponse
- type ListSecretsRequest
- type ListSecretsRequestOrderBy
- type ListSecretsResponse
- type Secret
- type SecretStatus
- type SecretVersion
- type SecretVersionStatus
- type UpdateSecretRequest
- type UpdateSecretVersionRequest
Constants ¶
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") )
const ( SecretStatusReady = SecretStatus("ready") SecretStatusLocked = SecretStatus("locked") )
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
}
API: this API allows you to conveniently store, access and share sensitive data.
func (*API) AccessSecretVersion ¶
func (s *API) AccessSecretVersion(req *AccessSecretVersionRequest, opts ...scw.RequestOption) (*AccessSecretVersionResponse, error)
AccessSecretVersion: access a SecretVersion, returning the sensitive data.
func (*API) AccessSecretVersionByName ¶
func (s *API) AccessSecretVersionByName(req *AccessSecretVersionByNameRequest, opts ...scw.RequestOption) (*AccessSecretVersionResponse, error)
AccessSecretVersionByName: 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) GetSecretByName ¶
func (s *API) GetSecretByName(req *GetSecretByNameRequest, opts ...scw.RequestOption) (*Secret, error)
GetSecretByName: 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) GetSecretVersionByName ¶
func (s *API) GetSecretVersionByName(req *GetSecretVersionByNameRequest, opts ...scw.RequestOption) (*SecretVersion, error)
GetSecretVersionByName: 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) ListSecretVersionsByName ¶
func (s *API) ListSecretVersionsByName(req *ListSecretVersionsByNameRequest, opts ...scw.RequestOption) (*ListSecretVersionsResponse, error)
ListSecretVersionsByName: 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) 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 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: revision of the SecretVersion (may be a number or "latest").
Revision string `json:"-"`
}
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 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 GetSecretByNameRequest ¶
type GetSecretRequest ¶
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: revision of the SecretVersion (may be a number or "latest").
Revision 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 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:"-"`
}
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:"-"`
// Name: secret name to filter on (optional).
Name *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: * `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: * `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"`
}