-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Backport UI: KV version 2 advanced secret updates to 1.15.x (#25235) #25238
Conversation
* Add obfuscation for JSON values on KV data view * Show JSON editor by default if secret data is complex, but do not disable JSON toggle * Add text object warning to kv object editor * a11y fix: do not disable show diff toggle * test and language cleanup * update language * Update tests for expected behavior * language! * Add changelog
@@ -27,6 +27,14 @@ | |||
<Icon @name="reload" /> | |||
</button> | |||
{{/if}} | |||
{{#if (and @allowObscure @readOnly)}} |
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.
From precursor work
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.
from precursor work
* @param obj object | ||
* @returns object | ||
*/ | ||
export function obfuscateData(obj) { |
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.
From precursor work
@@ -100,4 +100,25 @@ module('Integration | Component | json-editor', function (hooks) { | |||
assert.dom('.CodeMirror-code').hasText(`1${this.example}`, 'Example is restored'); | |||
assert.strictEqual(this.value, null, 'Value is cleared on restore example'); | |||
}); | |||
|
|||
test('obscure option works correctly', async function (assert) { |
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.
From precursor work
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.
From precursor work
Build Results: |
CI Results: |
@@ -0,0 +1,3 @@ | |||
```release-note:bug | |||
ui: Fix copy button not working on masked input when value is not a string |
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.
<Toggle | ||
@name="revealValues" | ||
@checked={{this.revealValues}} | ||
@size="small" |
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.
The original doesn't have @size="small"
- is this discrepancy intentional?
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.
Yes, in 1.15 Toggle
does not default to small size so we have to pass it
@@ -36,7 +36,7 @@ | |||
{{/if}} | |||
{{#if @allowCopy}} | |||
<CopyButton | |||
@clipboardText={{@value}} |
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.
FWIW I don't think this needs to be updated for CopyButton
just Hds::CopyButton
which was implemented in 1.16
It doesn't hurt to format 🤔 - mostly an FYI!
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.
I checked before I made this backport that it was still failing for objects. Otherwise I'd love to not need this backport 😂
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.
Nice catch!
Includes everything from #25235, as well as JSON obfuscation which was a precursor to the original work.
Defaults to obfuscated JSON view when complex, without disabling the JSON toggle
Shows warning when entering a complex secret value on non-JSON interface