Documentation
¶
Overview ¶
********************************************************************
- Copyright (c) Intel Corporation 2025
- SPDX-License-Identifier: Apache-2.0 *********************************************************************
********************************************************************
- Copyright (c) Intel Corporation 2025
- SPDX-License-Identifier: Apache-2.0 *********************************************************************
********************************************************************
- Copyright (c) Intel Corporation 2025
- SPDX-License-Identifier: Apache-2.0 *********************************************************************
********************************************************************
- Copyright (c) Intel Corporation 2025
- SPDX-License-Identifier: Apache-2.0 *********************************************************************
Index ¶
- Variables
- type Crypto
- func (c Crypto) Decrypt(cipherText string) (string, error)
- func (c Crypto) Encrypt(plainText string) (string, error)
- func (c Crypto) EncryptWithKey(plainText, key string) (string, error)
- func (c Crypto) GenerateKey() string
- func (c Crypto) ReadAndDecryptFile(filePath string) (config.Configuration, error)
- type Cryptor
- type Keyring
- type RealKeyring
- type Storage
- type Storager
Constants ¶
This section is empty.
Variables ¶
var ErrKeyNotFound = errors.New("key not found")
ErrKeyNotFound indicates a requested key was not found in storage.
Functions ¶
This section is empty.
Types ¶
type Crypto ¶
type Crypto struct {
EncryptionKey string
}
func (Crypto) EncryptWithKey ¶
Encrypt encrypts a string with provided key.
func (Crypto) GenerateKey ¶
func (Crypto) ReadAndDecryptFile ¶
func (c Crypto) ReadAndDecryptFile(filePath string) (config.Configuration, error)
Read encrypted data from file and decrypt it.
type Keyring ¶
type Keyring interface {
Set(serviceName, key, value string) error
Get(serviceName, key string) (string, error)
Delete(serviceName, key string) error
}
Keyring interface to abstract the keyring operations.
type RealKeyring ¶
type RealKeyring struct{}
RealKeyring struct to implement the Keyring interface using the real keyring package.
func (RealKeyring) Delete ¶ added in v2.32.0
func (r RealKeyring) Delete(serviceName, key string) error
Delete method to delete a key-value pair from the real keyring.
func (RealKeyring) Get ¶
func (r RealKeyring) Get(serviceName, key string) (string, error)
Get method to get a value from the real keyring by key.
func (RealKeyring) Set ¶
func (r RealKeyring) Set(serviceName, key, value string) error
Set method to set a key-value pair in the real keyring.
type Storage ¶
func NewKeyRingStorage ¶
NewKeyRingStorage function to create a new Storage instance with RealKeyring.
func NewStorage ¶
NewStorage function to create a new Storage instance with a keyring interface (for testing).
func (Storage) DeleteKeyValue ¶ added in v2.32.0
DeleteKeyValue method to delete a key-value pair from the keyring.
func (Storage) GetKeyValue ¶
GetKeyValue method to get a value from the keyring by key.
func (Storage) SetKeyValue ¶
SetKeyValue method to set a key-value pair in the keyring.
type Storager ¶
type Storager interface {
GetKeyValue(key string) (string, error)
SetKeyValue(key, value string) error
DeleteKeyValue(key string) error
}
Storager is the interface for secret storage operations. Implementations can be keyring-based (local) or remote (Vault). Currently supports simple key-value operations; blob/hierarchical storage can be added later if needed.