chore(inspector): add back database tab#4255
Conversation
|
🚅 Deployed to the rivet-pr-4255 environment in rivet-frontend
|
PR Review: chore(inspector): add back database tabThis PR does two distinct things: (1) restores the Database tab to the actor inspector UI, and (2) refactors access control from a single BugsDead code in The two raw if (isEventSchemaDefinition(schema)) { return schema.schema; } // catches { schema: defined }
if (isQueueSchemaDefinition(schema)) { return schema.message; } // catches { message: defined, non-event }
// These two never execute — the conditions above already cover them
if (typeof schema === 'object' && 'schema' in schema && ...) { ... }
if (typeof schema === 'object' && 'message' in schema && ...) { ... }These should be removed. Indentation regression in The Indentation regression in The newly added Design / API concernsUnused generic parameter on export type QueueSchemaConfig<TContext = any> = Record<string, QueueSchema>;
Raw WebSocket authorization silently dropped
The old MinorUndefined event warning could use a comment In What looks good
|
578d019 to
ebbe0a2
Compare
2299455 to
5cd4249
Compare
ebbe0a2 to
240add0
Compare
5cd4249 to
f5dbebd
Compare
240add0 to
88fcb5f
Compare
f5dbebd to
5cd4249
Compare
88fcb5f to
240add0
Compare
5cd4249 to
d1bce69
Compare
240add0 to
070db06
Compare
070db06 to
3c2f302
Compare
d1bce69 to
2654312
Compare
| onBeforeConnect: (_c, params: AccessControlConnParams) => { | ||
| if (params?.allowRequest === false || params?.allowWebSocket === false) { | ||
| throw new Forbidden(); | ||
| } |
There was a problem hiding this comment.
Critical Logic Bug: Inverted Access Control Logic
The new onBeforeConnect hook has inverted the access control logic compared to the old canInvoke implementation:
Old behavior (lines 49-63 in original):
- Request: Deny by default, allow only if
params?.allowRequest === true - WebSocket: Deny by default, allow only if
params?.allowWebSocket === true
New behavior:
- Denies only if
params?.allowRequest === falseorparams?.allowWebSocket === false - Allows by default when params is undefined or when these fields are undefined
This means connections that were previously denied (when params are not explicitly set to true) will now be allowed, creating a security vulnerability.
Fix:
onBeforeConnect: (_c, params: AccessControlConnParams) => {
if (params?.allowRequest !== true || params?.allowWebSocket !== true) {
throw new Forbidden();
}
}Or to match the old deny-by-default behavior more precisely:
onBeforeConnect: (_c, params: AccessControlConnParams) => {
if (!params?.allowRequest && !params?.allowWebSocket) {
throw new Forbidden();
}
}| onBeforeConnect: (_c, params: AccessControlConnParams) => { | |
| if (params?.allowRequest === false || params?.allowWebSocket === false) { | |
| throw new Forbidden(); | |
| } | |
| onBeforeConnect: (_c, params: AccessControlConnParams) => { | |
| if (params?.allowRequest !== true || params?.allowWebSocket !== true) { | |
| throw new Forbidden(); | |
| } | |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
2654312 to
b9b4e42
Compare
3c2f302 to
62a8778
Compare
b9b4e42 to
d1bce69
Compare
62a8778 to
070db06
Compare
d1bce69 to
a809615
Compare
070db06 to
ada2163
Compare
a809615 to
b96f19e
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: