Open
Conversation
Vasfed
reviewed
Mar 31, 2023
| def build_token | ||
| ts = Time.now.to_i | ||
| payload = { iss: account_id, iat: ts - 5, exp: ts + 64 } | ||
| JWT.encode(payload, |
There was a problem hiding this comment.
JWT gem is not in dependencies, this may break if one does not have it already
|
|
||
| def build_token | ||
| ts = Time.now.to_i | ||
| payload = { iss: account_id, iat: ts - 5, exp: ts + 64 } |
There was a problem hiding this comment.
Please provide more info on why we need "issued at" field in past
Author
There was a problem hiding this comment.
I have just copied behaviour from their own python client
Comment on lines
20
to
+21
| @api_key = options[:api_key] | ||
| @private_key = options[:private_key] |
There was a problem hiding this comment.
Probably here should be a check that only one auth method is enabled at a time
Author
There was a problem hiding this comment.
Technically, client can use both kind of auth methods at same time. If so, the decision of is request authenticated or not will be completely on api provider side. We can perform validation for at least one auth method provided during client initialization, WDYT?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce modern authorization mechanism instead of deprecated one.