Allows user to specify policies in the POST request.
@gnaponie @lucarval Can you PTAL ?
Some of these options were deprecated - blacklist, relevance_key and relevance_value.
blacklist
relevance_key
relevance_value
Why is this needed? Is there task for this?
Allows user to specify policies in the POST request. Why is this needed? Is there task for this?
It is a request from another team.
What is the request? Is this useful to test policies before committing them to Greenwave configuration? Or do they plan to use this method instead of Greenwave configuration?
It's not clear how to use the new user_policies field and there is no documentation either.
user_policies
Documentation should come right away. @yashn maybe can you add the doc in another commit of this PR? The plan it is to have an "on-demand" decision check, using only the policies in input.
The indentation was correct before (it's now harder to see where the condition ends and body begins). I expect pylint or flake8 to complain.
I would write the exact name of the parameters: s/decision context/decision_context/g s/user policies/user_policies/g
I'm getting a bit confused about what we decided... But if I make the query without "subject_type" I get this error: 'Missing required "subject_type" parameter'. Is it normal? The subject_type should be already defined in the policies. Isn't it?
Edit: same thing for the product version. Do I recall wrong?
One thing that is missing: you should check that in the input policies there aren't "RemoteRule"s because they don't apply. If there are you should return an error. Something similar is already done in RemoteRule itself, in the remote policies (gating.yaml) there cannot be RemoteRule(s), because it would trigger a loop. You could do something similar. Check this file: greenwave/policies.py, RemotePolicy class, validate method.
I'm getting a bit confused about what we decided... But if I make the query without "subject_type" I get this error: 'Missing required "subject_type" parameter'. Is it normal? The subject_type should be already defined in the policies. Isn't it? Edit: same thing for the product version. Do I recall wrong?
@gnaponie and I talked about this but we are still confused. @lucarval any thoughts?
We decided to take a slightly different path, closing this PR and will open a new one.
Pull-Request has been closed by yashn
Allows user to specify policies in the POST request.