-
Notifications
You must be signed in to change notification settings - Fork 25
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
RSA10 #94
Conversation
(RSA10c) Will not create a new token unless no previous token exists or current token has expired. Not implemented:
|
I need to think about it. Right now I do not have a clue how to achieve this. |
Not implemented:
|
@ricardopereira that is fine, but why?
Surely you just need to have a test that proves that requesting a token through an authorise call leads to a
Why not? This is quite an important requirement. |
BOOL requestNewToken = NO; | ||
BOOL useTheForce = options ? options.force : false; |
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.
useTheForce
? Sounds like something out of Star Wars. Why not simply forceTokenRenewal
?
A few comments, but largely good progress, 👍 |
@mattheworiordan Done |
Tests are failing because of bug #114. (test Auth.swift#L801) |
Well up to you, it would be nice to not introduce PRs that change the build from green to red. I think you should look at fixing the issue as part of this PR so that this PR passes, but do no more than necessary, and anything else should go in a separate PR to address the issue. Alternatively, and probably better, perhaps fix #114 in a new PR, and then rebase this one on top of that afterwards. |
@@ -30,7 +30,7 @@ ART_ASSUME_NONNULL_BEGIN | |||
@property (nonatomic, weak) ARTLog *logger; | |||
|
|||
@property (art_nullable, readonly, getter=getClientId) NSString *clientId; | |||
@property (art_nullable, nonatomic, readonly, strong) ARTAuthTokenDetails *tokenDetails; | |||
@property (art_nullable, nonatomic, readwrite, strong) ARTAuthTokenDetails *tokenDetails; |
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.
Why is this readwrite
? I assume this means a consumer of this API could explicitly update the tokenDetails
without using the correct API. Is this intentional? If so, why?
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.
It is a mistake. I removed the setTokenDetails
and I change it to readwrite
just to compile the code successfully and continue the remaining work of this spec.
Few comments, but mostly looks good |
Needs #123. |
if (mergedOptions.authUrl) { | ||
NSMutableURLRequest *request = [self buildRequest:mergedOptions withParams:currentTokenParams]; | ||
|
||
[self.logger debug:__FILE__ line:__LINE__ message:@"using authUrl (%@ %@)", request.HTTPMethod, request.URL]; | ||
|
||
[_rest executeRequest:request withAuthOption:ARTAuthenticationUseBasic completion:^(NSHTTPURLResponse *response, NSData *data, NSError *error) { | ||
[_rest executeRequest:request withAuthOption:ARTAuthenticationOff completion:^(NSHTTPURLResponse *response, NSData *data, NSError *error) { |
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.
Why ARTAuthenticationOff
, what does that mean?
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.
ARTAuthenticationOff
means the host does not require authentication (no Authorization
http header)
Few small comments, please address and will merge. Also, this won't merge automatically now unfottunately |
- It is possible to request a token either with an API key, authCallback or authUrl
- The `authCallback` was calling the wrong callback.
- Generate a token request with one RestClient and one other to test the `authCallback`
The token retrieved is assumed by the library to be a token string if the response has Content-Type "text/plain", or taken to be a TokenRequest or TokenDetails object if the response has Content-Type "application/json"
- added `ARTJsonEncoder.encodeTokenDetails` to use with echo.ably.io service - added `getTestTokenDetails()`
…en return an error with HTTP StatusCode
- Added custom nimble matcher `beCloseTo` for NSDates
Rebased with one change c670e8f. |
LGTM |
1 similar comment
LGTM |
No description provided.