Restrict plugin lookups and reuse cached chat reads (Refs #98)
This commit is contained in:
@@ -339,13 +339,15 @@ describe('browser authentication guard', () => {
|
||||
['GET', '/api/drift'],
|
||||
['HEAD', '/api/drift'],
|
||||
['GET', '/api/plugins/github/release'],
|
||||
['HEAD', '/api/plugins/github/release']
|
||||
['HEAD', '/api/plugins/github/release'],
|
||||
['GET', '/api/plugins/updates'],
|
||||
['HEAD', '/api/plugins/updates']
|
||||
])('restricts expensive %s %s requests before handler execution', async (method, route) => {
|
||||
const anonymous = requestFor(route, { method, cookie: null });
|
||||
expect((await anonymous.invoke()).status).toBe(401);
|
||||
expect(anonymous.resolve).not.toHaveBeenCalled();
|
||||
|
||||
for (const role of ['viewer', 'super_viewer', 'operator', 'admin'] as const) {
|
||||
for (const role of ['viewer', 'super_viewer', 'operator', 'moderator', 'admin'] as const) {
|
||||
signIn(role);
|
||||
const call = requestFor(route, { method });
|
||||
const allowed = role === 'operator' || role === 'admin';
|
||||
|
||||
Reference in New Issue
Block a user