Documentation
¶
Index ¶
- Constants
- type AddConfig
- type CleanupSecretOptions
- type DecryptOptions
- type DeleteRequestOptions
- type DeleteSecretOptions
- type GetOptions
- type GetRequestOptions
- type GetResponse
- type ListRequestOptions
- type MergeOptions
- type MergeResponse
- type Path
- type Secret
- func (s *Secret) Add(key string, config *AddConfig)
- func (s *Secret) ChangeKey(old, new string)
- func (s *Secret) DataCopy() map[string]*payload.Payload
- func (s *Secret) Decode() error
- func (s *Secret) Decrypt(key [32]byte) error
- func (s *Secret) Decrypted(key [32]byte) (result *Secret, err error)
- func (s *Secret) Delete(key string)
- func (s *Secret) DeleteValues()
- func (s *Secret) Encode()
- func (s *Secret) Encrypt(key [32]byte) error
- func (s *Secret) Encrypted(key [32]byte) (*Secret, error)
- func (s *Secret) Get(key string) *payload.Payload
- func (s *Secret) GetFmtString(key string) string
- func (s *Secret) GetValue(key string) string
- func (s *Secret) IncrementVersion()
- func (s *Secret) IsEmpty() bool
- func (s *Secret) MarkEncoded()
- func (s *Secret) MarkExposable(key string)
- func (s *Secret) MarkNotExposable(key string)
- func (s *Secret) Overwrite(source map[string]*payload.Payload)
- func (s *Secret) Set(key string, value *payload.Payload)
- func (s *Secret) ToMap() *keyvalue.KVMap
- func (s *Secret) UnmarshalJSON(data []byte) error
- type SetOptions
- type SetRequestOptions
- type SyncOptions
- type VaultResponse
Constants ¶
View Source
const ( ENV_ID = "env_id" TEMP_KEY_NAME = "key" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanupSecretOptions ¶
type DecryptOptions ¶
type DeleteRequestOptions ¶
type DeleteRequestOptions struct {
EnvID string `json:"env_id"`
Key string `json:"key"`
Version *int `json:"version"`
}
func (*DeleteRequestOptions) Marshal ¶
func (r *DeleteRequestOptions) Marshal() ([]byte, error)
type DeleteSecretOptions ¶
type GetOptions ¶
type GetRequestOptions ¶
type GetResponse ¶
type GetResponse struct {
Secret *Secret `json:"secret"`
Token *tokenCommons.Token `json:"token,omitempty"`
}
type ListRequestOptions ¶
type ListRequestOptions struct {
EnvID string `query:"env_id"`
Version *int `query:"version,omitempty"`
}
func (*ListRequestOptions) Marshal ¶
func (r *ListRequestOptions) Marshal() ([]byte, error)
type MergeOptions ¶
type MergeOptions struct {
SourceEnvID string `json:"source_env_id"`
SourceVersion *int `json:"source_version"`
TargetEnvID string `json:"target_env_id"`
}
type MergeRequestOptions struct {
SourceEnvID string `json:"source_env_id"`
SourceVersion *int `json:"source_version"`
TargetEnvID string `json:"env_id"`
}
func (r *MergeRequestOptions) Marshal() ([]byte, error) {
return json.Marshal(r)
}
type MergeResponse ¶
type MergeResponse struct {
Version *int `json:"version,omitempty"`
}
type Path ¶
type Secret ¶
type Secret struct {
// To allows mutually exclusive locking
sync.Mutex
ID string `json:"id,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
UserID string `json:"user_id,omitempty"`
EnvID string `json:"env_id,omitempty"`
// Version of the secrets, if available.
Version *int `json:"version,omitempty"`
// Contains the secret mapping.
Data keypayload.KPMap `json:"data,omitempty"`
}
func (*Secret) Decrypted ¶
Decrypts all the key=value pairs with provided key and returns a new deep copy of the secret data without mutating the existing one.
func (*Secret) DeleteValues ¶
func (s *Secret) DeleteValues()
Empties the values from the payloads of all key=value pairs.
func (*Secret) Encrypted ¶
Encrypts all the key=value pairs with provided key and returns a new deep copy of the secret data without mutating the existing one.
func (*Secret) GetFmtString ¶
Get formatted string.
Fetches key=value representation for a specific key and value from the map.
func (*Secret) IncrementVersion ¶
func (s *Secret) IncrementVersion()
Increases the version of the secret by 1.
func (*Secret) MarkEncoded ¶
func (s *Secret) MarkEncoded()
Marks all payload values as Base64 encoded.
func (*Secret) MarkExposable ¶
Marks the "exposable" value of the payload as "true."
Exposability allows the value to be synced as an exposable one on platforms which differentiate between decryptable and non-decryptable secrets. For example, Github and Vercel. In Github actions, this value will be synced as a "variable" and NOT a secret, once it is marked "exposable" over here.
func (*Secret) MarkNotExposable ¶
func (*Secret) Overwrite ¶
Ovewrites or replaces values in the map for respective keys from supplied map.
func (*Secret) UnmarshalJSON ¶
type SetOptions ¶
type SetOptions struct {
EnvID string `json:"env_id"`
Data map[string]*payload.Payload `json:"data"`
}
func (*SetOptions) Marshal ¶
func (r *SetOptions) Marshal() ([]byte, error)
type SetRequestOptions ¶
type SetRequestOptions struct {
EnvID string `json:"env_id"`
Data map[string]*payload.Payload `json:"data"`
}
func (*SetRequestOptions) Marshal ¶
func (r *SetRequestOptions) Marshal() ([]byte, error)
type SyncOptions ¶
type SyncOptions struct {
EnvID string `json:"env_id"`
IntegrationType string `json:"integration_type"`
Version *int `json:"version"`
Data *keypayload.KPMap `json:"data"`
}
func (*SyncOptions) Marshal ¶
func (r *SyncOptions) Marshal() ([]byte, error)
type VaultResponse ¶
type VaultResponse struct {
Errors []interface{} `json:"errors"`
RequestID string `json:"request_id,omitempty"`
LeaseID string `json:"lease_id,omitempty"`
Renewable bool `json:"renewable,omitempty"`
LeaseDuration int `json:"lease_duration,omitempty"`
Data struct {
Ciphertext string `json:"ciphertext,omitempty"`
Plaintext string `json:"plaintext,omitempty"`
KeyVersion int `json:"key_version,omitempty"`
Backup string `json:"backup,omitempty"`
} `json:"data,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.