feat: add dataset consent and primary character model
This commit is contained in:
@@ -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({});
|
||||
|
||||
Reference in New Issue
Block a user