-
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
UI: Decode database connection_url
#29114
Conversation
CI Results: |
Build Results: |
@@ -29,6 +29,16 @@ export default RESTSerializer.extend({ | |||
...payload.data, | |||
...payload.data.connection_details, | |||
}; | |||
|
|||
// connection_details are spread above into the main body of response so we can remove redundant data | |||
delete response.connection_details; |
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.
This was some cleanup, but i can remove if folks are worried about regressions. I searched globally for any use of connection_details
or connectionDetails
related to databases and didn't come across anything.
@@ -337,9 +339,11 @@ module('Acceptance | secrets/database/*', function (hooks) { | |||
await visit('/vault/secrets'); | |||
}); | |||
} | |||
test('database connection create and edit: vault-plugin-database-oracle', async function (assert) { | |||
|
|||
// keep oracle as separate test because it relies on an external plugin that isn't rolled into the vault binary |
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.
great 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.
Great problem solving and fixing!
connection_url
connection_url
* decode url in the serializer for oracle connection_url * add serializer test * add test for oracle * add test back, remove decode-url helper * update comment and test * link jiras VAULT-32830 VAULT-29785 * add changelog * add test
Description
We don't have any enterprise only plugins that I'm aware of, but ran enterprise tests just in case ✅
The API returns the oracle (and postgresql)
connection_url
encoded, but for the UI to pass around data correctly (for viewing and editing) we need to decode it. While we added a helper a while ago to decode the url for display (#23695), submitting any updates to the connection failed because the form submitted the unencodedconnection_url
. Now when the request is returned from the server, we interrupt it and decode the uri.This started failing in 1.16, previous
POST
requests from 1.15.x show only the updated field being submitted. I suspect during an ember upgrade something changed internally in themodel.save()
method so now all, changed, model parameters are submitted instead of just the updated values. Submitting all of the form inputs is our current form pattern (unless we’re specifically performing a patch) so I didn't dig into reverting this behavior. Decoding the uri seemed like the more reliable change moving forward.API response
Failed save
Notice the unencoded url in the
Connection URL
inputWith fix 🔧
TODO only if you're a HashiCorp employee
backport/
label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x
, but older release branches will bebackport/ent/x.x.x+ent
.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.