hashicorp / vault-plugin-secrets-azure

Vault Azure Secrets plugin
Mozilla Public License 2.0
26 stars 20 forks source link

Correctly use GetApplication with `ApplicationObjectID` instead of incorrect filter #200

Closed vinay-gopalan closed 4 months ago

vinay-gopalan commented 4 months ago

Overview

When performing the MSGraph SDK upgrade, the GetApplication method was mistranslated. It was expecting a clientID to be passed in, and it would then filter off of the client ID in order to fetch the Application. However, the actual usage of GetApplication is instead meant to use the ApplicationObjectID to query for the application. This can be seen on this line here, where GetApplication is only used when the ApplicationObjectID is a non-zero value.

This PR fixes the mistranslation, and correctly fetches the application based on the ApplicationObjectID instead of the Client ID.

Contributor Checklist

[ ] Add relevant docs to upstream Vault repository, or sufficient reasoning why docs won’t be added yet My Docs PR Link Example [ ] Add output for any tests not ran in CI to the PR description (eg, acceptance tests) [ ] Backwards compatible

gsantos-hc commented 4 months ago

As noted in #196: it'd be good to also rename clientId to objectId in the interface at the top of the file