GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — Require confirmation for code from /create/ links, and restrict credentialed CORS by Karakatiza666 · Pull Request #7806 · feldera/feldera Conversation
|
| .supports_credentials(), | ||
| // Any origin may call the API, but browsers send no cookies or HTTP auth. | ||
| // The API needs neither because clients set the `Authorization` header. | ||
| None => cors.allow_any_origin(), |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
missing / medium (docs, breaking-change gate): This changes the default (allowed_origins unset): browser clients on another origin that use credentials: 'include' (cookies or HTTP auth) now fail CORS. Please document it in three places:
Behavior change entry in docs.feldera.com/docs/changelog.md, next to the other entries under Unreleasedhelm-chart-reference.md:185, which still says "null permits all origins". Add: "without credentials; list origins to allow credentialed requests"--allowed-origins doc comment (config.rs:1315), which becomes the CLI help
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Review: what I ran
I traced every save path for a way to save link code without the dialog. Ctrl+S, Accept Local, conflict auto-push, the leave-page dialog and Start all go through
Otherwise it looks good. The commits are clean and the PR includes tests. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
dbdd3b5 to
8972c2d
Compare
Without `allowed_origins`, the API accepted any origin and also allowed credentials. A page on another site could then send requests with the browser's cookies or HTTP auth. Credentialed CORS is now limited to the origins listed in `allowed_origins`. The any-origin default still lets clients call the API with an `Authorization` header, but no longer allows credentials. This came out of a pentest finding about cross-site requests through the web console. Signed-off-by: Karakatiza666 <[email protected]>
A pentest found that opening a link like `/create/?name=...&program.sql=...&udf.rs=...` created and compiled a pipeline with the link's code on page load, so a third-party page could make the console compile code the user never saw. A /create/ link with code now creates an empty pipeline and opens the link's code as unsaved edits. While the pipeline holds code from a link, autosave is off and every save shows a "Compile code from a link?" dialog that lists the files. Confirming saves all unsaved files and restores the user's autosave setting. Links without code still open a demo by name. CodeEditor gets `autoSave` and `confirmSave` props, an `initialDraft` per file, and a single `saveAll` used by every save path. `saveFile` now resolves to whether the save happened, and declining the save from the unsaved-changes dialog keeps the user on the page. Signed-off-by: Karakatiza666 <[email protected]>
Start, Start paused, Resume and Standby were disabled while the code had unsaved changes. They are now always enabled: they save the code first (which can show the pasted-link confirmation), wait for the in-flight PATCH requests, and then post the start. pipeline-manager starts the pipeline once the compilation ends. The compiling status `cause` 'upgrade' is renamed to 'start', meaning a start is scheduled after the compilation. Start stays enabled while the pipeline compiles with cause 'compile', and in error states when there are unsaved changes that may fix the error. "Cancel start" force-stops without a dialog, since the pipeline has not run yet, and the optimistic status keeps the compiling state. The grayed-out Start is a split button with a disabled chevron, so it keeps the layout of the enabled one. Signed-off-by: Karakatiza666 <[email protected]>
8972c2d to
4cb009f
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.