mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-25 16:41:08 +02:00
Add subject/authority key id to cert metadata
This commit is contained in:
parent
2d13b41fef
commit
a7ed66a90b
@ -9,6 +9,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/hashicorp/vault/helper/certutil"
|
||||||
"github.com/hashicorp/vault/logical"
|
"github.com/hashicorp/vault/logical"
|
||||||
"github.com/hashicorp/vault/logical/framework"
|
"github.com/hashicorp/vault/logical/framework"
|
||||||
)
|
)
|
||||||
@ -67,8 +68,10 @@ func (b *backend) pathLogin(
|
|||||||
Policies: matched.Entry.Policies,
|
Policies: matched.Entry.Policies,
|
||||||
DisplayName: matched.Entry.DisplayName,
|
DisplayName: matched.Entry.DisplayName,
|
||||||
Metadata: map[string]string{
|
Metadata: map[string]string{
|
||||||
"cert_name": matched.Entry.Name,
|
"cert_name": matched.Entry.Name,
|
||||||
"common_name": clientCerts[0].Subject.CommonName,
|
"common_name": clientCerts[0].Subject.CommonName,
|
||||||
|
"subject_key_id": certutil.GetOctalFormatted(clientCerts[0].SubjectKeyId, ":"),
|
||||||
|
"authority_key_id": certutil.GetOctalFormatted(clientCerts[0].AuthorityKeyId, ":"),
|
||||||
},
|
},
|
||||||
LeaseOptions: logical.LeaseOptions{
|
LeaseOptions: logical.LeaseOptions{
|
||||||
Renewable: true,
|
Renewable: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user