MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / _token_request

Function _token_request

e2e/python/oidc/oidc_auth_test.py:87–93  ·  view source on GitHub ↗

POST to the Keycloak token endpoint and return the access token.

(data: dict[str, str])

Source from the content-addressed store, hash-verified

85
86
87def _token_request(data: dict[str, str]) -> str:
88 """POST to the Keycloak token endpoint and return the access token."""
89 encoded = urllib.parse.urlencode(data).encode()
90 req = urllib.request.Request(TOKEN_ENDPOINT, data=encoded)
91 with urllib.request.urlopen(req, timeout=10) as resp:
92 body = json.loads(resp.read())
93 return body["access_token"]
94
95
96def _get_token(

Callers 2

_get_tokenFunction · 0.85
_get_ci_tokenFunction · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected