feat: add methods to flatten credential entry and set secret value#30
Merged
feat: add methods to flatten credential entry and set secret value#30
Conversation
|
🤖 You did not bump the version, a release won't be created |
There was a problem hiding this comment.
Pull request overview
This PR adds new credential management methods and fixes several bugs in the DVLS Go SDK, including proper URL encoding for authentication credentials, enhanced error handling with status codes, and improved time parsing flexibility.
- Adds
ToCredentialMap()andSetCredentialSecret()methods toEntryfor credential manipulation - Enhances
RequestErrorwithStatusCodeandBodyfields and addsIsNotFound()helper function - Fixes authentication to properly escape special characters in credentials using
url.Values - Improves time parsing to support multiple RFC3339 formats
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| authentication.go | Switches from string formatting to url.Values for proper credential encoding, fixing bugs with special characters in passwords |
| dvls.go | Adds StatusCode and Body fields to RequestError, implements IsNotFound() helper, improves error messages with status codes, and fixes defer placement for response body closure |
| entry_credential.go | Adds ToCredentialMap() to flatten credential entries into maps and SetCredentialSecret() to update secret values |
| server.go | Replaces single time format with multiple fallback formats (RFC3339Nano, etc.) for more robust time parsing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dion-gionet
approved these changes
Dec 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
url.Values{}instead offmt.Sprintf. Same output, but now properly escapes special characters in credentials. Fixes a bug with complex password since they are randomly generated.StatusCodeandBodyfields. Existing code usingUrl/Errcontinues to work.Entry. Additive only.Entry. Additive only.