feat: add dataset consent and primary character model

This commit is contained in:
jb
2026-09-19 12:12:10 -04:00
parent a3dc8637f0
commit 4d3c7a7521
23 changed files with 1068 additions and 138 deletions
+18
View File
@@ -101,6 +101,24 @@ describe('EVE SSO adapter', () => {
expect(fixture.calls[0]!.init?.signal).toBeInstanceOf(AbortSignal);
});
test('uses the server-selected capability scope list without expanding it', async () => {
const fixture = mockFetch({});
const url = new URL(await sso(fixture).authorizationUrl('state', 'challenge', [
'esi-assets.read_assets.v1',
'esi-wallet.read_character_wallet.v1',
]));
expect(url.searchParams.get('scope')).toBe('esi-assets.read_assets.v1 esi-wallet.read_character_wallet.v1');
});
test('rejects duplicate, empty and non-allowlisted authorization scopes', async () => {
const fixture = mockFetch({});
const client = sso(fixture);
await expect(client.authorizationUrl('state', 'challenge', [])).rejects.toThrow('Invalid EVE SSO requested scopes');
await expect(client.authorizationUrl('state', 'challenge', ['esi-assets.read_assets.v1', 'esi-assets.read_assets.v1'])).rejects.toThrow('Invalid EVE SSO requested scopes');
await expect(client.authorizationUrl('state', 'challenge', ['esi-evil.read_everything.v1'])).rejects.toThrow('Invalid EVE SSO requested scopes');
expect(fixture.calls).toHaveLength(0);
});
test('refreshes cached discovery metadata after its bounded TTL', async () => {
let clock = NOW;
const fixture = mockFetch({});