[webauthn] Add unknownCredentialId report [chromium/src : main]

72 views
Skip to first unread message

Gabriel Viera (Gerrit)

unread,
Jun 17, 2024, 4:59:44 PM (12 days ago) Jun 17
to Chromium LUCI CQ, Nina Satragno, Ken Buchanan, Kaan Icer, Luna Lu, Kentaro Hara, Christian Biesinger, AyeAye, npm+...@chromium.org, yigu+...@chromium.org, blink-re...@chromium.org, jmedle...@chromium.org, webauthn...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, blundell+...@chromium.org, iclella...@chromium.org
Attention needed from Ken Buchanan and Nina Satragno

Gabriel Viera voted and added 5 comments

Votes added by Gabriel Viera

Commit-Queue+1
Mega-CQ+1

5 comments

Commit Message
Line 1, Patchset 2:Parent: 237f9fc4 (Updating trunk VERSION from 6540.0 to 6541.0)
Nina Satragno . resolved

Don't forget to run the trybots before sending your CL for review. There's a button on the top right "CQ DRY RUN" that should do it

Gabriel Viera

Done

Line 7, Patchset 2:unknownCredentialId report names a credential ID and indicate that the relying party would reject an assertion with that credential because the credential ID is unknown to the relying party.
Nina Satragno . resolved

nit:

```
the relying party would reject an assertion
```

should be

```
the relying party rejected an assertion
```

Gabriel Viera

Done

Line 7, Patchset 2:unknownCredentialId report names a credential ID and indicate that the relying party would reject an assertion with that credential because the credential ID is unknown to the relying party.
Nina Satragno . resolved

nit: This is a very long title. Normally we want to stick to < 72 chars for each line of a commit, ideally < 50 for the title, otherwise it'll get ellipsized by tooling.

How about

```
[webauthn] Add unknownCredentialId report

The unknownCredentialId report names...
```

Gabriel Viera

Done

Line 9, Patchset 2:When a call to navigator.credentials.report() includes "unknownCredentialId," it checks to make sure the website reporting the ID is actually the one that issued it. If the check is successful, the credential is then removed from Google Password Manager (GPM).
Nina Satragno . resolved

nit:

the website reporting the ID is actually the one that issued it

this isn't strictly accurate, since it could be a different website using the related rp ids feature. Maybe something like

```
it checks that the relying party ID corresponds to the website.
If the check is successful...
```

Gabriel Viera

Done

Line 9, Patchset 2:When a call to navigator.credentials.report() includes "unknownCredentialId," it checks to make sure the website reporting the ID is actually the one that issued it. If the check is successful, the credential is then removed from Google Password Manager (GPM).
Nina Satragno . resolved

nit: put the comma outside the quotes. Also, format to 72 character columns.

Gabriel Viera

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ken Buchanan
  • Nina Satragno
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I57864dd9f5f78e7c79f839d31228c3035384892c
Gerrit-Change-Number: 5635512
Gerrit-PatchSet: 3
Gerrit-Owner: Gabriel Viera <gvi...@google.com>
Gerrit-Reviewer: Gabriel Viera <gvi...@google.com>
Gerrit-Reviewer: Ken Buchanan <ke...@chromium.org>
Gerrit-Reviewer: Nina Satragno <nsat...@chromium.org>
Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
Gerrit-CC: Kaan Icer <ic...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Luna Lu <loon...@chromium.org>
Gerrit-Attention: Nina Satragno <nsat...@chromium.org>
Gerrit-Attention: Ken Buchanan <ke...@chromium.org>
Gerrit-Comment-Date: Mon, 17 Jun 2024 20:59:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Nina Satragno <nsat...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Ken Buchanan (Gerrit)

unread,
Jun 17, 2024, 5:46:07 PM (12 days ago) Jun 17
to Gabriel Viera, Chromium LUCI CQ, Nina Satragno, Kaan Icer, Luna Lu, Kentaro Hara, Christian Biesinger, AyeAye, npm+...@chromium.org, yigu+...@chromium.org, blink-re...@chromium.org, jmedle...@chromium.org, webauthn...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, blundell+...@chromium.org, iclella...@chromium.org
Attention needed from Gabriel Viera and Nina Satragno

Ken Buchanan added 2 comments

File chrome/browser/webauthn/chrome_authenticator_request_delegate.h
Line 21, Patchset 3 (Latest):#include "components/webauthn/core/browser/passkey_model.h"
Ken Buchanan . unresolved

This doesn't look to be used either.

Line 18, Patchset 3 (Latest):#include "chrome/browser/profiles/profile.h"
Ken Buchanan . unresolved

This shouldn't be here. There is a forward declaration of `class Profile` and that is sufficient.

Open in Gerrit

Related details

Attention is currently required from:
  • Gabriel Viera
  • Nina Satragno
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I57864dd9f5f78e7c79f839d31228c3035384892c
Gerrit-Change-Number: 5635512
Gerrit-PatchSet: 3
Gerrit-Owner: Gabriel Viera <gvi...@google.com>
Gerrit-Reviewer: Gabriel Viera <gvi...@google.com>
Gerrit-Reviewer: Ken Buchanan <ke...@chromium.org>
Gerrit-Reviewer: Nina Satragno <nsat...@chromium.org>
Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
Gerrit-CC: Kaan Icer <ic...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Luna Lu <loon...@chromium.org>
Gerrit-Attention: Gabriel Viera <gvi...@google.com>
Gerrit-Attention: Nina Satragno <nsat...@chromium.org>
Gerrit-Comment-Date: Mon, 17 Jun 2024 21:45:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Gabriel Viera (Gerrit)

unread,
Jun 25, 2024, 3:33:48 PM (4 days ago) Jun 25
to Code Review Nudger, Chromium LUCI CQ, Nina Satragno, Ken Buchanan, Kaan Icer, Luna Lu, Kentaro Hara, Christian Biesinger, AyeAye, npm+...@chromium.org, yigu+...@chromium.org, blink-re...@chromium.org, jmedle...@chromium.org, webauthn...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, blundell+...@chromium.org, iclella...@chromium.org
Attention needed from Ken Buchanan and Nina Satragno

Gabriel Viera added 30 comments

File chrome/browser/webauthn/chrome_authenticator_request_delegate.h
Line 21, Patchset 3:#include "components/webauthn/core/browser/passkey_model.h"
Ken Buchanan . resolved

This doesn't look to be used either.

Gabriel Viera

Removed.

Line 18, Patchset 3:#include "chrome/browser/profiles/profile.h"
Ken Buchanan . resolved

This shouldn't be here. There is a forward declaration of `class Profile` and that is sufficient.

Gabriel Viera

#include removed.

File chrome/browser/webauthn/chrome_authenticator_request_delegate.cc
Line 491, Patchset 2: raw_ptr<webauthn::PasskeyModel> passkey_store_ =
Nina Satragno . resolved

`raw_ptr` is only used for class / struct members. Also, the underscore notation is only used for class members.

https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++.md#non_owning-pointers-in-class-fields

Gabriel Viera

Change done.

