-
Notifications
You must be signed in to change notification settings - Fork 3
Replace urllib with requests #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,12 +50,14 @@ def generate_token(self, token_generate_input): | |
| req, nonce = make_v2_request(self._secret_key, dt.datetime.now(tz=timezone.utc), | ||
| token_generate_input.get_as_json_string().encode()) | ||
| resp = post(self._base_url, '/v2/token/generate', headers=auth_headers(self._auth_key), data=req) | ||
| resp_body = parse_v2_response(self._secret_key, resp.read(), nonce) | ||
| resp.raise_for_status() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In future we should probably wrap
|
||
| resp_body = parse_v2_response(self._secret_key, resp.text, nonce) | ||
| return TokenGenerateResponse(resp_body) | ||
|
|
||
| def refresh_token(self, current_identity): | ||
| resp = post(self._base_url, '/v2/token/refresh', headers=auth_headers(self._auth_key), | ||
| data=current_identity.get_refresh_token().encode()) | ||
| resp_bytes = base64_to_byte_array(resp.read()) | ||
| resp.raise_for_status() | ||
| resp_bytes = base64_to_byte_array(resp.text) | ||
| decrypted = _decrypt_gcm(resp_bytes, base64_to_byte_array(current_identity.get_refresh_response_key())) | ||
| return TokenRefreshResponse(decrypted.decode(), dt.datetime.now(tz=timezone.utc)) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this how the version should be bumped, or is it done as part of the pipeline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its done by the pipeline. It will bump up the major, minor or patch number corresponding to the Github action that's run. To publish an alpha package it will have to done manually