-
Notifications
You must be signed in to change notification settings - Fork 2
feat: refactor credentials entry struct to support more sub types #23
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the credentials entry implementation to support multiple subtypes by introducing a generic Entry model, dynamic JSON (un)marshalling, and a unified EntryCredentialService.
- Introduce
Entrywith a factory-based JSON unmarshaller to handle various credential subtypes. - Migrate keyword parsing helpers into
utils.gofor reuse. - Replace the old
EntryUserCredentialServicewith the new genericEntryCredentialServiceand bump version to 0.12.0.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| utils.go | Adds keywordsToSlice and sliceToKeywords for parsing and formatting tag strings. |
| entries.go | Defines generic Entry type, EntryData interface, factories, and JSON (un)marshalling logic. |
| entry_credential.go | Implements EntryCredentialService supporting default and access-code subtypes. |
| authentication.go | Updates client initialization to use the new Credential service. |
| VERSION | Bumps package version from 0.11.0 to 0.12.0. |
Comments suppressed due to low confidence (4)
utils.go:9
- [nitpick] The variable name
spacedTagis ambiguous; consider renaming it to something likeinQuotesorinsideQuotefor clearer intent.
var spacedTag bool
utils.go:28
- Consider adding unit tests for
sliceToKeywordsto verify correct quoting behavior for tags that contain spaces.
func sliceToKeywords(kw []string) string {
entry_credential.go:102
- Typo in function name:
Enpointshould beEndpointto match the constantentryPublicEndpoint.
func entryPublicEnpointReplacer(vaultId string, entryId string) string {
entry_credential.go:107
- Typo in function name:
Enpointshould beEndpointto match the constantentryBasePublicEndpoint.
func entryPublicBaseEnpointReplacer(vaultId string) string {
rbstp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Added support for all these subtypes: