chore: initialize from frontend template 4dc033c
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
export function createOwnedBrowserStorageCapabilities() {
|
||||
return {
|
||||
local: localStorage,
|
||||
session: sessionStorage,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export function createOwnedCrossContextCapabilities() {
|
||||
return {
|
||||
channel: new BroadcastChannel("owned-cross-context-fixture"),
|
||||
storage: localStorage,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import type { BrowserStoragePolicy } from "../../../../src/application/ports/browser-file-storage/shared.ts";
|
||||
|
||||
export const POLICY: BrowserStoragePolicy = {
|
||||
owner: "fixture-owner",
|
||||
namespace: "fixture",
|
||||
classification: "INTERNAL",
|
||||
authority: "RECONSTRUCTABLE",
|
||||
accountScope: "OPAQUE_PARTITION",
|
||||
retention: { kind: "TTL", maxAgeMs: 1_000 },
|
||||
softBudgetBytes: 1_000,
|
||||
hardBudgetBytes: 2_000,
|
||||
evictionPriority: "RECONSTRUCTABLE",
|
||||
logoutAction: "EXPORT_THEN_PURGE",
|
||||
accountDeletionAction: "PURGE_PARTITION",
|
||||
pressureAction: "RETAIN",
|
||||
unavailableFallback: "ONLINE_ONLY",
|
||||
};
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
export function bypassThroughAlias() {
|
||||
const browser = globalThis;
|
||||
return browser.indexedDB.open("forbidden");
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class BrowserRootHolder {
|
||||
readonly root = globalThis;
|
||||
}
|
||||
|
||||
new BrowserRootHolder().root.indexedDB.open("forbidden");
|
||||
@@ -0,0 +1,4 @@
|
||||
export function bypassThroughComputedAlias() {
|
||||
const browser = globalThis;
|
||||
return browser["caches"].open("forbidden");
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class BrowserRootBox {
|
||||
constructor(readonly root: typeof globalThis) {}
|
||||
}
|
||||
|
||||
new BrowserRootBox(globalThis).root.indexedDB.open("forbidden");
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export function bypassThroughDefault(browser = globalThis) {
|
||||
return browser.indexedDB.open("forbidden");
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function constructBlobOutsideOwnedAdapter() {
|
||||
return new Blob(["forbidden"]);
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export function openBroadcastChannelDirectly() {
|
||||
return new BroadcastChannel("forbidden");
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export function openCacheDirectly() {
|
||||
return caches.open("forbidden");
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function openDatabaseDirectly() {
|
||||
return indexedDB.open("forbidden");
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export function writeLocalStorageDirectly() {
|
||||
localStorage.setItem("forbidden", "value");
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function openOpfsDirectly() {
|
||||
return navigator.storage.getDirectory();
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export function writeSessionStorageDirectly() {
|
||||
sessionStorage.setItem("forbidden", "value");
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
export function bypassThroughDynamicCapabilityKey() {
|
||||
const browser = globalThis;
|
||||
const capability = "indexedDB";
|
||||
return browser[capability].open("forbidden");
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
export function bypassThroughObjectContainer() {
|
||||
const holder = { browser: globalThis };
|
||||
return holder.browser.indexedDB.open("forbidden");
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export function bypassThroughGlobalThis() {
|
||||
return globalThis.indexedDB.open("forbidden");
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
function identity<Value>(value: Value): Value {
|
||||
return value;
|
||||
}
|
||||
|
||||
export function bypassThroughIdentityWrapper() {
|
||||
return identity(globalThis).indexedDB.open("forbidden");
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
const holder: { root?: typeof globalThis } = {};
|
||||
|
||||
holder.root = globalThis;
|
||||
holder.root.indexedDB.open("forbidden");
|
||||
@@ -0,0 +1,3 @@
|
||||
export function allocateObjectUrlDirectly(value: never) {
|
||||
return URL.createObjectURL(value);
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
export function bypassThroughPropertyDescriptor() {
|
||||
const descriptor = Object.getOwnPropertyDescriptor(
|
||||
globalThis,
|
||||
"indexedDB",
|
||||
);
|
||||
return (descriptor?.value as IDBFactory).open("forbidden");
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function bypassThroughReflection() {
|
||||
return Reflect.get(globalThis, "indexedDB");
|
||||
}
|
||||
Reference in New Issue
Block a user