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

Move getAssertion()'s challenge into AssertionOptions #398

Merged
merged 7 commits into from
Apr 14, 2017

Conversation

mikewest
Copy link
Member

Passing a single dictionary parameter into getAssertion() provides
for greater forward compatibility, as new data can be flexibly added
to the method invocation without restructuring the existing
structure. It also helps developers understand what they're passing
in. This is less important for getAssertion() than it is for
makeCredential(), obviously, but aligning both in a similar
structure seems like a good change to make.

This patch adds an 'AuthenticatorResponse' interface, representing the
generic attributes of responses from authenticators. It then redefines
'ScopedCredentialInfo' and 'AuthenticatorAssertion' to derive from this
interface, and renames them to 'AuthenticatorAttestionResponse' and
'AuthenticatorAssertionResponse' respectively.

These new interfaces are a drop-in replacement for the old interfaces,
no normative changes are intended in this patch, other than the
renaming.
Passing a single dictionary parameter into `getAssertion()` provides
for greater forward compatibility, as new data can be flexibly added
to the method invocation without restructuring the existing
structure. It also helps developers understand what they're passing
in. This is less important for `getAssertion()` than it is for
`makeCredential()`, obviously, but aligning both in a similar
structure seems like a good change to make.
@mikewest
Copy link
Member Author

As @vijaybh suggeted in #2 of https://lists.w3.org/Archives/Public/public-webauthn/2017Apr/0158.html, moving getAssertion() and makeCredential() to dictionary-based invocation rather than list-of-parameter-based invocation seems pretty reasonable. This patch migrates getAssertion().

index.bs Outdated
@@ -892,8 +883,12 @@ user consent to a specific transaction. The structure of these signatures is def

## Additional options for Assertion Generation (dictionary <dfn dictionary>AssertionOptions</dfn>) ## {#assertion-options}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editorial: Could we remove the word "additional here, since this is now all the options?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Done in 0039a13.

Copy link
Contributor

@equalsJeffH equalsJeffH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems nominally fine to me, thx @mikewest! My recollection is that we had kept the challenge separate from the truly optional options because the challenge is a must-have. So "options" are now not truely all options. Is the term "options" typically used to name the parameters dictionary passed to web platform methods? (I'd be inclined to term it "params" or "parameters" but it is not a big deal)

@mikewest
Copy link
Member Author

I'd be inclined to term it "params" or "parameters" but it is not a big deal

data or params or anything else is fine with me. I'm easy. :)

My recollection is that we had kept the challenge separate from the truly optional options because the challenge is a must-have.

As I'm sure you noted, the challenge is marked as required, so this will throw a TypeError if it's not present on the dictionary that's passed in. I think the guarantees are much the same as the existing code.

@mikewest
Copy link
Member Author

How about AssertionRequest in 3a5fefb?

@equalsJeffH
Copy link
Contributor

My recollection is that we had kept the challenge separate from the truly optional options because the challenge is a must-have.

As I'm sure you noted, the challenge is marked as required, so this will throw a TypeError if it's not present on the dictionary that's passed in. I think the guarantees are much the same as the existing code.

understood and agreed.

@equalsJeffH
Copy link
Contributor

I noted in #398 (comment):

I'd be inclined to term [options] "params" or "parameters" but it is not a big deal

@mikewest replied:

data or params or anything else is fine with me. I'm easy. :)
How about AssertionRequest in 3a5fefb?

Well, in thinking about it let's leave that argument/parameter name as "options" -- "request", as attempted 3a5fefb, seems misleading because the dictionary semantically contains options/arguments/parameters and "options" is shorter.

So going with the two commits -- a9da992 and 0039a13 -- works for me.

Copy link
Contributor

@leshi leshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits, great otherwise!

@@ -557,30 +554,24 @@ authorizing an authenticator.

### Use an existing credential - getAssertion() method ### {#getAssertion}

<div link-for-hint="WebAuthentication/getAssertion(assertionChallenge, options)">
<div link-for-hint="WebAuthentication/getAssertion(options)">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't options be request here?

index.bs Outdated
[[#assertion-options]].

</ul>
: <dfn>options</dfn>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be request?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest not naming this request and just using options or parameters here (see #398 (comment)).

@jcjones
Copy link
Contributor

jcjones commented Apr 14, 2017

On-call: Drop the 3rd commit, and then clear to merge.

@mikewest
Copy link
Member Author

Dropped 3a5fefb and merged in the changes from #397 (land this one after that one).

@equalsJeffH
Copy link
Contributor

LGTM, thanks!

@equalsJeffH equalsJeffH merged commit c22e2ab into w3c:master Apr 14, 2017
WebAuthnBot pushed a commit that referenced this pull request Apr 14, 2017
@mikewest mikewest deleted the dictionary-getassertion branch April 18, 2017 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants