javascript-solid-server 0.0.95 → 0.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/db/index.js +3 -0
- package/src/server.js +1 -1
package/package.json
CHANGED
package/src/db/index.js
CHANGED
|
@@ -49,6 +49,9 @@ export async function dbPlugin(fastify, options) {
|
|
|
49
49
|
return reply.code(401).send({ error: 'Unauthorized', message: 'Authentication required' });
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
// Single-user mode: any authenticated user is the owner
|
|
53
|
+
if (options.singleUser) return;
|
|
54
|
+
|
|
52
55
|
// Ownership check: only pod owner can write to /db/{podName}/...
|
|
53
56
|
const urlPath = request.url.split('?')[0];
|
|
54
57
|
const relative = urlPath.replace(/^\/db\//, '');
|
package/src/server.js
CHANGED
|
@@ -236,7 +236,7 @@ export function createServer(options = {}) {
|
|
|
236
236
|
|
|
237
237
|
// Register MongoDB /db/ route if enabled
|
|
238
238
|
if (mongoEnabled) {
|
|
239
|
-
fastify.register(dbPlugin, { mongoUrl, mongoDatabase });
|
|
239
|
+
fastify.register(dbPlugin, { mongoUrl, mongoDatabase, singleUser });
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
// Register rate limiting plugin
|