From aaeea0cd89098ef1c2af46aae348cc1af45c3925 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 (main branch) * Card ID: CCT-69 (backport) (Cherry-picked from b70aaf80350b1143580eebde48953cc2809bd54c) --- src/rhsm/connection.py | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/rhsm/connection.py b/src/rhsm/connection.py index a1ed52b6c5..3a5a391616 100644 --- a/src/rhsm/connection.py +++ b/src/rhsm/connection.py @@ -1152,34 +1152,6 @@ def shutDown(self): def ping(self, username=None, password=None): return self.conn.request_get("/status/") - def getJWToken(self, cloud_id, metadata, signature): - """ - 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 - ) - def getCloudJWT(self, cloud_id: str, metadata: str, signature: str) -> Dict[str, Any]: """Obtain cloud JWT.