-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature request and offer to implement :) #18
Comments
Hi @ncode, thank you so much for the nice feedback. I think that should be doable. https://github.com/mxab/nacp/blob/main/admissionctrl/mutator/json_patch_webhook.go#L47C14-L47C18 Currently the signature of the internal Controller/Mutate methods does not include any kind of additional context beside the job I guess creating such a context is possible just not sure if we should just focus on those two values of yours. Also does it make sense to forwards such sensitive information to every remote validator/mutators? Any toughts? Just out of curiosity, could you describe your use case a little bit more? |
Hi @mxab, Sure!
That's exactly what I thought!
Yes. I can give you a few examples:
For all of the above scenarios we need as the fist step to resolve the accessor id. Thinking a bit more, if we have a property that's exposes the content of token self and the called address (without propagating the authentication token id), I'd still be able to implement all the examples above. |
Neat :)
Would it make sense to introduce a new component? I was in general thinking about a generic "side effecter" hook as third step. It could be used for logging but also to potentially to pre provision required infrastructure before the job is initially deployed
So the idea would NACP does a token self lookup for hooks that need it, create a kind of CallerContext which is passed to the mutator/validator. for the embedded OPA validator the rules would change I guess since it should be part of the input or we could move this context to the data field |
It makes a lot of sense. It becomes a very flexible way of hooking different actions.
Yes. The only "downside" is to require an extra call on each request, which sounds pretty ok tbh.
I'm still building knowledge on OPA, so I can comment later :) |
I would make it configurable per hook e.g I can try to come up with something but I'm currently traveling so don't expect anything too soon |
That's pretty similar to what I had in mind 😄
No worries. I can also work on it and open a PR, we can discuss the changes required. |
Hi @mxab,
Thanks a lot for your project. It's pretty awesome how much you can extend nomad with it. I'm thinking about having a broader support for acl management in nomad and I could for sure use mutators for that. For it to work I'd need to propagate the token and the client ip to a downstream call during the mutator flow. Is that something you see a fit for the project? I'm happy to send a PR with the implementation if so.
Thanks!
The text was updated successfully, but these errors were encountered: