Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KeyVault] - Include missing properties when reading SecretBundle #13614

Merged
merged 3 commits into from
Feb 5, 2021

Conversation

maorleger
Copy link
Member

What

  • Fix a bug where not all properties were correctly assigned when reading a secret's properties.
  • Add a test as a sort of change detector that ensures we don't accidentally miss currently available properties

Why

  • @jeremymeng noticed that listing secrets sample wasn't listing anything. This is because enabled
    wasn't being correctly set.

@ghost ghost added the KeyVault label Feb 5, 2021
@maorleger maorleger requested a review from jeremymeng February 5, 2021 01:06
enabled: attributes?.enabled,
notBefore: attributes?.notBefore,
recoverableDays: attributes?.recoverableDays,
recoveryLevel: attributes?.recoveryLevel,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woah! Thank you so much!

Before we had these transformers we used to use the spread operator a lot, and in my attempt to gain better control over it, I ended up missing these properties I think.

Should we see if we're having a similar issue in the other Key Vault clients?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Maybe we can merge this in and then I can separately check the other packages?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! I'll approve!

import { DeletedSecretBundle, SecretBundle } from "../../src/generated";
import { getSecretFromSecretBundle } from "../../src/transformations";

describe("Transformations", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this test 🌞

Copy link
Contributor

@sadasant sadasant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🌞

@maorleger maorleger merged commit e691ff9 into Azure:master Feb 5, 2021
@maorleger maorleger linked an issue Feb 5, 2021 that may be closed by this pull request
@maorleger maorleger deleted the 13611-fix-secret-parsing branch February 5, 2021 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeyVault secrets do not correctly set all properties
2 participants