Skip to content
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

Remove RSA10c and RSA10d #522

Merged
merged 1 commit into from
Oct 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions Spec/Auth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1718,72 +1718,6 @@ class Auth : QuickSpec {
}
}

// RSA10c
it("should create a new token when no token exists or current token has expired") {
let rest = ARTRest(options: AblyTests.commonAppSetup())

let tokenParams = ARTTokenParams()
tokenParams.ttl = 3.0 //Seconds

// FIXME: buffer of 15s for token expiry

// No token exists
expect(rest.auth.tokenDetails?.token).to(beNil())

waitUntil(timeout: testTimeout) { done in
// Create token
rest.auth.authorise(tokenParams, options: nil) { tokenDetails, error in
expect(error).to(beNil())
expect(tokenDetails).toNot(beNil())
expect(tokenDetails?.token).toNot(beEmpty())

let expiredToken = tokenDetails?.token
// New token
delay(tokenParams.ttl + 1.0) {
rest.auth.authorise(nil, options: nil) { tokenDetails, error in
expect(error).to(beNil())
guard let tokenDetails = tokenDetails else {
XCTFail("TokenDetails is nil"); done(); return
}
expect(tokenDetails.token).toNot(equal(expiredToken))
done()
}
}
}
}
}

// RSA10d
it("should issue a new token even if an existing token exists when AuthOption.force is true") {
let options = AblyTests.commonAppSetup()
options.clientId = "defClientId"
let rest = ARTRest(options: options)

let authOptions = ARTAuthOptions()
authOptions.key = options.key
authOptions.force = true

// Current token
waitUntil(timeout: testTimeout) { done in
rest.auth.authorise(nil, options: nil) { tokenDetails, error in
expect(error).to(beNil())
expect(tokenDetails?.token).toNot(beNil())

let currentToken = tokenDetails?.token

rest.auth.authorise(nil, options: authOptions) { tokenDetails, error in
expect(error).to(beNil())
guard let tokenDetails = tokenDetails else {
XCTFail("TokenDetails is nil"); done(); return
}
expect(tokenDetails.clientId).to(equal("defClientId"))
expect(tokenDetails.token).toNot(equal(currentToken))
done()
}
}
}
}

// RSA10e
it("should use the requestToken implementation") {
let rest = ARTRest(options: AblyTests.commonAppSetup())
Expand Down