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

internal endpoints swagger additional endpoints #3007

Merged

Conversation

supersven
Copy link
Contributor

@supersven supersven commented Jan 20, 2023

This adds internal Servant endpoints to the Swagger docs for internal endpoints. (brig and cannon endpoints were already there.)

To have them available I had to move some types from galley-types to wire-api. spar and galley internal API definitions haven been moved there, too.

Follow up to #3003

Rendered

image

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@supersven supersven temporarily deployed to cachix January 20, 2023 15:12 — with GitHub Actions Inactive
@supersven supersven temporarily deployed to cachix January 20, 2023 15:12 — with GitHub Actions Inactive
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Jan 20, 2023
@supersven supersven force-pushed the sventennie/internal-endpoints-swagger_additional_endpoints branch from 4dafe4c to 161475e Compare January 20, 2023 17:27
@supersven supersven force-pushed the sventennie/internal-endpoints-swagger_additional_endpoints branch 2 times, most recently from 2950e48 to 4eba89f Compare February 15, 2023 10:48
Start the ToSchema party with brig and cannon

Remove unnecessary module qualifier

Fix type error

Fix

Create instance `ToSchema List1`

Add swagger tags (resulting in sections)

Replace over with %~

Introduce SwaggerTag combinator

Use lens

Add some documentation text

Test RawJson FromJSON/ToJSON

Cleanup

Delete unused endpoint

Align title with cannon's swagger title

Delete Won't-do ToDos

Add changelog

Remove superfluous comment

Add docs about Swagger

Describe the swagger URL pattern better

Use versions in swagger endpoint

Update docs

Move example section

Fix typo

Update swagger.md

Old Swagger is now gone.

Update services/brig/src/Brig/API/Public.hs

Co-authored-by: fisx <mf@zerobuzz.net>

Update services/brig/docs/swagger-internal-endpoints.md

Co-authored-by: fisx <mf@zerobuzz.net>

Update changelog.d/2-features/internal-endpoints-swagger

Co-authored-by: fisx <mf@zerobuzz.net>

Update libs/wire-api/src/Wire/API/SwaggerServant.hs

Co-authored-by: fisx <mf@zerobuzz.net>

Update libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs

Co-authored-by: fisx <mf@zerobuzz.net>

Remove redundant constraint

Simplify operations tagging with allOperations Traversal

Use LText as data store of RawJson

Replace ToSchema instance with function

Increase lazy-ness of ToSchema RawJson instance

Remove ToSchema for internal data structures

Swagger docs for internal endpoints of Legalhold and Cargohold

Move galley's internal endpoint to wire-api

Swagger for internal Galley endpoints

Add spar's internal endpoints
@supersven supersven force-pushed the sventennie/internal-endpoints-swagger_additional_endpoints branch from f59abbf to 13e157a Compare February 16, 2023 07:32
@supersven supersven marked this pull request as ready for review February 17, 2023 06:47
Displayed paths are prefixed by the service name (e.g. `/<brig>`). This is
necessary because Swagger does not expect more than one endpoint for a given
path and method. Though, some paths (e.g. `/i/status`) exist on more than one
service. To use the a path, remove the prefix.
Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively, we could expose the internal swagger UI for each service on their own page?

Is it possible to use the swagger UI to call those endpoints, the way it is implemented now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the inspiration! I was more focused on the overview over all endpoints. However, being able to use the endpoints is pretty appealing, too.

As this should be possible with a kubectl port-forward, I'll give it a shot.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe different PR, though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe different PR, though?

@fisx , Sounds good 👍

@supersven supersven merged commit bd9d33f into develop Feb 17, 2023
@supersven supersven deleted the sventennie/internal-endpoints-swagger_additional_endpoints branch February 17, 2023 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants