MCPcopy Create free account
hub / github.com/mlco2/codecarbon / _refresh_tokens

Function _refresh_tokens

codecarbon/cli/auth.py:128–140  ·  view source on GitHub ↗

Exchange a refresh token for a new token set via the OIDC token endpoint.

(refresh_token: str)

Source from the content-addressed store, hash-verified

126
127
128def _refresh_tokens(refresh_token: str) -> dict:
129 """Exchange a refresh token for a new token set via the OIDC token endpoint."""
130 discovery = _discover_endpoints()
131 resp = requests.post(
132 discovery["token_endpoint"],
133 data={
134 "grant_type": "refresh_token",
135 "refresh_token": refresh_token,
136 "client_id": AUTH_CLIENT_ID,
137 },
138 )
139 resp.raise_for_status()
140 return resp.json()
141
142
143# ── Public API ──────────────────────────────────────────────────────

Callers 1

get_access_tokenFunction · 0.85

Calls 2

_discover_endpointsFunction · 0.85
jsonMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…