From 85a3440da861f0e79022fe95d3fcb732ed4dca27 Mon Sep 17 00:00:00 2001 From: mhorky Date: Mon, 15 Jan 2024 16:12:54 +0100 Subject: [PATCH] Remove API endpoint for automatic cloud registration v1 * Card ID: CCT-67 --- src/rhsm/connection.py | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/src/rhsm/connection.py b/src/rhsm/connection.py index eac255e84a..9f4a21364b 100644 --- a/src/rhsm/connection.py +++ b/src/rhsm/connection.py @@ -1489,35 +1489,6 @@ def has_capability(self, capability: str) -> bool: def ping(self, *args, **kwargs) -> Any: return self.conn.request_get("/status/", description=_("Checking connection status")) - def getJWToken(self, cloud_id: str, metadata: str, signature: str) -> Any: - """ - When automatic registration is enabled in rhsm.conf and it was possible - to gather cloud metadata, then it is possible to try to get JSON Web Token - for automatic registration. When candlepin does not provide automatic - registration, then raise exception. - :param cloud_id: ID of cloud provider, e.g. "aws", "azure", "gcp" - :param metadata: string with base64 encoded metadata - :param signature: string with base64 encoded signature - :return: string with JWT - """ - params = { - "type": cloud_id, - "metadata": metadata, - "signature": signature, - } - # "Accept" http header has to be text/plain, because candlepin return - # token as simple text and it is not wrapped in json document - headers = { - "Content-type": "application/json", - "Accept": "text/plain", - } - return self.conn.request_post( - method="/cloud/authorize", - params=params, - headers=headers, - description=_("Fetching cloud token"), - ) - def get_cloud_jwt(self, cloud_id: str, metadata: str, signature: str) -> Dict[str, Any]: """Obtain cloud JWT.