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

LibWeb: Implement most CredentialsContainer methods #3495

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

devgianlu
Copy link
Contributor

@devgianlu devgianlu commented Feb 7, 2025

This PR mplements get, store, create on CredentialsContainer.

Notably, it also introduces the CredentialInterface abstract class to deal with credentials internal methods and metadata. It has been implemented as a singleton for each credential type. This is the design that I managed to come up with, any suggestion is appreciated.

The spec isn't the best and contains some bugs:

  • The options.signal && options.signal->aborted() check in get and create is not deferred therefore fails two WPT tests
  • The interfaces.size() < 1 check in create is custom and avoids an out of bound access in the next step -> Spec issue
  • The CredentialRequestOptions IDL dictionary has a default value for password which renders the credential type always active. I think we are supposed to reject it when computing the relevant credential interface objects if password is false, but that's not specified

I'll create some spec issues and link them here even if the repository has been inactive for the last 6 months.

Lastly, I am unsure how to check If settings’s relevant global object has no associated Document so I've left two TODOs.

Provide the default implementation for
`is_conditional_mediation_available` and
`will_request_conditional_creation`.
The introduction of the abstract `CredentialInterface` class serves to
implement what is mentioned in the spec as "interface objects". It is
not possible to implement this perfectly to spec in Ladybird so let's
make use of a custom abstraction.
This is probably a spec bug. If the property has a default value it will
always be populated in the `CredentialRequestOptions` dictionary making
that credential type always active.
@devgianlu devgianlu force-pushed the credentials-cont branch 2 times, most recently from c197740 to 795803e Compare February 7, 2025 18:22
Implement `get`, `store`, `create` on `CredentialsContainer`. Some
pieces that we don't support yet, like permissions and custom user
interactions, are left as TODO.

The `rejects when aborted after the promise creation` tests are broken
because the spec says to check the aborted signal synchronously.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant