| 46 | _request = {} |
| 47 | |
| 48 | class AccessTokenHandler(UserSecretsHTTPHandler): |
| 49 | |
| 50 | def set_request(self): |
| 51 | _request['path'] = self.path |
| 52 | content_len = int(self.headers.get('Content-Length')) |
| 53 | _request['body'] = json.loads(self.rfile.read(content_len)) |
| 54 | _request['headers'] = self.headers |
| 55 | |
| 56 | def get_response(self): |
| 57 | if success: |
| 58 | return {'result': {'secret': secret, 'secretType': 'refreshToken', 'secretProvider': 'google', 'expiresInSeconds': 3600}, 'wasSuccessful': "true"} |
| 59 | else: |
| 60 | return {'wasSuccessful': "false", 'errors': ['No user secrets exist for kernel']} |
| 61 | |
| 62 | env = EnvironmentVarGuard() |
| 63 | env.set(_KAGGLE_USER_SECRETS_TOKEN_ENV_VAR_NAME, _TEST_JWT) |
nothing calls this directly
no outgoing calls
no test coverage detected