Code Monkey home page Code Monkey logo

Comments (7)

nivekus82 avatar nivekus82 commented on June 10, 2024 1

Sorry for my late answer. Thanks for your response, now it works just as expected. As you can see in my first post, i already tried the parameter "schemas", but i didn´t leave the sessionuser in square brackets behind the proxyuser in the user parameter.

Thanks, @mickeypearce and @carnifex82 , i appreciate your help

from oradew-vscode.

nivekus82 avatar nivekus82 commented on June 10, 2024

i just tried another way that works. i have an older database where the test succeded. the only difference is the authentification method. on my prod db i have to login per proxy user, on my older db per "normal" user.

is there any way to use the tool per proxy user login like user_name[proxy_user]

from oradew-vscode.

mickeypearce avatar mickeypearce commented on June 10, 2024

Hello,

I've never used proxy users, but it looks like oracle-nodedb supports proxy connections:

https://node-oracledb.readthedocs.io/en/latest/user_guide/connection_handling.html#pool-proxy-authentication

If it is of any help to you here is the oradew code for connections:

const getConnection = async (connCfg: IConnectionConfig) => {

Feel free to open a PR if you feel like it ....

from oradew-vscode.

nivekus82 avatar nivekus82 commented on June 10, 2024

thank you for your fast response.

i tried it like oracle-nodedb and the connection could be established. But the objects could not be downloaded.

i think the problem is the following query in db.ts:

 SELECT 
   owner, 
   object_id, 
   object_name, 
   object_type, 
   CAST(last_ddl_time AS TIMESTAMP) AS last_ddl_time, 
   status 
 FROM 
   all_objects 
 WHERE 
 upper(owner) = upper('proxy_user[session_user]')
   AND upper(object_type) = upper(nvoradewl(:objecttype, object_type)) 
   AND upper(object_name) = upper(nvl(:objectname, object_name)) 
    AND object_name NOT LIKE 'SYS_PLSQL%' 
 ; 

the owner notation with [] doesn´t deliver any result. maybe the correct way is to execute the select only with the session_user in the where-clause.

from oradew-vscode.

carnifex82 avatar carnifex82 commented on June 10, 2024

Only fixing this query wouldn't help. Apparently the issue is not the connection, but getting the correct objects - because oradew sees the owner equal to the user.

For a proxy auth you submit the username as following: proxy_user[session_user]. The objects that you access this way, are owned by the session_user. So in case of a proxy auth, oradew needs to either add a parameter in dbconfig.json and deal with it accordingly (extracting the owner from the user-string)

Or maybe easier: just plainly do it anytime when there are "[somestring]" detected in the username. There shouldn't be any side effects, since the square brackets are not valid characters in an oracle username (see )

from oradew-vscode.

mickeypearce avatar mickeypearce commented on June 10, 2024

Does your dbconfig.json looks something like the following example when you successfully connected ? Because schemas is intented for this puropse when you need to get objects for different user than the user for connection but it wasn't tested with proxy user.

{
  "DEV": {
    "connectString": "name in tnsnames",
    "users": [
      {
        "user": "proxy_user[session_user]", --user to connect
        "password": "user_password",
        "schemas": ["session_user"] --users to retrieve objects
      }
    ]
  }
}

from oradew-vscode.

mickeypearce avatar mickeypearce commented on June 10, 2024

Awesome, I didn't expect it to work out-of-the-box ...

from oradew-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.