diff --git a/changelog/12752.txt b/changelog/12752.txt new file mode 100644 index 000000000..c5f1856b8 --- /dev/null +++ b/changelog/12752.txt @@ -0,0 +1,3 @@ +```release-note:feature +**Oracle DB in the UI**: Oracle DB connection is now supported in the UI +``` \ No newline at end of file diff --git a/ui/app/models/database/connection.js b/ui/app/models/database/connection.js index 86ba691e0..849d266b5 100644 --- a/ui/app/models/database/connection.js +++ b/ui/app/models/database/connection.js @@ -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' }, + ], + } ]; /** diff --git a/ui/app/utils/database-role-fields.js b/ui/app/utils/database-role-fields.js index b420644bf..3dbf19577 100644 --- a/ui/app/utils/database-role-fields.js +++ b/ui/app/utils/database-role-fields.js @@ -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'], }, }; diff --git a/ui/tests/acceptance/secrets/backend/database/secret-test.js b/ui/tests/acceptance/secrets/backend/database/secret-test.js index e1aca5bc1..8ab2744ba 100644 --- a/ui/tests/acceptance/secrets/backend/database/secret-test.js +++ b/ui/tests/acceptance/secrets/backend/database/secret-test.js @@ -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(); diff --git a/ui/tests/integration/components/database-role-setting-form-test.js b/ui/tests/integration/components/database-role-setting-form-test.js index f0b153bde..6d0ac9fb6 100644 --- a/ui/tests/integration/components/database-role-setting-form-test.js +++ b/ui/tests/integration/components/database-role-setting-form-test.js @@ -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