zalando-stups / play-zhewbacca

Play! framework library to protect REST endpoint by OAuth2 token verification - THIS PROJECT IS NOT LONGER ACTIVELY MAINTAINED
MIT License
22 stars 13 forks source link

Adjust response codes #54

Closed MikhailLitvin closed 6 years ago

MikhailLitvin commented 6 years ago

Resolves #53

introduce new auth result: AuthTokenInsufficient changed response codes for cases: 1) in case auth failure return 401 instead of 403 2) in case empty token or invalid token return 401 instead of 403 3) return 403 only in case there is token but without proper scopes

fix deny and denyAll rules: 1) return 401 for deny rule in case empty token | invalid token 2) return 403 in case token is validated

codecov-io commented 6 years ago

Codecov Report

Merging #54 into master will decrease coverage by 0.1%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #54      +/-   ##
==========================================
- Coverage   96.77%   96.66%   -0.11%     
==========================================
  Files          12       12              
  Lines         124      120       -4     
  Branches        6        8       +2     
==========================================
- Hits          120      116       -4     
  Misses          4        4
Impacted Files Coverage Δ
...n/scala/org/zalando/zhewbacca/SecurityFilter.scala 100% <ø> (ø) :arrow_up:
...ain/scala/org/zalando/zhewbacca/SecurityRule.scala 100% <ø> (ø) :arrow_up:
...scala/org/zalando/zhewbacca/RequestValidator.scala 100% <ø> (ø) :arrow_up:
...rg/zalando/zhewbacca/SecurityRulesRepository.scala 100% <100%> (ø) :arrow_up:
...ala/org/zalando/zhewbacca/OAuth2AuthProvider.scala 100% <100%> (ø) :arrow_up:

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 1f638a9...b2bd774. Read the comment docs.

dmitrykrivaltsevich commented 6 years ago

👍

dmitrykrivaltsevich commented 6 years ago

@MikhailLitvin and @slavaschmidt , thank you for the contribution!