mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 23:30:20 +00:00
LibWeb: Stub for Credential Management API
Stub out basic Credential Management APIs and import IDL tests. Spec: https://w3c.github.io/webappsec-credential-management/
This commit is contained in:
parent
e14511468f
commit
da9eaf8788
Notes:
github-actions[bot]
2025-02-05 20:19:50 +00:00
Author: https://github.com/devgianlu
Commit: da9eaf8788
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3117
Reviewed-by: https://github.com/ADKaster ✅
20 changed files with 534 additions and 0 deletions
38
Libraries/LibWeb/CredentialManagement/Credential.cpp
Normal file
38
Libraries/LibWeb/CredentialManagement/Credential.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Altomani Gianluca <altomanigianluca@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/CredentialManagement/Credential.h>
|
||||
|
||||
namespace Web::CredentialManagement {
|
||||
|
||||
// https://www.w3.org/TR/credential-management-1/#dom-credential-isconditionalmediationavailable
|
||||
GC::Ref<WebIDL::Promise> Credential::is_conditional_mediation_available(JS::VM& vm)
|
||||
{
|
||||
auto* realm = vm.current_realm();
|
||||
return WebIDL::create_rejected_promise_from_exception(*realm, vm.throw_completion<JS::InternalError>(JS::ErrorType::NotImplemented, "is conditional mediation available"sv));
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/credential-management-1/#dom-credential-willrequestconditionalcreation
|
||||
GC::Ref<WebIDL::Promise> Credential::will_request_conditional_creation(JS::VM& vm)
|
||||
{
|
||||
auto* realm = vm.current_realm();
|
||||
return WebIDL::create_rejected_promise_from_exception(*realm, vm.throw_completion<JS::InternalError>(JS::ErrorType::NotImplemented, "will request conditional creation"sv));
|
||||
}
|
||||
|
||||
Credential::~Credential() { }
|
||||
|
||||
Credential::Credential(JS::Realm& realm)
|
||||
: PlatformObject(realm)
|
||||
{
|
||||
}
|
||||
|
||||
void Credential::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(Credential);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue