diff --git a/.secrets.baseline b/.secrets.baseline index 400f98f6..171a5e19 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "package-lock.json|^.secrets.baseline$", "lines": null }, - "generated_at": "2023-03-17T19:47:10Z", + "generated_at": "2024-02-26T19:01:03Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -70,7 +70,7 @@ "hashed_secret": "d9e9019d9eb455a3d72a3bc252c26927bb148a10", "is_secret": false, "is_verified": false, - "line_number": 119, + "line_number": 118, "type": "Secret Keyword", "verified_result": null }, @@ -78,7 +78,7 @@ "hashed_secret": "32e8612d8ca77c7ea8374aa7918db8e5df9252ed", "is_secret": false, "is_verified": false, - "line_number": 163, + "line_number": 162, "type": "Secret Keyword", "verified_result": null } @@ -98,7 +98,7 @@ "hashed_secret": "e8fc807ce6fbcda13f91c5b64850173873de0cdc", "is_secret": false, "is_verified": false, - "line_number": 5220, + "line_number": 5683, "type": "Secret Keyword", "verified_result": null }, @@ -106,7 +106,7 @@ "hashed_secret": "fdee05598fdd57ff8e9ae29e92c25a04f2c52fa6", "is_secret": false, "is_verified": false, - "line_number": 5221, + "line_number": 5684, "type": "Secret Keyword", "verified_result": null } @@ -136,7 +136,7 @@ "hashed_secret": "d506bd5213c46bd49e16c634754ad70113408252", "is_secret": false, "is_verified": false, - "line_number": 7661, + "line_number": 7986, "type": "Secret Keyword", "verified_result": null }, @@ -144,7 +144,7 @@ "hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4", "is_secret": false, "is_verified": false, - "line_number": 11192, + "line_number": 11590, "type": "Secret Keyword", "verified_result": null } @@ -154,7 +154,7 @@ "hashed_secret": "d506bd5213c46bd49e16c634754ad70113408252", "is_secret": false, "is_verified": false, - "line_number": 1333, + "line_number": 1393, "type": "Secret Keyword", "verified_result": null }, @@ -162,7 +162,7 @@ "hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4", "is_secret": false, "is_verified": false, - "line_number": 6510, + "line_number": 8441, "type": "Secret Keyword", "verified_result": null } @@ -172,7 +172,7 @@ "hashed_secret": "8318df9ecda039deac9868adf1944a29a95c7114", "is_secret": false, "is_verified": false, - "line_number": 6733, + "line_number": 7053, "type": "Secret Keyword", "verified_result": null }, @@ -180,7 +180,7 @@ "hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4", "is_secret": false, "is_verified": false, - "line_number": 7882, + "line_number": 8245, "type": "Secret Keyword", "verified_result": null }, @@ -188,17 +188,27 @@ "hashed_secret": "b8e758b5ad59a72f146fcf065239d5c7b695a39a", "is_secret": false, "is_verified": false, - "line_number": 10064, + "line_number": 10479, "type": "Hex High Entropy String", "verified_result": null } ], + "test/unit/test_discovery_v2.py": [ + { + "hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4", + "is_secret": false, + "is_verified": false, + "line_number": 6882, + "type": "Secret Keyword", + "verified_result": null + } + ], "test/unit/test_speech_to_text_v1.py": [ { "hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4", "is_secret": false, "is_verified": false, - "line_number": 411, + "line_number": 432, "type": "Secret Keyword", "verified_result": null } diff --git a/README.md b/README.md index d09f490b..a0aea98d 100755 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ discovery = DiscoveryV1(version='2019-04-30', discovery.set_service_url('') ``` -### Username and password +#### Username and password ```python from ibm_watson import DiscoveryV1 @@ -187,7 +187,7 @@ discovery = DiscoveryV1(version='2019-04-30', authenticator=authenticator) discovery.set_service_url('') ``` -### No Authentication +#### No Authentication ```python from ibm_watson import DiscoveryV1 @@ -198,6 +198,21 @@ discovery = DiscoveryV1(version='2019-04-30', authenticator=authenticator) discovery.set_service_url('') ``` +### MCSP + +To use the SDK through a third party cloud provider (such as AWS), use the `MCSPAuthenticator`. This will require the base endpoint URL for the MCSP token service (e.g. https://iam.platform.saas.ibm.com) and an apikey. + +```python +from ibm_watson import AssistantV2 +from ibm_cloud_sdk_core.authenticators import MCSPAuthenticator + +# In the constructor, letting the SDK manage the token +authenticator = MCSPAuthenticator('apikey', 'token_service_endpoint') +assistant = AssistantV2(version='2023-06-15', + authenticator=authenticator) +assistant.set_service_url('') +``` + ## Python version Tested on Python 3.9, 3.10, and 3.11.