latchset / custodia

An API to manage secrets storage and retrieval
GNU General Public License v3.0
85 stars 27 forks source link

Make key container creation idempotent #207

Closed raildo closed 7 years ago

raildo commented 7 years ago
Container creation returns a 409 Conflict if the container
already exists, but since the request doesn't take any
additional parameters, there's really no conflict.
Update the API return, if the container exists, to 200 OK.
Users could still distinguish whether the container
already existed by checking for 200 OK vs 201 Created.

Signed-off-by: Raildo Mascena <rmascena@redhat.com>
Closes: #206
simo5 commented 7 years ago

I do not get why lint failed ...

codecov-io commented 7 years ago

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
+ Coverage   69.33%   69.34%   +<.01%     
==========================================
  Files          31       31              
  Lines        3163     3164       +1     
  Branches      346      346              
==========================================
+ Hits         2193     2194       +1     
  Misses        852      852              
  Partials      118      118
Impacted Files Coverage Δ
src/custodia/client.py 79.6% <ø> (ø) :arrow_up:
src/custodia/secrets.py 66.66% <100%> (+0.1%) :arrow_up:
tests/test_secrets.py 98.88% <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 b150412...8c62935. Read the comment docs.

raildo commented 7 years ago

I fixed it in another PR, I push to this branch too, not it will works :)