Vault Automation 7f9a3efe21
VAULT-39462 PKI observations (#9576) (#9747)
* VAULT-39462 PKI observations first draft?

* acme account

* acme account 2

* license

* belt and braces

* EST, and some tests

* more stuff

* SCEP

* key tests etc

* WIP reorganize code into an observe sub-package with interfaces

* make fmt

* fmt

* fmt

* empty file hehe

* copyright headers

* Update builtin/logical/pki/backend_cmpv2_ent_test.go



* Update builtin/logical/pki/backend_cmpv2_ent_test.go



* Update builtin/logical/pki/path_ocsp.go



* Update builtin/logical/pki/path_acme_order.go



* Update builtin/logical/pki/path_acme_order.go



* extra info

* add stored to cieps

* make fmt

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2025-09-30 12:34:07 -04:00

30 lines
839 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package observe
import (
"context"
"github.com/hashicorp/vault/sdk/logical"
)
type PluginObserve interface {
// RecordObservation is used to record observations through the plugin's observation system.
// It returns ErrNoObservations if the observation system has not been configured or enabled.
RecordObservation(ctx context.Context, observationType string, data map[string]interface{}) error
}
type PkiObserver interface {
RecordPKIObservation(ctx context.Context, req *logical.Request, observationType string, additionalMetadata ...AdditionalPKIMetadata)
}
type AdditionalPKIMetadata struct {
key string
value any
}
func NewAdditionalPKIMetadata(key string, value any) AdditionalPKIMetadata {
return AdditionalPKIMetadata{key: key, value: value}
}