mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
Add acme challenge validation engine (#20221)
* Allow creating storageContext with timeout Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com> * Add challenge validation engine to ACME Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com> * Initialize the ACME challenge validation engine Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com> * Trigger challenge validation on endpoint submission Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com> * Fix GetKeyThumbprint to use raw base64 Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com> * Point at localhost for testing Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com> * Add cleanup of validation engine Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com> --------- Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
This commit is contained in:
@@ -227,6 +227,7 @@ func Backend(conf *logical.BackendConfig) *backend {
|
||||
InitializeFunc: b.initialize,
|
||||
Invalidate: b.invalidate,
|
||||
PeriodicFunc: b.periodicFunc,
|
||||
Clean: b.cleanup,
|
||||
}
|
||||
|
||||
// Add ACME paths to backend
|
||||
@@ -419,6 +420,11 @@ func (b *backend) initialize(ctx context.Context, _ *logical.InitializationReque
|
||||
return err
|
||||
}
|
||||
|
||||
err = b.acmeState.Initialize(b, sc)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Initialize also needs to populate our certificate and revoked certificate count
|
||||
err = b.initializeStoredCertificateCounts(ctx)
|
||||
if err != nil {
|
||||
@@ -430,6 +436,10 @@ func (b *backend) initialize(ctx context.Context, _ *logical.InitializationReque
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *backend) cleanup(_ context.Context) {
|
||||
b.acmeState.validator.Closing <- struct{}{}
|
||||
}
|
||||
|
||||
func (b *backend) initializePKIIssuersStorage(ctx context.Context) error {
|
||||
// Grab the lock prior to the updating of the storage lock preventing us flipping
|
||||
// the storage flag midway through the request stream of other requests.
|
||||
|
||||
Reference in New Issue
Block a user