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

ARTAuthTokenParams: ttl type is not consistent with spec #131

Closed
1 task
ricardopereira opened this issue Jan 15, 2016 · 3 comments
Closed
1 task

ARTAuthTokenParams: ttl type is not consistent with spec #131

ricardopereira opened this issue Jan 15, 2016 · 3 comments

Comments

@ricardopereira
Copy link
Contributor

The type of ARTAuthTokenParams.ttl is NSTimeInterval:

Used to specify a time interval, in seconds.

I often use uint64_t type when I want to represent milliseconds. Some references: Precise timing measurements

Reference:
TK2a

Tasks

  • change ttl type
  • check ARTDefault.ttl as well
  • check RSA5
  • check RSA9e
  • add a test:

I would like to see a test that requests a token valid for 24 hours, then checks that the token does indeed expire the following day 24 hours later (or within a minute of that).

@mattheworiordan
Copy link
Member

The type of ARTAuthTokenParams.ttl is NSTimeInterval:
Used to specify a time interval, in seconds.

I don't think that in itself is wrong, especially if that is a standard type, but we do need to ensure then that all serialisation to and from JSON / MsgPack when communicating with Ably is converted correctly

@tcard
Copy link
Contributor

tcard commented Jan 15, 2016

The reference says:

it yields sub-millisecond precision over a range of 10,000 years.

So there's no problem with precision here. (TK2a is kind of fuzzy about it, though, because it says that it is "in milliseconds" but then specifies the type as "long", so it doesn't define to what extent times smaller than a millisecond should be significative; anyway, the milliseconds requirement is met by NSTimeInterval.)

I agree with @mattheworiordan. Translating to iOS' standards is mostly what we're doing all around.

@ricardopereira
Copy link
Contributor Author

Fixed 1e330a7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants