@@ -2735,14 +2735,21 @@ Oracledb Methods
27352735
27362736.. function :: register_params_hook(hook_function)
27372737
2738- Registers a user hook function that will be called internally by
2738+ Registers a user parameter hook function that will be called internally by
27392739 python-oracledb prior to connection or pool creation. The hook function
27402740 accepts a copy of the parameters that will be used to create the pool or
27412741 standalone connection and may modify them. For example, the cloud native
27422742 authentication plugins modify the "access_token" parameter with a function
27432743 that will acquire the token using information found in the
27442744 "extra_auth_parms" parameter.
27452745
2746+ Multiple hooks may be registered. They will be invoked in order of
2747+ registration.
2748+
2749+ To unregister a user function, use :meth: `oracledb.unregister_params_hook `.
2750+
2751+ See :ref: `registerparamshook `.
2752+
27462753 .. note ::
27472754
27482755 This method is an extension to the DB API definition.
@@ -2751,7 +2758,7 @@ Oracledb Methods
27512758
27522759.. function :: register_password_type(password_type, hook_function)
27532760
2754- Registers a user hook function that will be called internally by
2761+ Registers a user password hook function that will be called internally by
27552762 python-oracledb when a password is supplied as a dictionary containing the
27562763 given ``password_type `` as the key "type". The hook function is called for
27572764 passwords specified as the ``password ``, ``newpassword `` and
@@ -2776,7 +2783,7 @@ Oracledb Methods
27762783
27772784.. function :: register_protocol(protocol, hook_function)
27782785
2779- Registers a user hook function that will be called internally by
2786+ Registers a user protocol hook function that will be called internally by
27802787 python-oracledb Thin mode prior to connection or pool creation. The hook
27812788 function will be invoked when :func: `oracledb.connect `,
27822789 :func: `oracledb.create_pool `, :meth: `oracledb.connect_async() `, or
@@ -2837,7 +2844,7 @@ Oracledb Methods
28372844 parameter set to *None * will result in a previously registered user function
28382845 being removed and the default behavior restored.
28392846
2840- See :ref: `connectionhook ` for more information.
2847+ See :ref: `registerprotocolhook ` for more information.
28412848
28422849 .. note ::
28432850
@@ -2878,8 +2885,8 @@ Oracledb Methods
28782885
28792886.. function :: unregister_params_hook(hook_function)
28802887
2881- Unregisters a user function that was earlier registered with a call to
2882- :meth: `oracledb.register_params_hook() `.
2888+ Unregisters a user parameter function that was earlier registered with a
2889+ call to :meth: `oracledb.register_params_hook() `.
28832890
28842891 .. note ::
28852892
@@ -4495,28 +4502,33 @@ python-oracledb. See :ref:`customplugins`. Note that the namespace
44954502``oracledb.plugins.ldap_support `` is reserved for future use by the
44964503python-oracledb project.
44974504
4505+ To use the python-oracledb plugins in your application, import using
4506+ ``import oracledb.plugins.<name of plugin> ``, for example::
4507+
4508+ import oracledb.plugins.oci_config_provider
4509+
44984510.. versionadded :: 3.0.0
44994511
45004512.. _configociplugin :
45014513
45024514Oracle Cloud Infrastructure (OCI) Object Storage Configuration Provider Plugin
45034515------------------------------------------------------------------------------
45044516
4505- ``oracledb.plugins. oci_config_provider `` is a plugin that provides access to
4517+ ``oci_config_provider `` is a plugin that can be imported to provide access to
45064518database connection credentials and application configuration information
45074519stored in the :ref: `OCI Object Storage configuration provider
45084520<ociobjstorageprovider>`.
45094521
4510- Importing this plugin defines and registers a pre-defined hook function with
4511- :meth: ` oracledb.register_protocol() ` to handle connection strings which have
4512- the prefix ``config-ociobject ``, see :ref: `OCI Object Storage connection
4513- strings <connstringoci>`. The hook function parses these connection strings and
4514- gets the stored configuration information. Python-oracledb then uses this
4515- information to connect to Oracle Database.
4522+ This plugin is implemented as a :ref: ` connection protocol hook function
4523+ <registerprotocolhook>` to handle connection strings which have the prefix
4524+ ``config-ociobject ``, see :ref: `OCI Object Storage connection strings
4525+ <connstringoci>`. The plugin parses these connection strings and gets the
4526+ stored configuration information. Python-oracledb then uses this information to
4527+ connect to Oracle Database.
45164528
45174529To use this plugin in python-oracledb Thick mode, you must set
4518- :attr: `defaults.thick_mode_dsn_passthrough ` to *False * or explicitly call
4519- :meth: `ConnectParams.parse_connect_string() `.
4530+ :attr: `defaults.thick_mode_dsn_passthrough ` to *False *. Alternatively use
4531+ :meth: `ConnectParams.parse_connect_string() `, see :ref: ` usingconnparams ` .
45204532
45214533See :ref: `ociobjstorageprovider ` for more information.
45224534
@@ -4527,21 +4539,21 @@ See :ref:`ociobjstorageprovider` for more information.
45274539Azure App Configuration Provider Plugin
45284540---------------------------------------
45294541
4530- ``oracledb.plugins. azure_config_provider `` is a plugin that provides access to
4542+ ``azure_config_provider `` is a plugin that can be imported to provide access to
45314543database connection credentials and application configuration information
45324544stored in the :ref: `Azure App Configuration provider
45334545<azureappstorageprovider>`.
45344546
4535- Importing this plugin defines and registers a pre-defined hook function with
4536- :meth: ` oracledb.register_protocol() ` to handle connection strings which have
4537- the prefix ``config-azure ``, see :ref: `Azure App Configuration connection
4538- strings <connstringazure>`. The hook function parses these connection strings
4539- and gets the stored configuration information. Python-oracledb then uses this
4540- information to connect to Oracle Database.
4547+ This plugin is implemented as a :ref: ` connection protocol hook function
4548+ <registerprotocolhook>` to handle connection strings which have the prefix
4549+ ``config-azure ``, see :ref: `Azure App Configuration connection strings
4550+ <connstringazure>`. The plugin parses these connection strings and gets the
4551+ stored configuration information. Python-oracledb then uses this information to
4552+ connect to Oracle Database.
45414553
45424554To use this plugin in python-oracledb Thick mode, you must set
4543- :attr: `defaults.thick_mode_dsn_passthrough ` to *False * or explicitly call
4544- :meth: `ConnectParams.parse_connect_string() `.
4555+ :attr: `defaults.thick_mode_dsn_passthrough ` to *False *. Alternatively use
4556+ :meth: `ConnectParams.parse_connect_string() `, see :ref: ` usingconnparams ` .
45454557
45464558See :ref: `azureappstorageprovider ` for more information.
45474559
@@ -4552,12 +4564,18 @@ See :ref:`azureappstorageprovider` for more information.
45524564Oracle Cloud Infrastructure (OCI) Cloud Native Authentication Plugin
45534565--------------------------------------------------------------------
45544566
4555- ``oci_tokens `` is a plugin that uses the Oracle Cloud Infrastructure (OCI)
4556- Software Development Kit (SDK) to generate access tokens when authenticating
4557- with OCI Identity and Access Management (IAM) token-based authentication.
4558- Importing this plugin defines and
4559- :meth: `registers <oracledb.register_params_hook()> `, the built-in hook function
4560- that generates OCI IAM access tokens. See :ref: `cloudnativeauthoci `.
4567+ ``oci_tokens `` is a plugin that can be imported to use the `Oracle Cloud
4568+ Infrastructure (OCI) Software Development Kit (SDK)
4569+ <https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm> `__ for
4570+ generating access tokens when authenticating with OCI Identity and Access
4571+ Management (IAM) token-based authentication.
4572+
4573+ This plugin is implemented as a :ref: `parameter hook function
4574+ <registerparamshook>` which uses the ``extra_auth_params `` parameter values of
4575+ your connection and pool creation calls to generate OCI IAM access tokens.
4576+ Python-oracledb then uses these tokens to connect to Oracle Database.
4577+
4578+ See :ref: `cloudnativeauthoci ` for more information.
45614579
45624580.. versionadded :: 3.0.0
45634581
@@ -4566,10 +4584,17 @@ that generates OCI IAM access tokens. See :ref:`cloudnativeauthoci`.
45664584Azure Cloud Native Authentication Plugin
45674585----------------------------------------
45684586
4569- ``azure_tokens `` is a plugin that uses the Microsoft Authentication Library
4570- (MSAL) to generate access tokens when authenticating with OAuth 2.0 token-based
4571- authentication. Importing this plugin defines and
4572- :meth: `registers <oracledb.register_params_hook()> `, the built-in hook function
4573- that generates OAuth2 access tokens. See :ref: `cloudnativeauthoauth `.
4587+ ``azure_tokens `` is a plugin that can be imported to use the `Microsoft
4588+ Authentication Library (MSAL)
4589+ <https://learn.microsoft.com/en-us/entra/msal/python/?view=msal-py- latest> `__
4590+ for generating access tokens when authenticating with OAuth 2.0 token-based
4591+ authentication.
4592+
4593+ This plugin is implemented as a :ref: `parameter hook function
4594+ <registerparamshook>` which uses the ``extra_auth_params `` parameter values of
4595+ your connection and pool creation calls to generate OAuth2 access tokens.
4596+ Python-oracledb then uses these tokens to connect to Oracle Database.
4597+
4598+ See :ref: `cloudnativeauthoauth ` for more information.
45744599
45754600.. versionadded :: 3.0.0
0 commit comments