Test that READ_ONLY=true blocks every write
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js
Research direction
Read the CONFIG.readOnly and authenticate() logic in server/server.js, then follow the existing server setup in tests/api.test.mjs. Start a second server on another port with its own data folder and READ_ONLY: 'true'. Add checks for the two reads and both 403 write responses, then stop the server and remove its data folder; done when npm test passes.
Written by the indexing model from the issue text.
Description
The task
READ_ONLY=true freezes the map for everyone: every account, admins included, is treated as a viewer. It is documented in the README and used in practice to freeze a map during an audit, but no test checks it. Add one, so that a future change cannot silently make a read-only server writable again.
Where to look
server/server.js:CONFIG.readOnly, andauthenticate()(around line 254), which downgrades every role toviewertests/api.test.mjs: the existing tests start one server inbefore(). A read-only server needs its own: start a second one on another port and data folder, withREAD_ONLY: 'true', the same waybefore()does
Done when
- With
READ_ONLY=true, an admin can still read (GET /api/state,GET /api/mesaysreadOnly: true) - The same admin gets
403on a write (PUT /api/si/...) and onPOST /api/rollback - The second server is stopped and its data folder removed at the end of the test
-
npm testpasses
Mentor
@0b3l1X-SolidGeeks
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 14m
- Merged PRs (30d)
- 31
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SolidGeeks/strata
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SolidGeeks/strata#21 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 22/100
SolidGeeks/strata#22 ·
Maintainers usually reply within 1 day
-
help wanted
Difficulty 4/5 3-5 days Newbie friendliness 48/100
SolidGeeks/strata#20 ·
Maintainers usually reply within 1 day
All issues in SolidGeeks/strata
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
fossasia/scrum_helper#949 ·
Maintainers usually reply within 2 days
-
Learn Faust tutorial: Blocks step says Faust loads block CSS, but no WordPress styles are appliedOpen[Type] Bug Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
TheOdinProject/curriculum#31493 ·
Maintainers usually reply within 1 day
-
[Report] Some official plugins are marked as Stable, but their Readme says they are experimentalOpen
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
TiddlyWiki/TiddlyWiki5#10061 ·
Maintainers usually reply within 1 day
-
documentation ready
Difficulty 1/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day