Skip to content
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

deployer & gateway: added OpenAPI docs #794

Merged
merged 4 commits into from
Apr 19, 2023

Conversation

iulianbarbu
Copy link
Contributor

@iulianbarbu iulianbarbu commented Apr 13, 2023

Description of change

Added deployer & gateway OpenAPI spec. The raw openapi specs endpoints are scoped to Admin users that will be authorized through an API key. Example for gateway reachable on my localhost:

For gateway openapi spec:

curl -H "Authorization: Bearer test-key" localhost:8001/api-docs/openapi.json

For a specific project deployer:

curl -H "Authorization: Bearer test-key" localhost:8001/projects/{project_name}/api-docs/openapi.json (a specific project deployer docs).

How Has This Been Tested (if applicable)?

Generated the deployer & gateway open api specs and validated them here: https://editor.swagger.io/?_ga=2.66167150.1903807504.1681801827-1400620191.1681387801.

Disclaimer

  1. The openapi docs can be improved by providing better APIs responses error documentation.
  2. I can not manage yet to provide swagger UIs reachable through the gateway. For some reason, I get a 303 response from the gateway when I am trying to connect to the swagger-uis of both gateway/deployer. I think Chrome tries to follow the 303 redirect location but it ends up with a 404 not found. I need to investigate more on this but this PR is mergeable without the fix for swagger ui given they can be generated based on the openapi doc at: https://editor.swagger.io/?_ga=2.66167150.1903807504.1681801827-1400620191.1681387801.

@iulianbarbu iulianbarbu self-assigned this Apr 13, 2023
@iulianbarbu iulianbarbu changed the title deployer: added OpenAPI docs [WIP] deployer: added OpenAPI docs Apr 13, 2023
@iulianbarbu iulianbarbu force-pushed the feat/openapi-deployer-docs branch 2 times, most recently from 8d4af01 to 1d96ab0 Compare April 18, 2023 18:39
@iulianbarbu iulianbarbu changed the title [WIP] deployer: added OpenAPI docs deployer & gateway: added OpenAPI docs Apr 18, 2023
@iulianbarbu iulianbarbu force-pushed the feat/openapi-deployer-docs branch from 1d96ab0 to 7230ab2 Compare April 18, 2023 18:50
@iulianbarbu iulianbarbu requested review from chesedo and oddgrd April 18, 2023 18:51
@iulianbarbu iulianbarbu force-pushed the feat/openapi-deployer-docs branch from 7230ab2 to 131d2e4 Compare April 19, 2023 08:45
Copy link
Contributor

@chesedo chesedo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM

gateway/src/api/latest.rs Outdated Show resolved Hide resolved
gateway/src/api/latest.rs Outdated Show resolved Hide resolved
gateway/src/api/latest.rs Outdated Show resolved Hide resolved
gateway/src/api/latest.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@oddgrd oddgrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, this is very cool, thanks @iulianbarbu!

@oddgrd oddgrd merged commit 66c1948 into shuttle-hq:main Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants