From abbddc214af5ba1b5842e2152f18698d8015ec72 Mon Sep 17 00:00:00 2001 From: Philipp Salvisberg Date: Sun, 26 Nov 2023 09:24:05 +0100 Subject: [PATCH] grant execute on javascript to user not to public --- test/dbconfig.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/dbconfig.ts b/test/dbconfig.ts index 8e9c748..96743cb 100644 --- a/test/dbconfig.ts +++ b/test/dbconfig.ts @@ -1,3 +1,19 @@ +/* +* Copyright 2023 Philipp Salvisberg +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + import oracledb from "oracledb"; let sysSession: oracledb.Connection; @@ -21,7 +37,6 @@ export const mleConfig: oracledb.ConnectionAttributes = { export async function createSessions(): Promise { sysSession = await oracledb.getConnection(sysConfig); await createUser(mleConfig); - await sysSession.execute("grant execute on javascript to public"); sysSession.close(); mleSession = await oracledb.getConnection(mleConfig); } @@ -35,6 +50,7 @@ async function createUser(config: oracledb.ConnectionAttributes): Promise quota 1m on users `); await sysSession.execute(`grant db_developer_role to ${config.user}`); + await sysSession.execute(`grant execute on javascript to ${config.user}`); } export async function closeSessions(): Promise {