-
Notifications
You must be signed in to change notification settings - Fork 4
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
HDM API #153
Conversation
Role can be either `admin`, `regular` or `api`. The first two represent the two existing roles while the third is added in preparation for API access.
Allows to query for environments, nodes and keys for now. Returned JSON structure might not yet be final.
Search keysThe API does not need a key search implementation. Read-writeWe dont need write support as we only show data within Foreman UI Encrypted valuesFor Foreman integration showing encrypted values is sufficient. Git dir keysHDM can fetch keys from a git repo and shows that these keys are taken from git (when using HDM web UI). API endpointsWithin Foreman we select a node. A node can have a puppet environment configured (pinned) in Foreman. But this is optional. For Foreman we need the node endpoint to get a list of hiera keys and the key endpoint to show in which hierarchies we are able to find data for the requested key. |
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.
initial code looks okay for me.
This will simply use the node's environment.
This was actually missing from my POC foreman and smart proxy plugins, mainly because I forgot about this but also because the API was just not there. I added a Since we opted to leave out everything else for now and the proof of concept works with what is already here, I will remove the draft status from this PR. |
Here are the first steps towards an API for HDM (#87).
For now it only allows to query for environments, nodes and keys, roughly reflecting the initial functionality of HDM from long ago.
The initial documentation is mostly autogenerated and can be previewed e.g. here: https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/betadots/hdm/issue-87/doc/openapi.yaml
At the very least, key search is still missing currently.
Also, the data returned is very limited. E.g. as the API is read-only I did not include the information if a file/value is writable. I also omitted the information if a file has been replaced from a git repo. I am not sure if these features mix well 😕
I am not sure what we discussed regarding encrypted values. For now I return them verbatim, i.e. no decryption is performed. This is the safest approach from a security perspective, but it severly limits the usefulness of the API.
In the end I believe one or more actual use-cases would help to find out what is actually missing or should be implemented differently. Maybe the foreman integration can be such a use-case.
Closes #87.