mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 18:17:55 +00:00
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:
3
changelog/12752.txt
Normal file
3
changelog/12752.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
```release-note:feature
|
||||||
|
**Oracle DB in the UI**: Oracle DB connection is now supported in the UI
|
||||||
|
```
|
||||||
@@ -141,6 +141,24 @@ const AVAILABLE_PLUGIN_TYPES = [
|
|||||||
{ attr: 'username_template', group: 'pluginConfig' },
|
{ 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' },
|
||||||
|
],
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export const STATEMENT_FIELDS = {
|
|||||||
'mysql-rds-database-plugin': [],
|
'mysql-rds-database-plugin': [],
|
||||||
'mysql-legacy-database-plugin': [],
|
'mysql-legacy-database-plugin': [],
|
||||||
'elasticsearch-database-plugin': [],
|
'elasticsearch-database-plugin': [],
|
||||||
|
'oracle-database-plugin': [],
|
||||||
},
|
},
|
||||||
dynamic: {
|
dynamic: {
|
||||||
default: ['creation_statements', 'revocation_statements', 'rollback_statements', 'renew_statements'],
|
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-rds-database-plugin': ['creation_statements', 'revocation_statements'],
|
||||||
'mysql-legacy-database-plugin': ['creation_statements', 'revocation_statements'],
|
'mysql-legacy-database-plugin': ['creation_statements', 'revocation_statements'],
|
||||||
'elasticsearch-database-plugin': ['creation_statement'],
|
'elasticsearch-database-plugin': ['creation_statement'],
|
||||||
|
'oracle-database-plugin': ['creation_statements', 'revocation_statements'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -185,6 +185,27 @@ const connectionTests = [
|
|||||||
.exists(`Root rotation statements exists for ${name}`);
|
.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) {
|
module('Acceptance | secrets/database/*', function(hooks) {
|
||||||
@@ -235,6 +256,11 @@ module('Acceptance | secrets/database/*', function(hooks) {
|
|||||||
} else {
|
} else {
|
||||||
await connectionPage.connectionUrl(testCase.url);
|
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);
|
testCase.requiredFields(assert, testCase.name);
|
||||||
await connectionPage.toggleVerify();
|
await connectionPage.toggleVerify();
|
||||||
await connectionPage.save();
|
await connectionPage.save();
|
||||||
|
|||||||
@@ -55,6 +55,11 @@ const testCases = [
|
|||||||
staticRoleFields: ['username', 'rotation_period'],
|
staticRoleFields: ['username', 'rotation_period'],
|
||||||
dynamicRoleFields: ['creation_statements', 'revocation_statements', 'ttl', 'max_ttl'],
|
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
|
// used to calculate checks that fields do NOT show up
|
||||||
|
|||||||
Reference in New Issue
Block a user