Skip to content
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 1.7.1: Add root rotation statements support to database secret engine connection #11409

Merged
merged 3 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/11404.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: Add root rotation statements support to appropriate database secret engine plugins
```
4 changes: 3 additions & 1 deletion ui/app/models/database/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const AVAILABLE_PLUGIN_TYPES = [
{ attr: 'connection_url', group: 'pluginConfig' },
{ attr: 'write_concern' },
{ attr: 'creation_statements' },
{ attr: 'root_rotation_statements', group: 'statements' },
],
},
];
Expand Down Expand Up @@ -126,6 +127,7 @@ export default Model.extend({
'write_concern',
'verify_connection',
'allowed_roles',
'root_rotation_statements',
];
return expandAttributeMeta(this, f);
}),
Expand All @@ -134,7 +136,7 @@ export default Model.extend({
if (!this.plugin_name) {
return null;
}
let groups = [{ default: ['username', 'password', 'write_concern'] }];
let groups = [{ default: ['username', 'password', 'write_concern', 'root_rotation_statements'] }];
// TODO: Get plugin options based on plugin
groups.push({
'TLS options': ['tls', 'tls_ca'],
Expand Down
6 changes: 5 additions & 1 deletion ui/app/serializers/database/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ export default RESTSerializer.extend({
return connections;
}
// Query single record response:
return {
let response = {
id: payload.id,
name: payload.id,
backend: payload.backend,
...payload.data,
...payload.data.connection_details,
};
if (payload.data.root_credentials_rotate_statements) {
response.root_rotation_statements = payload.data.root_credentials_rotate_statements;
}
return response;
},

normalizeResponse(store, primaryModelClass, payload, id, requestType) {
Expand Down