(code: str)
| 48 | |
| 49 | @app.get(CONFIG["APP_CALLBACK_PATH"], response_class=HTMLResponse) |
| 50 | def oauth_callback(code: str): |
| 51 | resp = requests.post(CONFIG['TOKEN_URL'], |
| 52 | auth=HTTPBasicAuth(CONFIG["RSO_CLIENT_ID"], |
| 53 | CONFIG["RSO_CLIENT_SECRET"]), |
| 54 | data={ |
| 55 | "grant_type": "authorization_code", |
| 56 | "code": code, |
| 57 | "redirect_uri": CONFIG["APP_CALLBACK_URL"] |
| 58 | }, |
| 59 | timeout=TIMEOUT |
| 60 | ) |
| 61 | |
| 62 | query_string = "" |
| 63 | |
| 64 | if resp.json() is not None: |
| 65 | for k, v in resp.json().items(): |
| 66 | query_string += f'{k}={v}&' |
| 67 | |
| 68 | return f"""<script>window.location.href = "/show-data/?{query_string}";</script>""" |
| 69 | |
| 70 | |
| 71 | def json2table(json): |
nothing calls this directly
no outgoing calls
no test coverage detected