MCPcopy
hub / github.com/gitcoinco/web / reset_token

Function reset_token

app/git/utils.py:197–213  ·  view source on GitHub ↗

Reset the provided token. Args: access_token (str): The Github OAuth token. Returns: str: The new Github OAuth token.

(oauth_token)

Source from the content-addressed store, hash-verified

195
196
197def reset_token(oauth_token):
198 """Reset the provided token.
199
200 Args:
201 access_token (str): The Github OAuth token.
202
203 Returns:
204 str: The new Github OAuth token.
205
206 """
207 _params = build_auth_dict(oauth_token)
208 _auth = (_params['client_id'], _params['client_secret'])
209 url = TOKEN_URL.format(**_params)
210 response = requests.post(url, auth=_auth, headers=HEADERS)
211 if response.status_code == 200:
212 return response.json().get('token')
213 return ''
214
215
216def get_auth_url(redirect_uri='/'):

Callers 1

test_reset_tokenMethod · 0.90

Calls 1

build_auth_dictFunction · 0.85

Tested by 1

test_reset_tokenMethod · 0.72