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

Adds timeSinceUv extension #2052

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
53 changes: 53 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -7611,6 +7611,59 @@ To <dfn abstract-op>Create a new supplemental public key record</dfn>, perform t
In [step 22](#authn-ceremony-update-credential-record) of [[#sctn-verifying-assertion]],
[=set/append=] this [=supplemental public key record=] to |credentialRecord|.[$credential record/supplementalPubKeys$].

### Time Since User Verification Extension (timeSinceUv) ### {#sctn-time-since-uv-extension}

This extension enables an authenticator to disclose the time since the last user verification was peformed.

: Extension identifier
:: `timeSinceUv`

: Operation applicability
:: [=registration extension|Registration=] and [=authentication extension|Authentication=] when {{AuthenticatorSelectionCriteria/userVerification}} is set to {{UserVerificationRequirement/preferred}}.

: Client extension input
:: The Boolean value [TRUE] to indicate that this extension is requested by the [=[RP]=].
<xmp class="idl">
partial dictionary AuthenticationExtensionsClientInputs {
boolean timeSinceUv;
};
</xmp>

: Client extension processing
:: None, except creating the authenticator extension input from the client extension input.

: Client extension output
:: <xmp class="idl">
partial dictionary AuthenticationExtensionsClientOutputs {
AuthenticationExtensionsTimeSinceUvOutputs timeSinceUv;
};

dictionary AuthenticationExtensionsTimeSinceUvOutputs {
unsigned long timeSinceUv;
};
</xmp>

: Authenticator extension input
:: The Boolean value [TRUE], encoded in CBOR (major type 7, value 21).

```
$$extensionInput //= (
timeSinceUv: true,
)
```

: Authenticator extension processing
:: The [=authenticator=] sets the [=authenticator extension output=] to be the time in milliseconds since [=user verification=] was performed.
This extension can be added to attestation objects and assertions.

: Authenticator extension output
:: Authenticators can report a single value which MUST be between 1000 (1 second) and 86400000 (1 day), and MUST be rounded up to the next power of two.

```
$$extensionOutput //= (
timeSinceUv: timeSinceUvValue,
Copy link
Member

@emlun emlun Apr 2, 2024

Choose a reason for hiding this comment

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

The right-hand side should be a defined type, so uint in this case. But we can actually be even more prescriptive here and use the .within control operator to list all of the permissible values:

Suggested change
timeSinceUv: timeSinceUvValue,
timeSinceUv: uint .within (1024 / 2048 / 4096 / 8192 / 16384 / 32768 / 65536 / 131072 / 262144 / 524288 / 1048576 / 2097152 / 4194304 / 8388608 / 16777216 / 33554432 / 67108864),

(This is equivalent to just timeSinceUv: 1024 / 2048 / ... / 67108864, but I figure that adding uint .within helps clarify the CBOR type used to represent the number.)

It's... a bit ugly, but I think it's worth it. It would look slightly prettier if we decide to go with only even powers of two (i.e., powers of four) (but don't take that as a valid argument for changing to powers of four):

      timeSinceUv: uint .within (1024 / 4096 / 16384 / 65536 / 262144 / 1048576 / 4194304 / 16777216 / 67108864),

)
```

# User Agent Automation # {#sctn-automation}

Expand Down
Loading