Introduce generic credential input fields#3101
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughAdds reusable generic input components for standard, secret, JSON, and YAML values; introduces structured text and file-drop utilities; integrates them into the secret dialog; and adds tests for rendering, synchronization, validation, parsing, and manifest updates. ChangesGeneric input and secret handling
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant GSecretDialogGeneric
participant GGenericInputField
participant SecretContext
User->>GSecretDialogGeneric: enter or edit secret text
GSecretDialogGeneric->>GGenericInputField: bind secretStringData
GGenericInputField-->>GSecretDialogGeneric: emit update:modelValue
GSecretDialogGeneric->>SecretContext: update secret manifest data
SecretContext-->>User: expose updated validation state
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/src/components/GGenericInputField.vue`:
- Around line 398-402: Update the secret-field implementation associated with
the hide-secret styling in GGenericInputField.vue to use a supported
input/control masking mechanism rather than relying solely on
-webkit-text-security. Ensure structured secret values remain masked across
older Firefox and Edge clients while preserving the existing hidden-toggle
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b4ef7d01-4ed1-48e0-8b18-29a5f7e377aa
📒 Files selected for processing (11)
frontend/__tests__/components/GGenericInputFields.spec.jsfrontend/__tests__/components/GSecretDialogGeneric.spec.jsfrontend/__tests__/composables/useStructuredTextField.spec.jsfrontend/__tests__/utils/index.spec.jsfrontend/__tests__/utils/inputFieldTypes.spec.jsfrontend/src/components/Credentials/GSecretDialogGeneric.vuefrontend/src/components/GGenericInputField.vuefrontend/src/components/GGenericInputFields.vuefrontend/src/composables/useStructuredTextField.jsfrontend/src/utils/index.jsfrontend/src/utils/inputFieldTypes.js
| 'json', | ||
| 'json-secret', |
There was a problem hiding this comment.
do we need both? (same applies for yaml)
How to categorize this PR?
/area usability
/area quality
/kind cleanup
What this PR does / why we need it:
This is the fourth preparatory refactoring extracted from #2824. It follows #3075, #3082, and #3085.
yaml-secretgeneric input field only in the already existing generic Secret dialog.credentialprop.This gives the generic field abstraction a real, reviewable consumer without migrating provider-specific dialogs at the same time. Provider-specific dialogs, routing, vendor field configuration, and
useSecretContextserialization remain unchanged.Which issue(s) this PR fixes:
Part of #2824.
Special notes for your reviewer:
For valid YAML mappings, Secret handling is unchanged: the parsed mapping is assigned through the existing
secretStringDataencoder and produces the same top-level, base64-encoded Secret.data. Integration tests cover both create and edit flows, including dotted keys such asserviceaccount.json, and verify that existing values are populated when editing.Empty, malformed, scalar, and array-root YAML is rejected before submission. Array-root YAML was accidentally accepted by the previous implementation and converted into numeric Secret keys.
The generic input fields component already contains logic for the follow-up PRs that will remove the provider specific dialogs. Eventually all / most providers will be handled by the GenericSecretDialog. Please review the logic even if not all of it is currently being used.
Validation:
make verify(including 76 frontend test files and 735 frontend tests).Release note:
Summary by CodeRabbit
New Features
Bug Fixes
Tests