refactor(api): tidy the api and shared packages (#2733)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-13 17:37:48 +02:00
1 parent 580401d2dc
commit 5afbf67a70
333 files changed
+10180 -7910

No files matched your search

@@ -189,7 +189,7 @@ describe('ConfigLoader', () => {
test('normalizes each passkey origin independently', async () => {
stubMinimalEnv({
FLUXER_PASSKEY_ADDITIONAL_ALLOWED_ORIGINS:
'http://localhost,http://localhost:3000,https://desktop.example.net,android:apk-key-hash:abc',
'http://localhost,http://localhost:3000,https://desktop.example.net,android:apk-key-hash:keSY4bimyLqZQV7bKXgpa2xYuqXi0qZJzsYtp6gpx7w',
});
const config = await loadConfig();
@@ -198,11 +198,11 @@ describe('ConfigLoader', () => {
'http://localhost:8088',
'http://localhost:3000',
'https://desktop.example.net',
'android:apk-key-hash:abc',
'android:apk-key-hash:keSY4bimyLqZQV7bKXgpa2xYuqXi0qZJzsYtp6gpx7w',
]);
});
test('leaves the default passkey origins untouched', async () => {
test('includes the app origin alongside the default passkey origins', async () => {
stubMinimalEnv();
const config = await loadConfig();
expect(config.auth.passkeys.additional_allowed_origins).toEqual([
@@ -211,6 +211,7 @@ describe('ConfigLoader', () => {
'https://web.canary.fluxer.app',
'android:apk-key-hash:keSY4bimyLqZQV7bKXgpa2xYuqXi0qZJzsYtp6gpx7w',
'android:apk-key-hash:zRmCKDKo3uCX2GDZISjJx8Rzo3J-Y3Gbp7s7mAaUH28',
'http://localhost:8088',
]);
});
@@ -231,7 +232,7 @@ describe('ConfigLoader', () => {
expect(config.auth.passkeys.rp_id).toBe('chat.example.com');
});
test('derives the passkey origin only when the operator clears the default list', async () => {
test('uses only the app origin when the operator clears the default list', async () => {
stubMinimalEnv({
FLUXER_BASE_DOMAIN: 'chat.example.com',
FLUXER_PUBLIC_SCHEME: 'https',
@@ -799,7 +800,7 @@ describe('FLUXER_PUBLIC_ORIGIN', () => {
test('refuses to boot on an origin that is not a bare origin', async () => {
stubMinimalEnv({FLUXER_PUBLIC_ORIGIN: 'https://chat.example.com/app'});
await expect(loadConfig()).rejects.toThrow(
'FLUXER_PUBLIC_ORIGIN must be a scheme, host and optional port such as https://chat.example.com:8443, got https://chat.example.com/app',
'FLUXER_PUBLIC_ORIGIN must be a scheme, host and optional port such as https://chat.example.com:8443',
);
});