Documentation
¶
Index ¶
- type GatewayClient
- type HTTPClient
- type Handler
- func (h *Handler) EncryptSecrets(rawSecrets UpsertSecretsInputs) ([]*vault.EncryptedSecret, error)
- func (h *Handler) Execute(inputs UpsertSecretsInputs, method string, duration time.Duration, ...) error
- func (h *Handler) LogMSIGNextSteps(txData string) error
- func (h *Handler) PackAllowlistRequestTxData(reqDigestStr string, duration time.Duration) (string, error)
- func (h *Handler) ParseVaultGatewayResponse(method string, respBody []byte) error
- func (h *Handler) ResolveInputs() (UpsertSecretsInputs, error)
- func (h *Handler) ValidateInputs(inputs UpsertSecretsInputs) error
- type MockClientFactory
- func (m *MockClientFactory) GetSkipConfirmation() bool
- func (m *MockClientFactory) GetTxType() client.TxType
- func (m *MockClientFactory) NewCapabilitiesRegistryClient() (*client.CapabilitiesRegistryClient, error)
- func (m *MockClientFactory) NewWorkflowRegistryV2Client() (*client.WorkflowRegistryV2Client, error)
- type SecretItem
- type UpsertSecretsInputs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GatewayClient ¶
type HTTPClient ¶
type Handler ¶
type Handler struct {
Log *zerolog.Logger
ClientFactory client.Factory
SecretsFilePath string
PrivateKey *ecdsa.PrivateKey
OwnerAddress string
EnvironmentSet *environments.EnvironmentSet
Gw GatewayClient
}
func NewHandler ¶
NewHandler creates a new handler instance.
func (*Handler) EncryptSecrets ¶
func (h *Handler) EncryptSecrets(rawSecrets UpsertSecretsInputs) ([]*vault.EncryptedSecret, error)
EncryptSecrets takes the raw secrets and encrypts them, returning pointers.
func (*Handler) Execute ¶
func (h *Handler) Execute(inputs UpsertSecretsInputs, method string, duration time.Duration, ownerType string) error
Execute is a shared method for both 'create' and 'update' commands. It encapsulates the core logic of validation, encryption, and sending data.
func (*Handler) LogMSIGNextSteps ¶
func (*Handler) PackAllowlistRequestTxData ¶
func (h *Handler) PackAllowlistRequestTxData(reqDigestStr string, duration time.Duration) (string, error)
TODO: use TxType interface
func (*Handler) ParseVaultGatewayResponse ¶
ParseVaultGatewayResponse parses the JSON-RPC response, decodes the SignedOCRResponse payload into the appropriate proto type (CreateSecretsResponse, UpdateSecretsResponse, DeleteSecretsResponse), and logs one line per secret with id/owner/namespace/success/error.
func (*Handler) ResolveInputs ¶
func (h *Handler) ResolveInputs() (UpsertSecretsInputs, error)
ResolveInputs unmarshals the JSON string into the UpsertSecretsInputs struct.
func (*Handler) ValidateInputs ¶
func (h *Handler) ValidateInputs(inputs UpsertSecretsInputs) error
ValidateInputs validates the input structure.
type MockClientFactory ¶
func (*MockClientFactory) GetSkipConfirmation ¶
func (m *MockClientFactory) GetSkipConfirmation() bool
func (*MockClientFactory) GetTxType ¶
func (m *MockClientFactory) GetTxType() client.TxType
func (*MockClientFactory) NewCapabilitiesRegistryClient ¶
func (m *MockClientFactory) NewCapabilitiesRegistryClient() (*client.CapabilitiesRegistryClient, error)
func (*MockClientFactory) NewWorkflowRegistryV2Client ¶
func (m *MockClientFactory) NewWorkflowRegistryV2Client() (*client.WorkflowRegistryV2Client, error)
type SecretItem ¶
type SecretItem struct {
ID string `json:"id" validate:"required"`
Value string `json:"value" validate:"required"`
Namespace string `json:"namespace"`
}
SecretItem represents a single secret with its ID, value, and optional namespace.
type UpsertSecretsInputs ¶
type UpsertSecretsInputs []SecretItem
UpsertSecretsInputs holds the secrets passed to the CLI.