Skip to content

Commit

Permalink
mod: include kid in test data
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Duffney <[email protected]>
  • Loading branch information
duffney committed Oct 25, 2024
1 parent 939a636 commit 75ade00
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions pkg/keymanagementprovider/azurekeyvault/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ func TestGetCertificates(t *testing.T) {
mockKvClient: &MockKvClient{
GetCertificateFunc: func(_ context.Context, _ string, _ string, _ string) (kv.CertificateBundle, error) {
return kv.CertificateBundle{
ID: to.StringPtr("https://testkv.vault.azure.net/certificates/cert1"),
ID: to.StringPtr("https://testkv.vault.azure.net/certificates/cert1"),
Kid: to.StringPtr("https://testkv.vault.azure.net/keys/key1"),
Attributes: &kv.CertificateAttributes{
Enabled: to.BoolPtr(true),
},
Expand All @@ -251,7 +252,8 @@ func TestGetCertificates(t *testing.T) {
mockKvClient: &MockKvClient{
GetCertificateFunc: func(_ context.Context, _ string, _ string, _ string) (kv.CertificateBundle, error) {
return kv.CertificateBundle{
ID: to.StringPtr("https://testkv.vault.azure.net/certificates/cert1"),
ID: to.StringPtr("https://testkv.vault.azure.net/certificates/cert1"),
Kid: to.StringPtr("https://testkv.vault.azure.net/keys/key1"),
Attributes: &kv.CertificateAttributes{
Enabled: to.BoolPtr(false),
},
Expand All @@ -260,6 +262,7 @@ func TestGetCertificates(t *testing.T) {
GetSecretFunc: func(_ context.Context, _ string, _ string, _ string) (kv.SecretBundle, error) {
return kv.SecretBundle{
ID: to.StringPtr("https://testkv.vault.azure.net/secrets/secret1"),
Kid: to.StringPtr("https://testkv.vault.azure.net/keys/key1"),
ContentType: to.StringPtr("application/x-pem-file"),
Attributes: &kv.SecretAttributes{
Enabled: to.BoolPtr(true),
Expand All @@ -274,7 +277,8 @@ func TestGetCertificates(t *testing.T) {
mockKvClient: &MockKvClient{
GetCertificateFunc: func(_ context.Context, _ string, _ string, _ string) (kv.CertificateBundle, error) {
return kv.CertificateBundle{
ID: to.StringPtr("https://testkv.vault.azure.net/certificates/cert1"),
ID: to.StringPtr("https://testkv.vault.azure.net/certificates/cert1"),
Kid: to.StringPtr("https://testkv.vault.azure.net/keys/key1"),
Attributes: &kv.CertificateAttributes{
Enabled: to.BoolPtr(true),
},
Expand All @@ -283,6 +287,7 @@ func TestGetCertificates(t *testing.T) {
GetSecretFunc: func(_ context.Context, _ string, _ string, _ string) (kv.SecretBundle, error) {
return kv.SecretBundle{
ID: to.StringPtr("https://testkv.vault.azure.net/secrets/secret1"),
Kid: to.StringPtr("https://testkv.vault.azure.net/keys/key1"),
ContentType: to.StringPtr("application/x-pem-file"),
Attributes: &kv.SecretAttributes{
Enabled: to.BoolPtr(true),
Expand All @@ -297,7 +302,8 @@ func TestGetCertificates(t *testing.T) {
mockKvClient: &MockKvClient{
GetCertificateFunc: func(_ context.Context, _ string, _ string, _ string) (kv.CertificateBundle, error) {
return kv.CertificateBundle{
ID: to.StringPtr("https://testkv.vault.azure.net/certificates/cert1"),
ID: to.StringPtr("https://testkv.vault.azure.net/certificates/cert1"),
Kid: to.StringPtr("https://testkv.vault.azure.net/keys/key1"),
Attributes: &kv.CertificateAttributes{
Enabled: to.BoolPtr(true),
},
Expand Down Expand Up @@ -352,6 +358,9 @@ func TestGetKeys(t *testing.T) {
mockKvClient: &MockKvClient{
GetKeyFunc: func(_ context.Context, _ string, _ string, _ string) (kv.KeyBundle, error) {
return kv.KeyBundle{
Key: &kv.JSONWebKey{
Kid: to.StringPtr("https://testkv.vault.azure.net/keys/key1"),
},
Attributes: &kv.KeyAttributes{
Enabled: to.BoolPtr(false),
},
Expand All @@ -365,6 +374,9 @@ func TestGetKeys(t *testing.T) {
mockKvClient: &MockKvClient{
GetKeyFunc: func(_ context.Context, _ string, _ string, _ string) (kv.KeyBundle, error) {
return kv.KeyBundle{
Key: &kv.JSONWebKey{
Kid: to.StringPtr("https://testkv.vault.azure.net/keys/key1"),
},
Attributes: &kv.KeyAttributes{
Enabled: to.BoolPtr(true),
},
Expand All @@ -379,6 +391,7 @@ func TestGetKeys(t *testing.T) {
GetKeyFunc: func(_ context.Context, _ string, _ string, _ string) (kv.KeyBundle, error) {
return kv.KeyBundle{
Key: &kv.JSONWebKey{
Kid: to.StringPtr("https://testkv.vault.azure.net/keys/key1"),
Kty: kv.RSA,
N: to.StringPtr(base64.StdEncoding.EncodeToString([]byte("n"))),
E: to.StringPtr(base64.StdEncoding.EncodeToString([]byte("e"))),
Expand Down

0 comments on commit 75ade00

Please sign in to comment.