Line 495, Patchset 2: if (!passkey_credential_id.empty()) {
Nina Satragno . resolved

Is this check really doing anything for us? What difference would it make to remove it?

Gabriel Viera

Removed. Removing that check makes no difference.

File content/browser/webauth/authenticator_common_impl.cc
Line 1580, Patchset 2:// TODO: ADD COMMENT
Nina Satragno . resolved

You wouldn't have a comment here since this is an implementation file.

Gabriel Viera

Done.

Line 1583, Patchset 2: const std::string& relying_party_id) {
Nina Satragno . resolved

Pass the origin here (see other methods for an example) so you can validate it.

Gabriel Viera

Done.

Line 1583, Patchset 2: const std::string& relying_party_id) {
Nina Satragno . resolved

This also needs to take a callback so it can return a status code (success, or rp id validation error).

Gabriel Viera

Done.

Line 1584, Patchset 2: if (req_state_) {
Nina Satragno . resolved

`req_state_` will always be `null` if there's no pending webauthn request. In testing, this probably worked for you if you were using a site that does a conditional ui request in the background. Why are we checking for it here?

Gabriel Viera

Removed. Done.

Line 1603, Patchset 2: if (rp_id_validation_result == blink::mojom::AuthenticatorStatus::SUCCESS) {
Nina Satragno . resolved

We need to notify the site that this validation failed.

Gabriel Viera

Done.

Line 1603, Patchset 2: if (rp_id_validation_result == blink::mojom::AuthenticatorStatus::SUCCESS) {
Nina Satragno . resolved

nit: normally, we prefer early returns for error handling, so they don't stack the scopes and we end up with really deep scopes.

Prefer:

```
if (rp_id_validation_result != blink::mojom::AuthenticatorStatus::SUCCESS) {
std::move(callback).Run(Status::kRpValidationError);
return;
}

// Execution continues here...
```

Gabriel Viera

Done.

File content/browser/webauth/authenticator_impl.cc
Line 13, Patchset 2 (Parent):
Nina Satragno . resolved

nit: bring back this whitespace

Gabriel Viera

Done

Line 86, Patchset 2: authenticator_common_impl_->RemoveCredential(std::move(passkey_credential_id),
Nina Satragno . resolved

nit: I don't think you get anything from std::moving a reference.

Gabriel Viera

Done.

File content/browser/webauth/webauth_request_security_checker.cc
Line 314, Patchset 2: return blink::mojom::AuthenticatorStatus::SUCCESS;
Nina Satragno . resolved

Add a TODO. Kinda like the AI wants, except with a correct crbug.

Gabriel Viera

Done.

File content/public/browser/authenticator_request_client_delegate.h
Line 137, Patchset 2: // TODO: Add Comment
Nina Satragno . resolved

pls add the comments with your CL (:

Gabriel Viera

Done.

File content/public/browser/authenticator_request_client_delegate.cc
Line 106, Patchset 2: return;
Nina Satragno . resolved

nit: this `return` is redundant, remove it.

Gabriel Viera

Done.

File third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom
Line 254, Patchset 2:
Nina Satragno . resolved

nit: remove this newline

Gabriel Viera

Done.

File third_party/blink/public/mojom/webauthn/authenticator.mojom
Line 601, Patchset 2:// TODO : ADD Comments
Nina Satragno . resolved

Just add the comments with your CL (:

Gabriel Viera

Done.

Line 645, Patchset 2: RemoveCredential(array<uint8> passkey_credential_id,
string relying_party_id);
Nina Satragno . resolved

I don't understand why you defined `PublicKeyCredentialReportOptions` above, but then didn't actually use it. There's no point defining a mojo struct that is not referenced in a mojo method.

You can either remove `PublicKeyCredentialReportOptions` above, or change this method into something like

```
Report(PublicKeyCredentialReportOptions options);
```

Gabriel Viera

The method was changed to Report(PublicKeyCredentialReportOptions options), and then in the Report method, I call the RemoveCredential method.

Line 646, Patchset 2: string relying_party_id);
Nina Satragno . resolved

We should have this method return a status code. That way, we can notify the renderer of errors detected on the browser process, e.g. that the RP validation failed.

Gabriel Viera

Done.

File third_party/blink/renderer/modules/credentialmanagement/authentication_credentials_container.cc
Line 13, Patchset 2:#include "base/logging.h"
Nina Satragno . resolved

Do we need this?

Gabriel Viera

No, removed.

Line 1912, Patchset 2:// TODO:: ADD COMMENT
Nina Satragno . resolved

We don't add function documentation comments on implementation files. These normally go the file that defines them (.h headers or e.g. mojom files).

This function is special because it implements a web API, we don't normally comment what they do.

Gabriel Viera

Done.

Line 1918, Patchset 2: exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError,
Nina Satragno . resolved

Instead of throwing a raw exception and returning an empty promise, let's reject the promise with the reason. See `preventSilentAccess` for examples.

Gabriel Viera

Done.

Line 1924, Patchset 2: exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError,
Nina Satragno . resolved

Do we really want to throw if there's no `publicKey`? We haven't specified what to do in this state yet, but to me it seems we should just not do anything.

Gabriel Viera

The code was changed to check only if a public key exists to convert a mojo option.

Line 1937, Patchset 2: WTF::String rpID = mojo_options->relying_party_id;
Nina Satragno . resolved

`rp_id`

Gabriel Viera

Done.

File third_party/blink/renderer/modules/credentialmanagement/credential_report_options.idl
Line 1, Patchset 2:// Copyright 2015 The Chromium Authors
Line 7, Patchset 2: AbortSignal signal;
Nina Satragno . resolved

I don't think we need to let websites abort the report, let's get rid of `signal`.

Gabriel Viera

Done.

File third_party/blink/renderer/modules/credentialmanagement/credentials_container.idl
Line 13, Patchset 2: [CallWith=ScriptState, RaisesException, RuntimeEnabled=CredentialManagerReport] Promise<undefined> report(optional CredentialReportOptions options = {});
Nina Satragno . resolved

Is there a reason to have a default, optional `options`? It really makes no sense to call `report` with no `options` paramater, let's not make the `options` parameter optional and remove the default value.

Gabriel Viera

Done.

File third_party/blink/renderer/modules/credentialmanagement/public_key_credential_report_options.idl
Line 1, Patchset 2:// Copyright 2016 The Chromium Authors
Nina Satragno . resolved

Update the year

Gabriel Viera

Done.

Line 5, Patchset 2:
Nina Satragno . resolved

nit: remove this newline

Gabriel Viera

Done.

Line 12, Patchset 2: BufferSource id;
Nina Satragno . resolved

Note that this doesn't match the [explainer](https://github.com/w3c/webauthn/wiki/Explainer:-WebAuthn-Report-API-explainer#unknowncredentialid).

In the explainer, the example given is:

```
navigator.credentials.report({publicKey: {
rpId: "example.com",
unknownCredentialId: "vI0qOggiE3OT01ZRWBYz5l4MEgU0c7PmAA"
}});
```

but with this IDL, we'd need:

```
navigator.credentials.report({publicKey: {
rpId: "example.com",
unknownCredentialId: {
id: "vI0qOggiE3OT01ZRWBYz5l4MEgU0c7PmAA"
}
}});
```

which seems redundant, no? Let's remove that extra layer of indirection.

Gabriel Viera

Done.

Open in Gerrit

Related details

Attention is currently required from:
  • Ken Buchanan
  • Nina Satragno
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I57864dd9f5f78e7c79f839d31228c3035384892c
Gerrit-Change-Number: 5635512
Gerrit-PatchSet: 5
Gerrit-Owner: Gabriel Viera <gvi...@google.com>
Gerrit-Reviewer: Gabriel Viera <gvi...@google.com>
Gerrit-Reviewer: Ken Buchanan <ke...@chromium.org>
Gerrit-Reviewer: Nina Satragno <nsat...@chromium.org>
Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: Kaan Icer <ic...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Luna Lu <loon...@chromium.org>
Gerrit-Attention: Nina Satragno <nsat...@chromium.org>
Gerrit-Attention: Ken Buchanan <ke...@chromium.org>
Gerrit-Comment-Date: Tue, 25 Jun 2024 19:33:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nina Satragno <nsat...@chromium.org>
Comment-In-Reply-To: Ken Buchanan <ke...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Nina Satragno (Gerrit)

unread,
Jun 26, 2024, 9:24:15 AM (3 days ago) Jun 26
to Gabriel Viera, Code Review Nudger, Chromium LUCI CQ, Ken Buchanan, Kaan Icer, Luna Lu, Kentaro Hara, Christian Biesinger, AyeAye, npm+...@chromium.org, yigu+...@chromium.org, blink-re...@chromium.org, jmedle...@chromium.org, webauthn...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, blundell+...@chromium.org, iclella...@chromium.org
Attention needed from Gabriel Viera

Nina Satragno added 1 comment

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Nina Satragno . resolved

Please address the bot failures

Open in Gerrit

Related details

Attention is currently required from:
  • Gabriel Viera
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I57864dd9f5f78e7c79f839d31228c3035384892c
Gerrit-Change-Number: 5635512
Gerrit-PatchSet: 6
Gerrit-Owner: Gabriel Viera <gvi...@google.com>
Gerrit-Reviewer: Gabriel Viera <gvi...@google.com>
Gerrit-Reviewer: Ken Buchanan <ke...@chromium.org>
Gerrit-Reviewer: Nina Satragno <nsat...@chromium.org>
Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: Kaan Icer <ic...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Luna Lu <loon...@chromium.org>
Gerrit-Attention: Gabriel Viera <gvi...@google.com>
Gerrit-Comment-Date: Wed, 26 Jun 2024 13:24:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Nina Satragno (Gerrit)

unread,
Jun 26, 2024, 2:04:59 PM (3 days ago) Jun 26
to Gabriel Viera, Code Review Nudger, Chromium LUCI CQ, Ken Buchanan, Kaan Icer, Luna Lu, Kentaro Hara, Christian Biesinger, AyeAye, npm+...@chromium.org, yigu+...@chromium.org, blink-re...@chromium.org, jmedle...@chromium.org, webauthn...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, blundell+...@chromium.org, iclella...@chromium.org
Attention needed from Gabriel Viera

Nina Satragno added 11 comments

Patchset-level comments
Nina Satragno . resolved

This is a lot better! Besides the comments, please fix the bots, and add some tests (I'll follow up offline).

File chrome/browser/webauthn/chrome_authenticator_request_delegate.cc
Line 518, Patchset 6 (Latest):
Nina Satragno . unresolved

nit: remove this whitespace

File content/browser/webauth/authenticator_common_impl.h
Line 202, Patchset 6 (Latest): void RemoveCredential(const std::vector<uint8_t>& passkey_credential_id);
Nina Satragno . unresolved

This method isn't really doing much, remove?

File content/browser/webauth/authenticator_common_impl.cc
Line 1609, Patchset 6 (Latest): std::unique_ptr<WebAuthRequestSecurityChecker::RemoteValidation>
Nina Satragno . unresolved

nit: why not

```
req_state_->remote_rp_id_validation = security_checker_->ValidateDomainAndRelyingPartyID(
req_state_->caller_origin, req_state_->relying_party_id,
WebAuthRequestSecurityChecker::RequestType::kReport,
/*remote_desktop_client_override=*/nullptr,
base::BindOnce(&AuthenticatorCommonImpl::ContinueReportAfterRpCheck,
weak_factory_.GetWeakPtr(), std::move(options)));
```
Line 1625, Patchset 6 (Latest): std::vector<uint8_t> credential_id = options->unknown_credential_id;
Nina Satragno . unresolved

nit: in general, declare in the scope that it's used. In this case, the variable is only used once and it really doesn't help to readability to define a new variable.

```
RemoveCredential(options->unknown_credential_id);
```

is more readable imo.

Line 1632, Patchset 6 (Latest): } else {
Nina Satragno . unresolved

nit: this `else` is redudant because you're already `return`'ing above.

```
if (...) {
...
return;
}
RemoveCredential(...);
```
Line 1638, Patchset 6 (Latest):void AuthenticatorCommonImpl::RemoveCredential(
Nina Satragno . unresolved

nit: this method isn't really pulling its own weight. Why not directly call `DeletePasskey` above on L1633, and remove this?

File third_party/blink/renderer/modules/credentialmanagement/authentication_credentials_container.cc
Line 1905, Patchset 6 (Latest):void OnReportComplete(std::unique_ptr<ScopedPromiseResolver> scoped_resolver,
Nina Satragno . unresolved

Anonymous functions should be on the anonymous namespace on top of the file, move there.

Line 1934, Patchset 6 (Latest): auto promise = resolver->Promise();
Nina Satragno . unresolved

nit: why not `return resolver->Promise()` at the end and omit this statement?

Line 1935, Patchset 6 (Latest): ExecutionContext* context = ExecutionContext::From(script_state);
Nina Satragno . unresolved

Move this declaration to the context you're using it in (or consider removing it altogether).

File third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.cc
Line 1043, Patchset 6 (Latest):
Nina Satragno . unresolved

nit: remove this whitespace (also on L1048)

in general, whitespace after a closing brace is redundant.

https://google.github.io/styleguide/cppguide.html#Vertical_Whitespace

Open in Gerrit

Related details

Attention is currently required from:
  • Gabriel Viera
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I57864dd9f5f78e7c79f839d31228c3035384892c
    Gerrit-Change-Number: 5635512
    Gerrit-PatchSet: 6
    Gerrit-Owner: Gabriel Viera <gvi...@google.com>
    Gerrit-Reviewer: Gabriel Viera <gvi...@google.com>
    Gerrit-Reviewer: Ken Buchanan <ke...@chromium.org>
    Gerrit-Reviewer: Nina Satragno <nsat...@chromium.org>
    Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-CC: Kaan Icer <ic...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Luna Lu <loon...@chromium.org>
    Gerrit-Attention: Gabriel Viera <gvi...@google.com>
    Gerrit-Comment-Date: Wed, 26 Jun 2024 18:04:50 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    findit-for-me@appspot.gserviceaccount.com (Gerrit)

    unread,
    Jun 27, 2024, 8:27:19 PM (2 days ago) Jun 27
    to Gabriel Viera, Code Review Nudger, Chromium LUCI CQ, Nina Satragno, Ken Buchanan, Kaan Icer, Luna Lu, Kentaro Hara, Christian Biesinger, AyeAye, npm+...@chromium.org, yigu+...@chromium.org, blink-re...@chromium.org, jmedle...@chromium.org, webauthn...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, blundell+...@chromium.org, iclella...@chromium.org
    Attention needed from Gabriel Viera

    findit...@appspot.gserviceaccount.com voted Code-Coverage-1

    This change will be blocked from submission as there are files which do not meet the coverage criteria. Following files have incremental coverage(all tests) < 70%.

    • //components/webauthn/android/java/src/org/chromium/components/webauthn/AuthenticatorImpl.java

    Please add tests for uncovered lines, or add Low-Coverage-Reason:<reason> in the change description to bypass. See https://bit.ly/46jhjS9 to understand when it is okay to bypass. If you think coverage is underreported, file a bug at https://bit.ly/3ENM7Pe

    Code-Coverage-1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Gabriel Viera
    Submit Requirements:
    • requirement is blockingCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I57864dd9f5f78e7c79f839d31228c3035384892c
    Gerrit-Change-Number: 5635512
    Gerrit-PatchSet: 10
    Gerrit-Owner: Gabriel Viera <gvi...@google.com>
    Gerrit-Reviewer: Gabriel Viera <gvi...@google.com>
    Gerrit-Reviewer: Ken Buchanan <ke...@chromium.org>
    Gerrit-Reviewer: Nina Satragno <nsat...@chromium.org>
    Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-CC: Kaan Icer <ic...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Luna Lu <loon...@chromium.org>
    Gerrit-Attention: Gabriel Viera <gvi...@google.com>
    Gerrit-Comment-Date: Fri, 28 Jun 2024 00:27:09 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    blocking_requirement
    unsatisfied_requirement
    open
    diffy

    Gabriel Viera (Gerrit)

    unread,
    Jun 27, 2024, 8:29:18 PM (2 days ago) Jun 27
    to findit...@appspot.gserviceaccount.com, Code Review Nudger, Chromium LUCI CQ, Nina Satragno, Ken Buchanan, Kaan Icer, Luna Lu, Kentaro Hara, Christian Biesinger, AyeAye, npm+...@chromium.org, yigu+...@chromium.org, blink-re...@chromium.org, jmedle...@chromium.org, webauthn...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, blundell+...@chromium.org, iclella...@chromium.org
    Attention needed from Nina Satragno

    Gabriel Viera voted and added 10 comments

    Votes added by Gabriel Viera

    Commit-Queue+1

    10 comments

    File chrome/browser/webauthn/chrome_authenticator_request_delegate.cc
    Line 518, Patchset 6:
    Nina Satragno . resolved

    nit: remove this whitespace

    Gabriel Viera

    Done.

    File content/browser/webauth/authenticator_common_impl.h
    Line 202, Patchset 6: void RemoveCredential(const std::vector<uint8_t>& passkey_credential_id);
    Nina Satragno . resolved

    This method isn't really doing much, remove?

    Gabriel Viera

    Done.

    File content/browser/webauth/authenticator_common_impl.cc
    Line 1609, Patchset 6: std::unique_ptr<WebAuthRequestSecurityChecker::RemoteValidation>
    Nina Satragno . resolved

    nit: why not

    ```
    req_state_->remote_rp_id_validation = security_checker_->ValidateDomainAndRelyingPartyID(
    req_state_->caller_origin, req_state_->relying_party_id,
    WebAuthRequestSecurityChecker::RequestType::kReport,
    /*remote_desktop_client_override=*/nullptr,
    base::BindOnce(&AuthenticatorCommonImpl::ContinueReportAfterRpCheck,
    weak_factory_.GetWeakPtr(), std::move(options)));
    ```
    Gabriel Viera

    Done.

    Line 1625, Patchset 6: std::vector<uint8_t> credential_id = options->unknown_credential_id;
    Nina Satragno . resolved

    nit: in general, declare in the scope that it's used. In this case, the variable is only used once and it really doesn't help to readability to define a new variable.

    ```
    RemoveCredential(options->unknown_credential_id);
    ```

    is more readable imo.

    Gabriel Viera

    Done.

    Line 1632, Patchset 6: } else {
    Nina Satragno . resolved

    nit: this `else` is redudant because you're already `return`'ing above.

    ```
    if (...) {
    ...
    return;
    }
    RemoveCredential(...);
    ```
    Gabriel Viera

    Done.

    Line 1638, Patchset 6:void AuthenticatorCommonImpl::RemoveCredential(
    Nina Satragno . resolved

    nit: this method isn't really pulling its own weight. Why not directly call `DeletePasskey` above on L1633, and remove this?

    Gabriel Viera

    Done.

    File third_party/blink/renderer/modules/credentialmanagement/authentication_credentials_container.cc
    Line 1905, Patchset 6:void OnReportComplete(std::unique_ptr<ScopedPromiseResolver> scoped_resolver,
    Nina Satragno . resolved

    Anonymous functions should be on the anonymous namespace on top of the file, move there.

    Gabriel Viera

    Done.

    Line 1934, Patchset 6: auto promise = resolver->Promise();
    Nina Satragno . resolved

    nit: why not `return resolver->Promise()` at the end and omit this statement?

    Gabriel Viera

    Done.

    Line 1935, Patchset 6: ExecutionContext* context = ExecutionContext::From(script_state);
    Nina Satragno . resolved

    Move this declaration to the context you're using it in (or consider removing it altogether).

    Gabriel Viera

    Done.

    File third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.cc
    Line 1043, Patchset 6:
    Nina Satragno . resolved

    nit: remove this whitespace (also on L1048)

    in general, whitespace after a closing brace is redundant.

    https://google.github.io/styleguide/cppguide.html#Vertical_Whitespace

    Gabriel Viera

    Done.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Nina Satragno
    Submit Requirements:
    • requirement is blockingCode-Coverage
    • requirement is not satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I57864dd9f5f78e7c79f839d31228c3035384892c
    Gerrit-Change-Number: 5635512
    Gerrit-PatchSet: 10
    Gerrit-Owner: Gabriel Viera <gvi...@google.com>
    Gerrit-Reviewer: Gabriel Viera <gvi...@google.com>
    Gerrit-Reviewer: Ken Buchanan <ke...@chromium.org>
    Gerrit-Reviewer: Nina Satragno <nsat...@chromium.org>
    Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-CC: Kaan Icer <ic...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Luna Lu <loon...@chromium.org>
    Gerrit-Attention: Nina Satragno <nsat...@chromium.org>
    Gerrit-Comment-Date: Fri, 28 Jun 2024 00:29:08 +0000
    blocking_requirement
    unsatisfied_requirement
    open
    diffy

    Nina Satragno (Gerrit)

    unread,
    Jun 28, 2024, 11:19:45 AM (yesterday) Jun 28
    to Gabriel Viera, findit...@appspot.gserviceaccount.com, Code Review Nudger, Chromium LUCI CQ, Ken Buchanan, Kaan Icer, Luna Lu, Kentaro Hara, Christian Biesinger, AyeAye, npm+...@chromium.org, yigu+...@chromium.org, blink-re...@chromium.org, jmedle...@chromium.org, webauthn...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, blundell+...@chromium.org, iclella...@chromium.org
    Attention needed from Gabriel Viera

    Nina Satragno added 4 comments

    Patchset-level comments
    File-level comment, Patchset 10 (Latest):
    Nina Satragno . resolved

    This looks good enough for some tests now!

    File components/webauthn/android/java/src/org/chromium/components/webauthn/AuthenticatorImpl.java
    Line 228, Patchset 10 (Latest): mReportCallback = callback;
    Nina Satragno . unresolved

    Are we ever using `mReportCallback`? Looks like we can get rid of it.

    Line 229, Patchset 10 (Latest): mIsOperationPending = true;
    Nina Satragno . unresolved

    It looks to me like nothing is clearing `mIsOperationPending`, so if a website calls `report`, they can never again do any webauthn operations. Why are we setting this flag to `true`?

    Line 231, Patchset 10 (Latest): if (!GmsCoreUtils.isWebauthnSupported()
    || (!isChrome(mWebContents) && !GmsCoreUtils.isResultReceiverSupported())) {
    onError(AuthenticatorStatus.NOT_IMPLEMENTED);
    return;
    }
    Nina Satragno . unresolved

    I don't think any of this will apply to the report API once it's implemented by Android's credential manager. Let's just unconditionally immediately resolve `callback` with a success code for now, pretending that the credential ID is not present.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Gabriel Viera
    Submit Requirements:
      • requirement is blockingCode-Coverage
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I57864dd9f5f78e7c79f839d31228c3035384892c
      Gerrit-Change-Number: 5635512
      Gerrit-PatchSet: 10
      Gerrit-Owner: Gabriel Viera <gvi...@google.com>
      Gerrit-Reviewer: Gabriel Viera <gvi...@google.com>
      Gerrit-Reviewer: Ken Buchanan <ke...@chromium.org>
      Gerrit-Reviewer: Nina Satragno <nsat...@chromium.org>
      Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: Kaan Icer <ic...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Luna Lu <loon...@chromium.org>
      Gerrit-Attention: Gabriel Viera <gvi...@google.com>
      Gerrit-Comment-Date: Fri, 28 Jun 2024 15:19:36 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      blocking_requirement
      unsatisfied_requirement
      open
      diffy

      findit-for-me@appspot.gserviceaccount.com (Gerrit)

      unread,
      Jun 28, 2024, 5:23:19 PM (23 hours ago) Jun 28
      to Gabriel Viera, Code Review Nudger, Chromium LUCI CQ, Nina Satragno, Ken Buchanan, Kaan Icer, Luna Lu, Kentaro Hara, Christian Biesinger, AyeAye, npm+...@chromium.org, yigu+...@chromium.org, blink-re...@chromium.org, jmedle...@chromium.org, webauthn...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, blundell+...@chromium.org, iclella...@chromium.org

      findit...@appspot.gserviceaccount.com voted Code-Coverage+1

      This change meets the code coverage requirements.

      Code-Coverage+1
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I57864dd9f5f78e7c79f839d31228c3035384892c
      Gerrit-Change-Number: 5635512
      Gerrit-PatchSet: 11
      Gerrit-Owner: Gabriel Viera <gvi...@google.com>
      Gerrit-Reviewer: Gabriel Viera <gvi...@google.com>
      Gerrit-Reviewer: Ken Buchanan <ke...@chromium.org>
      Gerrit-Reviewer: Nina Satragno <nsat...@chromium.org>
      Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: Kaan Icer <ic...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Luna Lu <loon...@chromium.org>
      Gerrit-Comment-Date: Fri, 28 Jun 2024 21:23:07 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages