Skip to content

Commit

Permalink
Fix RSA8f3 (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardopereira authored and tcard committed May 16, 2016
1 parent 59b0c39 commit 9aa84d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
9 changes: 2 additions & 7 deletions Source/ARTAuth.m
Expand Up @@ -344,13 +344,8 @@ - (NSString *)getClientId {
if (_protocolClientId) {
return _protocolClientId;
}
else if (self.tokenDetails) {
// Check wildcard
if ([self.tokenDetails.clientId isEqual:@"*"])
// Any client
return nil;
else if (self.tokenDetails.clientId)
return self.tokenDetails.clientId;
else if (self.tokenDetails && self.tokenDetails.clientId) {
return self.tokenDetails.clientId;
}
if (self.options) {
return self.options.clientId;
Expand Down
12 changes: 9 additions & 3 deletions Spec/Auth.swift
Expand Up @@ -941,9 +941,15 @@ class Auth : QuickSpec {
// RSA8f3
it("ensure the message published with a wildcard '*' does not have a clientId") {
let options = AblyTests.commonAppSetup()
// Request a token with a wildcard '*' value clientId
options.token = getTestToken(clientId: "*")
let rest = ARTRest(options: options)

waitUntil(timeout: testTimeout) { done in
rest.auth.authorise(ARTTokenParams(clientId: "*"), options: nil) { _, error in
expect(error).to(beNil())
done()
}
}

rest.httpExecutor = testHTTPExecutor
let channel = rest.channels.get("test")

Expand All @@ -966,7 +972,7 @@ class Auth : QuickSpec {
}
}
}
expect(rest.auth.clientId).to(beNil())
expect(rest.auth.clientId).to(equal("*"))
}

// RSA8f4
Expand Down

0 comments on commit 9aa84d1

Please sign in to comment.