hubmapconsortium / aws-api-gateway

API definitions, Lambda functions/authorizers/layer, and documentations to work with AWS API Gateway
1 stars 0 forks source link

Put User Workspaces REST API behind AWS API Gateway #2

Closed yuanzhou closed 2 years ago

yuanzhou commented 2 years ago

Endpoints from Juan:

POST /tokens/

GET /workspaces/
GET /workspaces/<workspace_id>
GET /workspaces/?query_params
POST /workspaces/
PUT /workspaces/<workspace_id>

GET /jobs/
GET /jobs/<job_id>
GET /jobs/?query_params
PUT /jobs/<job_id>

GET /job_types/

Two items need further attention:

  1. I'm not sure how AWS API Gateway would handle the endpoints with query string. Things like

    GET /jobs/
    GET /jobs/?query_params

    will need to be defined as the same resource. Maybe I won't need to worry about GET /jobs/?query_params ...

  2. And in terms of security/access control, I'm not sure how AWS API Gateway would integrate with the PSC.

yuanzhou commented 2 years ago

Resource from Matt: https://aws.amazon.com/blogs/security/how-to-enhance-amazon-cloudfront-origin-security-with-aws-waf-and-aws-secrets-manager/

yuanzhou commented 2 years ago
yuanzhou commented 2 years ago

More resources:

shirey commented 2 years ago

After further review and discussion with Juan we've decided to not put this behind the AWS Gateway.

yuanzhou commented 2 years ago

From Juan:

Domain split between HTTP/WS/“Passthrough” Passthrough here refers to the traffic that has to go through to JupyterLab (and any other interactive software) HTTP/WS would live under AWS API Gateway Passthrough traffic would have to be done outside of the context of the AWS API Gateway Traffic would have to be opened up to the public for that particular “passthrough” domain. Development effort would have to be spent on modifying the passthrough URLs. Regardless of the option that we choose here, we wouldn’t be able to leverage the AWS API Gateway Globus authentication for the “passthrough” functionality anyway, as I don’t have any control over the headers/cookies that JupyterLab sets.

we can proceed with setting up AWS API REST/Websockets for everything except the /passthrough routes. They can have different domain names.

We'll have the following domains:

shirey commented 2 years ago

This is complete for the RESTful endpoints, will track the work for web sockets here: https://github.com/hubmapconsortium/devops/issues/21

yuanzhou commented 2 years ago

Update: AWS API Gateway doesn't support websocket proxy to another backend websocket. We'll be using nginx on-prem to handle the call on PSC. PSC will get new domain and ssl cert for this.

yuanzhou commented 2 years ago

Working version on DEV: https://github.com/hubmapconsortium/devops/issues/21#issuecomment-1126189744