-
Notifications
You must be signed in to change notification settings - Fork 416
Collaboration access improvement #472
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
Changes from all commits
71c50c4
8ae5f95
4ca5568
0297052
e7565f0
096837a
cb2bf25
a4dfd7d
1e5976e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,58 @@ server { | |
| server_name localhost; | ||
| charset utf-8; | ||
|
|
||
| # Proxy auth for collaboration server | ||
| location /collaboration/ws/ { | ||
| # Collaboration Auth request configuration | ||
| auth_request /collaboration-auth; | ||
| auth_request_set $authHeader $upstream_http_authorization; | ||
| auth_request_set $canEdit $upstream_http_x_can_edit; | ||
| auth_request_set $userId $upstream_http_x_user_id; | ||
|
|
||
| # Pass specific headers from the auth response | ||
| proxy_set_header Authorization $authHeader; | ||
| proxy_set_header X-Can-Edit $canEdit; | ||
| proxy_set_header X-User-Id $userId; | ||
|
|
||
| # Ensure WebSocket upgrade | ||
| proxy_http_version 1.1; | ||
| proxy_set_header Upgrade $http_upgrade; | ||
| proxy_set_header Connection "Upgrade"; | ||
|
|
||
| # Collaboration server | ||
| proxy_pass http://y-provider:4444; | ||
|
|
||
| # Set appropriate timeout for WebSocket | ||
| proxy_read_timeout 86400; | ||
| proxy_send_timeout 86400; | ||
|
|
||
| # Preserve original host and additional headers | ||
| proxy_set_header Host $host; | ||
| } | ||
|
|
||
| location /collaboration-auth { | ||
| proxy_pass http://app-dev:8000/api/v1.0/documents/collaboration-auth/; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Original-URL $request_uri; | ||
|
|
||
| # Prevent the body from being passed | ||
| proxy_pass_request_body off; | ||
| proxy_set_header Content-Length ""; | ||
| proxy_set_header X-Original-Method $request_method; | ||
| } | ||
|
|
||
| location /collaboration/api/ { | ||
| # Collaboration server | ||
| proxy_pass http://y-provider:4444; | ||
| proxy_set_header Host $host; | ||
| } | ||
|
Comment on lines
+49
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. then who is doing authentication on this route? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This route will be used only by the django backend, so we don't want to pass by Ngnix is here only to do the "sticky" to find automatically the good pods. The security is mainly this part; |
||
|
|
||
| # Proxy auth for media | ||
| location /media/ { | ||
| # Auth request configuration | ||
| auth_request /auth; | ||
| auth_request /media-auth; | ||
| auth_request_set $authHeader $upstream_http_authorization; | ||
| auth_request_set $authDate $upstream_http_x_amz_date; | ||
| auth_request_set $authContentSha256 $upstream_http_x_amz_content_sha256; | ||
|
|
@@ -21,8 +70,8 @@ server { | |
| proxy_set_header Host minio:9000; | ||
| } | ||
|
|
||
| location /auth { | ||
| proxy_pass http://app-dev:8000/api/v1.0/documents/retrieve-auth/; | ||
| location /media-auth { | ||
| proxy_pass http://app-dev:8000/api/v1.0/documents/media-auth/; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why this is necessary and not use the normal api url
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can maybe clear a bit.
We cannot use the normal api url, when we arrive here we are in the ngnix container, so we need to call the back with its docker compose service name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's peer code because I don't see very clearly how it could be by just reviewing