-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support rendering openapi and swagger documents #26802
base: main
Are you sure you want to change the base?
Conversation
If we could pass the yaml/json into the iframe HTML as a data-attribute, we could do away with the very insecure @lunny can you help with that from backend side? Essentially we just need to encode the json/yaml into |
To clarify, before the page is rendered, If yes, I think that's probably doable. |
* origin/main: (1540 commits) Add `interface{}` to `any` replacement to `make fmt`, exclude `*.pb.go` (go-gitea#30461) Fix network error when open/close organization/individual projects and redirect to project page (go-gitea#30387) Avoid losing token when updating mirror settings (go-gitea#30429) Fix label rendering (go-gitea#30456) Add comment for ContainsRedirectURI about the exact match (go-gitea#30457) Update JS and PY deps, lock eslint and related plugins (go-gitea#30452) Refactor cache and disable go-chi cache (go-gitea#30417) Fix admin notice view-detail (go-gitea#30450) Fix mirror error when mirror repo is empty (go-gitea#30432) Add `/public/assets/img/webpack` to ignore files again (go-gitea#30451) Lock a few tool dependencies to major versions (go-gitea#30439) Fix commit status cache which missed target_url (go-gitea#30426) Remove jQuery from the commit graph (except Fomantic) (go-gitea#30395) Fix rename branch 500 when the target branch is deleted but exist in database (go-gitea#30430) Limit the max line length when parsing git grep output (go-gitea#30418) Change the default maxPerPage for gitbucket (go-gitea#30392) Fix the spacing issue in the Project view (go-gitea#30415) Add commit status summary table to reduce query from commit status table (go-gitea#30223) Split `issue edit` code from `repo-legacy.js` into its own file (go-gitea#30419) Check the token's owner and repository when registering a runner (go-gitea#30406) ...
Yes, with the yaml/json passed into the iframe HTML, we avoid having to deal with CORS because no more fetch request is done from the iframe. BTW, If I remove the |
@wxiaoguang maybe you can help me with the backend part described in #26802 (comment). This PR is otherwise ready and working but I would really like to eliminate this fetch request and the insecure iframe |
I guess I wouldn't have enough time to look into it soon (maybe I could try before 1.23 freezing). Some of my thoughts:
|
Hmm yes, |
Continuation of #25824
Fixes: #20852
Current status: working in iframe including light/dark, but I am considering moving it to first-party code as the current security attributes are already essentially the same outcome as first-party code.