Skip to content

Commit 74ffbed

Browse files
heiytorgustavosbarreto
authored andcommitted
feat(gateway): add support for invitation links
- Redirects requests to `/api/namespaces/{tenant-id}/members/invites` to the `cloud-api`. - Supports the new invitation links feature, enabling users to generate and manage namespace invitations.
1 parent d10cb47 commit 74ffbed

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Diff for: gateway/nginx/conf.d/shellhub.conf

+26
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,32 @@ server {
186186
proxy_pass http://upstream_router;
187187
}
188188

189+
{{ if $cfg.EnableEnterprise -}}
190+
location ~^/api/namespaces/[^/]+/members/invites$ {
191+
{{ set_upstream "cloud-api" 8080 }}
192+
193+
auth_request /auth;
194+
auth_request_set $tenant_id $upstream_http_x_tenant_id;
195+
auth_request_set $username $upstream_http_x_username;
196+
auth_request_set $id $upstream_http_x_id;
197+
auth_request_set $api_key $upstream_http_x_api_key;
198+
auth_request_set $role $upstream_http_x_role;
199+
error_page 500 =401 /auth;
200+
proxy_http_version 1.1;
201+
proxy_set_header Connection $connection_upgrade;
202+
proxy_set_header X-Forwarded-Host $host;
203+
proxy_set_header X-Forwarded-Port $x_forwarded_port;
204+
proxy_set_header X-Forwarded-Proto $x_forwarded_proto;
205+
proxy_set_header X-Api-Key $api_key;
206+
proxy_set_header X-ID $id;
207+
proxy_set_header X-Request-ID $request_id;
208+
proxy_set_header X-Role $role;
209+
proxy_set_header X-Tenant-ID $tenant_id;
210+
proxy_set_header X-Username $username;
211+
proxy_pass http://upstream_router;
212+
}
213+
{{ end -}}
214+
189215
{{ if $cfg.EnableEnterprise -}}
190216
location ~ ^/api/namespaces/([^/]+)/support$ {
191217
{{ set_upstream "cloud-api" 8080 }}

0 commit comments

Comments
 (0)