cloudfoundry / cloudfoundry/stratos
Tidy up API paths, create OpenAPI spec
@ikapelyukhin is already working on this.
Since Aug 25, 2020.
- Dominant language
- TypeScript
- Stars
- 267
- Forks
- 137
- Avg merge
- 5h 14m
- Merged PRs (30d)
- 77
Description
Now that we have API Keys, we should take the time to tidy up the core Stratos API.
We still have references to cnsis instead of endpoints, which should be renamed.
This will impact the frontend code and e2e tests - should be fairly mechanical.
The current backend prefix for requests is /pp/v1/ - I suggest we change that to /api/v1.
Suggest we make available the following APIs using API Keys: (with suggested renames, but feel free to consider alternatives)
- POST /pp/v1/auth/login/cnsi -> /api/v1/tokens
- POST /pp/v1/auth/logout/cnsi -> DELETE /api/v1/tokens/ID (note: ID is currently supplied via a header)
- GET /pp/v1/cnsis -> /api/v1/endpoints
- GET /pp/v1/cnsis/registered -> /api/v1/endpoints/connected (NOTE: I don't believe we use this any more, so we should check and remove)
- POST /pp/v1/register/ENDPOINT_TYPE -> /api/v1/endpoints (endpoint type should be in the request, not as a param)
- POST /pp/v1/endpoint/ID -> POST /api/v1/endpoints/ID
- POST /pp/v1/unregister -> DELETE /api/v1/endpoints/ID (note: ID is currently supplied via a header)
Note: the endpoint registration routes in main.go (around line 959) currently adds a route for each endpoint type - we should change this to be a single route that checks that the endpoint type is supported and then uses the appropriate plugin to do the work - since in the above, the proposal is a single API fo registering endpoints.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.