mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00:00
backport of commit 464b9de169 (#20344)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
This commit is contained in:
committed by
GitHub
parent
2b244b4327
commit
d63cc54647
@@ -4939,12 +4939,13 @@ func TestIssuanceTTLs(t *testing.T) {
|
||||
})
|
||||
require.Error(t, err, "expected issuance to fail due to longer default ttl than cert ttl")
|
||||
|
||||
resp, err = CBWrite(b, s, "issuer/root", map[string]interface{}{
|
||||
"issuer_name": "root",
|
||||
resp, err = CBPatch(b, s, "issuer/root", map[string]interface{}{
|
||||
"leaf_not_after_behavior": "permit",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, resp)
|
||||
require.NotNil(t, resp.Data)
|
||||
require.Equal(t, resp.Data["leaf_not_after_behavior"], "permit")
|
||||
|
||||
_, err = CBWrite(b, s, "issue/local-testing", map[string]interface{}{
|
||||
"common_name": "testing",
|
||||
@@ -4957,6 +4958,8 @@ func TestIssuanceTTLs(t *testing.T) {
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, resp)
|
||||
require.NotNil(t, resp.Data)
|
||||
require.Equal(t, resp.Data["leaf_not_after_behavior"], "truncate")
|
||||
|
||||
_, err = CBWrite(b, s, "issue/local-testing", map[string]interface{}{
|
||||
"common_name": "testing",
|
||||
|
||||
@@ -601,7 +601,7 @@ func (b *backend) pathPatchIssuer(ctx context.Context, req *logical.Request, dat
|
||||
}
|
||||
|
||||
// Leaf Not After Changes
|
||||
rawLeafBehaviorData, ok := data.GetOk("leaf_not_after_behaivor")
|
||||
rawLeafBehaviorData, ok := data.GetOk("leaf_not_after_behavior")
|
||||
if ok {
|
||||
rawLeafBehavior := rawLeafBehaviorData.(string)
|
||||
var newLeafBehavior certutil.NotAfterBehavior
|
||||
|
||||
3
changelog/20341.txt
Normal file
3
changelog/20341.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
secrets/pki: Fix patching of leaf_not_after_behavior on issuers.
|
||||
```
|
||||
Reference in New Issue
Block a user