@@ -2735,14 +2735,21 @@ Oracledb Methods
2735
2735
2736
2736
.. function :: register_params_hook(hook_function)
2737
2737
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
2739
2739
python-oracledb prior to connection or pool creation. The hook function
2740
2740
accepts a copy of the parameters that will be used to create the pool or
2741
2741
standalone connection and may modify them. For example, the cloud native
2742
2742
authentication plugins modify the "access_token" parameter with a function
2743
2743
that will acquire the token using information found in the
2744
2744
"extra_auth_parms" parameter.
2745
2745
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
+
2746
2753
.. note ::
2747
2754
2748
2755
This method is an extension to the DB API definition.
@@ -2751,7 +2758,7 @@ Oracledb Methods
2751
2758
2752
2759
.. function :: register_password_type(password_type, hook_function)
2753
2760
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
2755
2762
python-oracledb when a password is supplied as a dictionary containing the
2756
2763
given ``password_type `` as the key "type". The hook function is called for
2757
2764
passwords specified as the ``password ``, ``newpassword `` and
@@ -2776,7 +2783,7 @@ Oracledb Methods
2776
2783
2777
2784
.. function :: register_protocol(protocol, hook_function)
2778
2785
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
2780
2787
python-oracledb Thin mode prior to connection or pool creation. The hook
2781
2788
function will be invoked when :func: `oracledb.connect `,
2782
2789
:func: `oracledb.create_pool `, :meth: `oracledb.connect_async() `, or
@@ -2837,7 +2844,7 @@ Oracledb Methods
2837
2844
parameter set to *None * will result in a previously registered user function
2838
2845
being removed and the default behavior restored.
2839
2846
2840
- See :ref: `connectionhook ` for more information.
2847
+ See :ref: `registerprotocolhook ` for more information.
2841
2848
2842
2849
.. note ::
2843
2850
@@ -2878,8 +2885,8 @@ Oracledb Methods
2878
2885
2879
2886
.. function :: unregister_params_hook(hook_function)
2880
2887
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() `.
2883
2890
2884
2891
.. note ::
2885
2892
@@ -4495,28 +4502,33 @@ python-oracledb. See :ref:`customplugins`. Note that the namespace
4495
4502
``oracledb.plugins.ldap_support `` is reserved for future use by the
4496
4503
python-oracledb project.
4497
4504
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
+
4498
4510
.. versionadded :: 3.0.0
4499
4511
4500
4512
.. _configociplugin :
4501
4513
4502
4514
Oracle Cloud Infrastructure (OCI) Object Storage Configuration Provider Plugin
4503
4515
------------------------------------------------------------------------------
4504
4516
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
4506
4518
database connection credentials and application configuration information
4507
4519
stored in the :ref: `OCI Object Storage configuration provider
4508
4520
<ociobjstorageprovider>`.
4509
4521
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.
4516
4528
4517
4529
To 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 ` .
4520
4532
4521
4533
See :ref: `ociobjstorageprovider ` for more information.
4522
4534
@@ -4527,21 +4539,21 @@ See :ref:`ociobjstorageprovider` for more information.
4527
4539
Azure App Configuration Provider Plugin
4528
4540
---------------------------------------
4529
4541
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
4531
4543
database connection credentials and application configuration information
4532
4544
stored in the :ref: `Azure App Configuration provider
4533
4545
<azureappstorageprovider>`.
4534
4546
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.
4541
4553
4542
4554
To 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 ` .
4545
4557
4546
4558
See :ref: `azureappstorageprovider ` for more information.
4547
4559
@@ -4552,12 +4564,18 @@ See :ref:`azureappstorageprovider` for more information.
4552
4564
Oracle Cloud Infrastructure (OCI) Cloud Native Authentication Plugin
4553
4565
--------------------------------------------------------------------
4554
4566
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.
4561
4579
4562
4580
.. versionadded :: 3.0.0
4563
4581
@@ -4566,10 +4584,17 @@ that generates OCI IAM access tokens. See :ref:`cloudnativeauthoci`.
4566
4584
Azure Cloud Native Authentication Plugin
4567
4585
----------------------------------------
4568
4586
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.
4574
4599
4575
4600
.. versionadded :: 3.0.0
0 commit comments