-
Notifications
You must be signed in to change notification settings - Fork 16
api: add schema and stubs for bootstrap token CRUD #384
Conversation
add depenedency on ctrl-generate and ctrl-manifests tasks
go generate ./... | ||
make ctrl-generate | ||
make ctrl-manifests | ||
make gen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
application/json: | ||
schema: | ||
"$ref": "#/components/schemas/Error" | ||
"/namespaces/{namespace}/gateways/{name}/tokens/{id}": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a retrieval endpoint or should we assume that the token is only available on generation? I'm not sure how secure we need these to be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I wasn't sure about this either, thoughts @andrewstucki?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will keep this for now and remove later if not needed (assuming all of this may be subject to change depending on how our VM/API work evolves), agreed it might be useful for returning metadata about a token like TTL, revocation status, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stubs look good to me, just the one question about if we should have the GET endpoint for tokens. We might want to keep it and have it just return some metadata about the tokens, not sure.
Changes proposed in this PR:
make gen
command to install oapi-codegen if necessary and regenerate generated code and golden test files.How I've tested this PR:
Running
make gen
andgo test ./...
ininternal/api/v1
to make sure I didn't accidentally break anything.How I expect reviewers to test this PR:
Is there a less verbose way to nest sub-paths like the token CRUD operations under
/gateway/{name}/
in the OpenAPI schema?Checklist: