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

Added support for Oracle db connection #12752

Merged
merged 9 commits into from Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/12752.txt
@@ -0,0 +1,3 @@
```release-note:feature
arnav28 marked this conversation as resolved.
Show resolved Hide resolved
**Oracle DB in the UI**: Oracle DB connection is now supported in the UI
```
18 changes: 18 additions & 0 deletions ui/app/models/database/connection.js
Expand Up @@ -141,6 +141,24 @@ const AVAILABLE_PLUGIN_TYPES = [
{ attr: 'username_template', group: 'pluginConfig' },
],
},
{
value: 'oracle-database-plugin',
displayName: 'Oracle',
fields: [
{ attr: 'plugin_name' },
{ attr: 'name' },
{ attr: 'verify_connection' },
{ attr: 'password_policy' },
{ attr: 'connection_url', group: 'pluginConfig' },
{ attr: 'username', group: 'pluginConfig', show: false },
{ attr: 'password', group: 'pluginConfig', show: false },
{ attr: 'max_open_connections', group: 'pluginConfig' },
{ attr: 'max_idle_connections', group: 'pluginConfig' },
{ attr: 'max_connection_lifetime', group: 'pluginConfig' },
{ attr: 'username_template', group: 'pluginConfig' },
{ attr: 'root_rotation_statements', group: 'statements' },
],
}
];

/**
Expand Down
2 changes: 2 additions & 0 deletions ui/app/utils/database-role-fields.js
Expand Up @@ -13,6 +13,7 @@ export const STATEMENT_FIELDS = {
'mysql-rds-database-plugin': [],
'mysql-legacy-database-plugin': [],
'elasticsearch-database-plugin': [],
'oracle-database-plugin': [],
},
dynamic: {
default: ['creation_statements', 'revocation_statements', 'rollback_statements', 'renew_statements'],
Expand All @@ -23,6 +24,7 @@ export const STATEMENT_FIELDS = {
'mysql-rds-database-plugin': ['creation_statements', 'revocation_statements'],
'mysql-legacy-database-plugin': ['creation_statements', 'revocation_statements'],
'elasticsearch-database-plugin': ['creation_statement'],
'oracle-database-plugin': ['creation_statements', 'revocation_statements'],
},
};

Expand Down
26 changes: 25 additions & 1 deletion ui/tests/acceptance/secrets/backend/database/secret-test.js
Expand Up @@ -179,7 +179,27 @@ const connectionTests = [
assert
.dom('[data-test-input="max_connection_lifetime"]')
.exists(`Max connection lifetime exists for ${name}`);
assert.dom('[data-test-toggle-group="TLS options"]').exists('TLS options toggle exists');
hellobontempo marked this conversation as resolved.
Show resolved Hide resolved
assert
.dom('[data-test-input="root_rotation_statements"]')
.exists(`Root rotation statements exists for ${name}`);
},
},
{
name: 'oracle-connection',
plugin: 'oracle-database-plugin',
url: `{{username}}/{{password}}@localhost:1521/OraDoc.localhost`,
requiredFields: async (assert, name) => {
assert.dom('[data-test-input="username"]').exists(`Username field exists for ${name}`);
assert.dom('[data-test-input="password"]').exists(`Password field exists for ${name}`);
assert
.dom('[data-test-input="max_open_connections"]')
.exists(`Max open connections exists for ${name}`);
assert
.dom('[data-test-input="max_idle_connections"]')
.exists(`Max idle connections exists for ${name}`);
assert
.dom('[data-test-input="max_connection_lifetime"]')
.exists(`Max connection lifetime exists for ${name}`);
assert
.dom('[data-test-input="root_rotation_statements"]')
.exists(`Root rotation statements exists for ${name}`);
Expand Down Expand Up @@ -235,6 +255,10 @@ module('Acceptance | secrets/database/*', function(hooks) {
} else {
await connectionPage.connectionUrl(testCase.url);
}
if (testCase.plugin === 'oracle-database-plugin') {
hellobontempo marked this conversation as resolved.
Show resolved Hide resolved
testCase.requiredFields(assert, testCase.name);
continue;
}
testCase.requiredFields(assert, testCase.name);
await connectionPage.toggleVerify();
await connectionPage.save();
Expand Down
Expand Up @@ -55,6 +55,11 @@ const testCases = [
staticRoleFields: ['username', 'rotation_period'],
dynamicRoleFields: ['creation_statements', 'revocation_statements', 'ttl', 'max_ttl'],
},
{
pluginType: 'oracle-database-plugin',
staticRoleFields: ['username', 'rotation_period'],
dynamicRoleFields: ['creation_statements', 'revocation_statements', 'ttl', 'max_ttl'],
},
];

// used to calculate checks that fields do NOT show up
Expand Down