Skip to content

.NET SDK: finish the app bind when GetFolders is the first call (KSM-1044) - #1328

Open
stas-schaller wants to merge 1 commit into
release/sdk/dotnet/core/v18.0.0from
feature/KSM-1044-dotnet-getfolders-first-call-bind
Open

stas-schaller wants to merge 1 commit into
release/sdk/dotnet/core/v18.0.0from
feature/KSM-1044-dotnet-getfolders-first-call-bind

Conversation

@stas-schaller

Copy link
Copy Markdown
Collaborator

Summary

.NET SDK: GetFolders() now finishes the app binding when it is the first call on a freshly bound application.
Before this change, GetFolders() stored the app key from the binding reply but did not send the follow-up request that GetSecrets() sends, so the server did not complete the binding.

Changes

Fixed

  • After a binding reply, GetFolders() sends one more get_folders request without the public key, as GetSecrets2() does. A write right after a first GetFolders() call can now succeed (KSM-1044).
  • The first reply already holds the folders, so a failed follow-up request does not fail the call. The log line holds the exception type only, because a server error body can echo request data (KSM-1044).

Reading encryptedAppKey from the binding reply was already in place.
GetFolders() after the first call sends one request, as before.

Testing

cd sdk/dotNet && dotnet test SecretsManager.Test.Core --filter "FullyQualifiedName~GetFoldersFirstCallBind"

The test scripts a binding reply and checks the stored keys, that two requests go out with the second one lacking the public key, and that a later call sends one request.
It fails if the follow-up request is removed, and it fails if the app key is no longer stored.
It runs offline, so it does not check a CreateSecret2 call against a live server.

Breaking Changes

None.

Related Issues

  • Jira: KSM-1044

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant