mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-26 05:01:53 +08:00
refactor(authorization): simplify cross-instance testing
CI / Test and build (push) Canceled after 0s
CI / Test and build (push) Canceled after 0s
This commit is contained in:
@@ -69,87 +69,6 @@ describe('versioned Bridge capability catalog', () => {
|
||||
access: 'dangerous',
|
||||
scopes: ['browser.isolation.manage'],
|
||||
});
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.authorization.context.capture')).toMatchObject({
|
||||
domain: 'authorization',
|
||||
access: 'sensitive-read',
|
||||
scopes: ['browser.isolation.read', 'browser.cookies.read', 'browser.storage.read'],
|
||||
targetMode: 'document',
|
||||
});
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.authorization.context.get')).toMatchObject({
|
||||
domain: 'authorization',
|
||||
access: 'sensitive-read',
|
||||
scopes: ['browser.isolation.read', 'browser.cookies.read', 'browser.storage.read'],
|
||||
targetMode: 'none',
|
||||
});
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.authorization.context.attest')).toMatchObject({
|
||||
domain: 'authorization',
|
||||
access: 'sensitive-read',
|
||||
scopes: ['browser.isolation.read', 'browser.cookies.read', 'browser.storage.read'],
|
||||
targetMode: 'document',
|
||||
});
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.authorization.context.attestation.get')).toMatchObject({
|
||||
domain: 'authorization',
|
||||
access: 'sensitive-read',
|
||||
scopes: ['browser.isolation.read', 'browser.cookies.read', 'browser.storage.read'],
|
||||
targetMode: 'none',
|
||||
});
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.authorization.baseline.capture')).toMatchObject({
|
||||
domain: 'authorization',
|
||||
access: 'sensitive-read',
|
||||
scopes: ['browser.network.sensitive.read', 'browser.isolation.read', 'browser.cookies.read', 'browser.storage.read'],
|
||||
targetMode: 'document',
|
||||
});
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.authorization.baseline.get')).toMatchObject({
|
||||
domain: 'authorization',
|
||||
access: 'sensitive-read',
|
||||
scopes: ['browser.network.sensitive.read', 'browser.isolation.read', 'browser.cookies.read', 'browser.storage.read'],
|
||||
targetMode: 'none',
|
||||
});
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.authorization.baseline.logical.bind')).toMatchObject({
|
||||
domain: 'authorization',
|
||||
access: 'dangerous',
|
||||
scopes: expect.arrayContaining(['browser.network.sensitive.read', 'browser.transform.execute']),
|
||||
targetMode: 'none',
|
||||
});
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.authorization.baseline.candidates')).toMatchObject({
|
||||
domain: 'authorization',
|
||||
access: 'read',
|
||||
scopes: ['browser.network.read', 'browser.isolation.read', 'browser.cookies.read', 'browser.storage.read'],
|
||||
targetMode: 'document',
|
||||
});
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.authorization.baseline.resource.get')).toMatchObject({
|
||||
domain: 'authorization',
|
||||
access: 'sensitive-read',
|
||||
scopes: ['browser.network.sensitive.read', 'browser.isolation.read', 'browser.cookies.read', 'browser.storage.read'],
|
||||
targetMode: 'none',
|
||||
});
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.authorization.baseline.compile')).toMatchObject({
|
||||
domain: 'authorization',
|
||||
access: 'dangerous',
|
||||
scopes: ['browser.network.replay', 'browser.network.sensitive.read', 'browser.isolation.read', 'browser.cookies.read', 'browser.storage.read'],
|
||||
targetMode: 'none',
|
||||
});
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.authorization.baseline.packet.compile')).toMatchObject({
|
||||
domain: 'authorization',
|
||||
access: 'dangerous',
|
||||
scopes: ['browser.network.replay', 'browser.network.sensitive.read', 'browser.isolation.read', 'browser.cookies.read', 'browser.storage.read'],
|
||||
targetMode: 'none',
|
||||
});
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.authorization.baseline.transform.inspect')).toMatchObject({
|
||||
domain: 'authorization',
|
||||
access: 'sensitive-read',
|
||||
scopes: expect.arrayContaining(['browser.transform.read']),
|
||||
targetMode: 'none',
|
||||
});
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.authorization.baseline.transform.compile')).toMatchObject({
|
||||
domain: 'authorization',
|
||||
access: 'dangerous',
|
||||
scopes: expect.arrayContaining(['browser.network.replay', 'browser.transform.execute']),
|
||||
targetMode: 'none',
|
||||
});
|
||||
expect(capabilityBaseScope('browser.authorization.baseline.compile')).toBe('browser.network.replay');
|
||||
expect(capabilityBaseScope('browser.authorization.baseline.packet.compile')).toBe('browser.network.replay');
|
||||
expect(capabilityBaseScope('browser.authorization.baseline.transform.compile')).toBe('browser.network.replay');
|
||||
expect(catalog.capabilities.find((capability) => capability.method === 'browser.isolation.container.open')).toBeUndefined();
|
||||
expect(capabilityBaseScope('missing.capability')).toBeUndefined();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user