mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +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
47
Libraries/LibWeb/CredentialManagement/Credential.h
Normal file
47
Libraries/LibWeb/CredentialManagement/Credential.h
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Altomani Gianluca <altomanigianluca@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibWeb/Bindings/CredentialPrototype.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/WebIDL/Promise.h>
|
||||
|
||||
namespace Web::CredentialManagement {
|
||||
|
||||
class Credential : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(Credential, Bindings::PlatformObject);
|
||||
GC_DECLARE_ALLOCATOR(Credential);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static GC::Ref<Credential> create(JS::Realm&);
|
||||
|
||||
static GC::Ref<WebIDL::Promise> is_conditional_mediation_available(JS::VM&);
|
||||
static GC::Ref<WebIDL::Promise> will_request_conditional_creation(JS::VM&);
|
||||
|
||||
virtual ~Credential() override;
|
||||
|
||||
String const& id() { return m_id; }
|
||||
String const& name() { return m_name; }
|
||||
String const& icon_url() { return m_icon_url; }
|
||||
|
||||
virtual String type() = 0;
|
||||
|
||||
protected:
|
||||
explicit Credential(JS::Realm&);
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
String m_id;
|
||||
String m_name;
|
||||
String m_icon_url;
|
||||
};
|
||||
|
||||
struct CredentialData {
|
||||
String id;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue