Added support for Oracle db connection (#12752)

* Added support for Oracle db connection

* Added changelog

* Fixed test

* Added test for role setting

* Skip full acceptance test in case of oracle db

* Fix db role test

* Update changelog

* Fix db role fields after rebase

* Added missing test
This commit is contained in:
Arnav Palnitkar 2021-10-11 09:20:23 -07:00 committed by GitHub
parent 308806eee3
commit d161bfe1a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 0 deletions

3
changelog/12752.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:feature
**Oracle DB in the UI**: Oracle DB connection is now supported in the UI
```

View File

@ -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' },
],
}
];
/**

View File

@ -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'],
@ -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'],
},
};

View File

@ -185,6 +185,27 @@ const connectionTests = [
.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}`);
},
},
];
module('Acceptance | secrets/database/*', function(hooks) {
@ -235,6 +256,11 @@ module('Acceptance | secrets/database/*', function(hooks) {
} else {
await connectionPage.connectionUrl(testCase.url);
}
// skip adding oracle db connection since plugin doesn't exists
if (testCase.plugin === 'oracle-database-plugin') {
testCase.requiredFields(assert, testCase.name);
continue;
}
testCase.requiredFields(assert, testCase.name);
await connectionPage.toggleVerify();
await connectionPage.save();

View File

@ -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