Add endpoint to check if user has access to a given workspace host for Workspaces HTTP Server
MR: Add internal API endpoint for workspace authori... (!203350 - merged) • Chad Woolley • 18.4
Description
As part of protecting all workspaces traffic by OAuth, we need an authorization endpoint in Rails which will take the user_id
and workspace_host
(e.g. 123-ws1.workspaces.example.com
) as inputs, return if the user has access to that given workspace(ws1
). The response would be as follows
If user is accessing 123-ws1.workspaces.example.com
(where the workspace with name ws1
has id 1
), the response would be -
status: AUTHORIZED
info:
workspace_id: 1
workspace_port: 123
Scenarios where either the workspace is not found or port is not found or user is not authorized.
status: WORKSPACE_NOT_FOUND / PORT_NOT_FOUND / NOT_AUTHORIZED
info: {}
Acceptance criteria
TODO: Fill out (required)
-
[Describe what must be achieved to complete this issue.] -
[If applicable, please provide design specifications for this feature/enhancement.] -
[If applicable, please list any technical requirements (performance, security, database, etc.)]
Implementation plan
TODO: Fill out or delete (optional)
[Provide a high-level plan for implementation of this issue, including relevant technical and/or design details.]