{"id":1508,"library":"ibm-cloud-sdk-core","title":"IBM Cloud SDK Core Library","description":"The `ibm-cloud-sdk-core` library provides essential functionalities like authentication, request signing, and utility methods for Python SDKs targeting IBM Cloud services. It is actively maintained with frequent patch releases addressing security and bug fixes, and periodic minor releases introducing new features or authenticators.","status":"active","version":"3.24.4","language":"en","source_language":"en","source_url":"https://github.com/IBM/python-sdk-core","tags":["ibm","cloud","sdk","core","authentication","api"],"install":[{"cmd":"pip install ibm-cloud-sdk-core","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Used for HTTP requests, regularly updated for security fixes (e.g., CVEs).","package":"requests","optional":false},{"reason":"Required for JWT-based authentication, updated for security fixes.","package":"PyJWT","optional":false},{"reason":"Used for marking deprecated features, part of the core SDK infrastructure.","package":"Deprecated","optional":false}],"imports":[{"symbol":"IAMAuthenticator","correct":"from ibm_cloud_sdk_core.authenticators import IAMAuthenticator"},{"symbol":"BearerTokenAuthenticator","correct":"from ibm_cloud_sdk_core.authenticators import BearerTokenAuthenticator"},{"symbol":"NoAuthAuthenticator","correct":"from ibm_cloud_sdk_core.authenticators import NoAuthAuthenticator"},{"note":"Previously this utility might have been in `utils`, but it is now correctly in `authenticators`.","wrong":"from ibm_cloud_sdk_core.utils import get_authenticator_from_external_sources","symbol":"get_authenticator_from_external_sources","correct":"from ibm_cloud_sdk_core.authenticators import get_authenticator_from_external_sources"}],"quickstart":{"code":"import os\nfrom ibm_cloud_sdk_core.authenticators import IAMAuthenticator\nfrom ibm_cloud_sdk_core.base_service import BaseService\n\n# Instantiate an authenticator using an API key from environment variables\napi_key = os.environ.get('IBMCLOUD_API_KEY', 'YOUR_IBMCLOUD_API_KEY')\nservice_url = os.environ.get('IBMCLOUD_SERVICE_URL', 'https://api.example.com')\n\nif api_key == 'YOUR_IBMCLOUD_API_KEY':\n    print(\"Warning: Please set the IBMCLOUD_API_KEY environment variable or replace the placeholder.\")\n\nauthenticator = IAMAuthenticator(api_key)\n\n# Example of creating a dummy service client that uses this authenticator\nclass MyDummyService(BaseService):\n    DEFAULT_SERVICE_URL = service_url\n\n    def __init__(self, authenticator_instance):\n        super().__init__(\n            service_url=MyDummyService.DEFAULT_SERVICE_URL,\n            authenticator=authenticator_instance\n        )\n\n    def do_something(self):\n        # In a real SDK, this would make an API call\n        print(f\"Dummy service initialized with authenticator type: {type(self.authenticator).__name__}\")\n        print(f\"Service URL: {self.service_url}\")\n\n# Initialize and use the dummy service\ndummy_service = MyDummyService(authenticator)\ndummy_service.do_something()\n","lang":"python","description":"This quickstart demonstrates how to instantiate an `IAMAuthenticator` using an API key (preferably from an environment variable) and then shows how a `BaseService` (the foundation for IBM Cloud service clients) would integrate with this authenticator. Replace `YOUR_IBMCLOUD_API_KEY` and `https://api.example.com` with actual values for your service."},"warnings":[{"fix":"Update package name in `pip install` and all `import` statements. Review authenticator instantiation and configuration methods as per the latest documentation.","message":"Major breaking changes occurred between v2.x and v3.x, including a package rename from `ibm_sdk_core` to `ibm_cloud_sdk_core`. Direct imports and configuration methods for authenticators likely require updates.","severity":"breaking","affected_versions":">=3.0.0 (from 2.x)"},{"fix":"For service-specific interactions, identify and install the correct IBM Cloud Python SDK (e.g., `ibm-cos-sdk`, `ibm-watson`). Use `ibm-cloud-sdk-core` directly when you need advanced control over authentication or request handling for multiple services.","message":"The library primarily serves as a foundation for other IBM Cloud SDKs. While you can directly use its authenticators, for interacting with specific IBM Cloud services (e.g., Object Storage, Watson APIs), you will typically install and use the dedicated Python SDK for that service, which in turn depends on and uses `ibm-cloud-sdk-core`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the official documentation for the precise order of precedence. Generally, constructor arguments take highest priority, followed by environment variables, then configuration files. Explicitly setting values is often the clearest approach.","message":"Configuration for authenticators (API keys, service URLs) can be sourced from constructor arguments, environment variables (e.g., `IBMCLOUD_API_KEY`, `IBMCLOUD_AUTH_TYPE`), or configuration files. Understand the precedence rules to avoid unexpected authentication failures.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly update `ibm-cloud-sdk-core` to the latest minor or patch version using `pip install --upgrade ibm-cloud-sdk-core` to ensure you benefit from security fixes in its dependencies.","message":"The library frequently updates its dependencies (like `requests` and `PyJWT`) to address security vulnerabilities (CVEs). Older versions of `ibm-cloud-sdk-core` might pin to vulnerable versions of these indirect dependencies.","severity":"gotcha","affected_versions":"<3.24.4 (for PyJWT), <3.24.2 (for requests)"},{"fix":"Check the release notes for new authenticator features or deprecation warnings. Migrate to newer authenticator types or configurations when available to leverage new capabilities and ensure future compatibility.","message":"Older authenticator types or parameters might be deprecated in favor of new, more secure, or more flexible options. For example, `IAMAuthenticator` and `ContainerAuthenticator` have seen feature additions over time.","severity":"deprecated","affected_versions":"<3.24.0 (for MCSP V2 auth), <3.23.0 (for Code Engine workload support)"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}