oracle / ojdbc-extensions

The Oracle JDBC Driver Extensions include providers for centralized configuration or token providers for authentication with the DB.
Universal Permissive License v1.0
13 stars 5 forks source link

Accept db tools conn with proxy authentication #45

Closed norah-li closed 11 months ago

norah-li commented 11 months ago

In this upload, the provider can accept db tools connection with proxy authentication, only if username is set in proxy authentication, without password or roles.

Specifically, according to OCI docs, DatabaseToolsConnectionOracleDatabaseProxyClient has two direct known subclasses, which is DatabaseToolsConnectionOracleDatabaseProxyClientNoProxy, and DatabaseToolsConnectionOracleDatabaseProxyClientUserName.

If a db tools connection with proxy authentication is given, we can retrieve proxy authentication info from proxyClientUserName. Otherwise, we will get proxyClientNoProxy. Username is retrieved here and added to properties of the Connection. If retrieved password or roles are not null, an exception will be thrown.

Also README is updated in oci.

Please take a look.

ting-lan-wang commented 11 months ago

Looks good to me, thanks. Approved this PR while we should wait until the proxyAuthentication APIs become available in OCI SDK before we merge this branch.

Correct my comment above. The proxyAuthentication APIs are available in OCI Java SDK 3.28.1. Thanks @norah-li for reminding.