Fix GPG ID lookup and remove hardcoded test credentials#2274
Conversation
…2263) Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
…teFiles Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
… in GetGpgId Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
There was a problem hiding this comment.
This is incorrect. This is going to do a top-down walk from the StoreRoot looking for any .gpg-id file.
We should instead be searching UP from the full credential path looking for the closest .gpg-id. Otherwise doing the top-down walk could result in us picking an incorrect GPG identity for the given credential.
We must align the behaviour with GNU Pass.
…behaviour Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
…asswords Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
mjcheetham
left a comment
There was a problem hiding this comment.
Last request to simplify one of the tests, but this is a good direction now!
| return storePath; | ||
| } | ||
|
|
||
| private static string InitializePasswordStoreWithGpgIdInSubdirectory(TestFileSystem fs, TestGpg gpg, string subdirectory) |
There was a problem hiding this comment.
This method is now only used in one test. Can we inline this in the GnuPassCredentialStore_ReadWriteDelete_GpgIdInSubdirectory test, so that it matches the other test (GnuPassCredentialStore_WriteCredential_MultipleGpgIds_UsesNearestGpgId) that does all the store/.gpg-id setup in the test method?
There was a problem hiding this comment.
Done in b641577. The InitializePasswordStoreWithGpgIdInSubdirectory helper has been removed and its logic inlined directly into GnuPassCredentialStore_ReadWriteDelete_GpgIdInSubdirectory, matching the style of the MultipleGpgIds test.
Co-authored-by: mjcheetham <5658207+mjcheetham@users.noreply.github.com>
**Changes:** - Workload Identity Federation for Azure Repos (#2297) - Git config caching to reduce git process calls - #2268 - #2296 - #2298 - Dark theme support for OAuth authentication response pages (#2325) - Allow installing on Azure Linux (#2269) - Fix GPG ID lookup for `.gpg-id` in subdirectories (#2274) - Fix CS0121 `string.Split` call ambiguity with .NET 8.0 (#2287) - Fix SYSLIB0057 warning for `X509Certificate2Collection.Import` (#2326) - Fix several small bugs (#2303) - Migrate to .NET 10 (Mac/Linux) and adopt Central Package Management (#2313) - Bump `Tmds.DBus.Protocol` from 0.16.0 to 0.21.3 (#2316) - Azure Pipelines: specify `pool.hostArchitecture` correctly (#2323) - Documentation updates - #2283 - #2299 - Actions dependency updates - #2242 - #2271 - #2272 - #2282 - #2301 - #2315

GetGpgIdwalk-up logic (previous session)"letmein123"hardcoded fake password withGuid.NewGuid().ToString("N")in new testsInitializePasswordStoreWithGpgIdInSubdirectoryhelper directly intoGnuPassCredentialStore_ReadWriteDelete_GpgIdInSubdirectorytest (per reviewer request)✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.