-
Notifications
You must be signed in to change notification settings - Fork 26
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
RSA9h #491
RSA9h #491
Conversation
tokenParams.capability = "{ \"test:*\":[\"test\"] }" | ||
|
||
waitUntil(timeout: testTimeout) { done in | ||
rest.auth.createTokenRequest(tokenParams, options: authOptions) { tokenRequest, error in |
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.
This API does not look right. Why is this options:
when the IDL specifies we have two args, TokenParams
and AuthOptions
. Whilst I appreciate this PR is not necessarily about this, it's important we fix things as we go along. Can you take a look please?
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.
This API does not look right
Why do you think so? createTokenRequest
API has 3 arguments - ARTTokenParams
and ARTAuthOptions
objects and a callback
which provides ARTTokenRequest
and an error if any.
Why is this
options:
Lib written in ObjC
, and tests in Swift
, so options:
is a part of ObjC
method signature here and the argument is authOptions
object of ARTAuthOptions
class.
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.
Ok, this might be an "iOS" thing then that I have misunderstood. I have never written iOS code so just looking at these PRS with a view to a) does it achieve the spec, b) does it follow the API. @tcard can you comment on this and confirm you're happy to leave as is i.e. I was wrong :)
Thanks @EvgenyKarkan for the explanation
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.
Yes @mattheworiordan, we're forced to do this every time we have more than one argument. It's just how Objective-C works. (When the last argument is a callback, as a syntactic convenience Swift lets you omit its name and pass it kind of like a Ruby block, that's why you don't see its name.)
Please review and merge if everything looks good. |
Nice, but there's still one case missing: the case in which For example, you could set |
Please review and merge if everything looks good. |
@EvgenyKarkan What's the state on this one? This PR will merge into |
9f091e0
to
8eacd69
Compare
Hello @ricardopereira
Hope it's done, I asked Toni for review this PR. |
LGTM. I rebased with master but tests are failing. |
8eacd69
to
2a748a8
Compare
2a748a8
to
8e63e9c
Compare
} | ||
|
||
waitUntil(timeout: testTimeout) { done in | ||
rest.auth.authorise(nil, options: options) { tokenDetails, error in |
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.
Shouldn't we testing the createTokenRequest
(spec (RSA9) Auth#createTokenRequest
)?
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.
Nevermind. The createTokenRequest
is being tested.
expect(currentTokenRequest).toEventuallyNot(beNil(), timeout: testTimeout) | ||
|
||
waitUntil(timeout: testTimeout) { done in | ||
rest.auth.authorise(nil, options: nil) { tokenDetails, error in |
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.
Same, shouldn't we only testing the createTokenRequest
?
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.
Nevermind. The createTokenRequest
is being tested.
|
All other PR's are related with this one, so I will merge it to help me out with my further work. |
@ricardopereira I'd be happier if we were checking for a specific error code, since now any failure would make the test pass. But no biggie. |
7c266e7