Skip to content
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

Implement policy conditions on the API level #1738

Merged
merged 3 commits into from Jul 11, 2019

Conversation

@fredreichbier
Copy link
Member

commented Jul 9, 2019

This PR

  • adds a conditions parameter to the POST /policy/<name> endpoint which is used to specify policy conditions.
  • adds a special case for the GET /policy/defs/<scope> endpoint: Because the WebUI will need to know the available condition sections and comparators, GET /policy/defs/conditions now returns the condition sections and comparators, along with human-readable descriptions. I decided to implement this under the /policy/defs endpoint, because adding a new endpoint like GET /policy/conditions would break installations with a policy called conditions.

fredreichbier added some commits Jul 8, 2019

@fredreichbier fredreichbier requested a review from plettich Jul 9, 2019

@codecov

This comment has been minimized.

Copy link

commented Jul 9, 2019

Codecov Report

Merging #1738 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1738      +/-   ##
==========================================
+ Coverage   97.02%   97.03%   +<.01%     
==========================================
  Files         149      149              
  Lines       18040    18057      +17     
==========================================
+ Hits        17504    17521      +17     
  Misses        536      536
Impacted Files Coverage Δ
privacyidea/lib/utils/compare.py 100% <100%> (ø) ⬆️
privacyidea/lib/policy.py 99.29% <100%> (+0.01%) ⬆️
privacyidea/api/policy.py 99.3% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7fe9ae...7e82671. Read the comment docs.

@plettich
Copy link
Member

left a comment

Looks good, just a tiny remark.

Show resolved Hide resolved privacyidea/api/policy.py Outdated
Show resolved Hide resolved privacyidea/lib/policy.py Outdated
@plettich
Copy link
Member

left a comment

looks good

@plettich plettich merged commit a2174a0 into master Jul 11, 2019

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 97.02%)
Details
codecov/project 97.03% (+<.01%) compared to b7fe9ae
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@plettich plettich deleted the 1436/policy-conditions-api branch Jul 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.