Skip to content

Commit

Permalink
Remove API endpoint for automatic cloud registration v1
Browse files Browse the repository at this point in the history
* Card ID: CCT-67
  • Loading branch information
m-horky committed Jan 18, 2024
1 parent 9ec6895 commit cf046a0
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/rhsm/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1494,35 +1494,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.
Expand Down

0 comments on commit cf046a0

Please sign in to comment.