guillaumeblaquiere / berglas-python

Python library for decypting Berglas secrets
Apache License 2.0
10 stars 7 forks source link

Fix bug with berglas bucket path determination #4

Closed dancmeyers closed 4 years ago

dancmeyers commented 4 years ago

Splitting a string takes an arg which is the number of times to split, not the resulting number of elements expected. So string.split("/", 2) fails when the object is in a sub-prefix of the bucket (resultant split is ["bucket", "first_prefix", "other/prefixes"]). It only works if the object is directly in the bucket root.

string.split("/", 1) does what we want and gives ["bucket", "first_prefix/other/prefixes"]