-
Notifications
You must be signed in to change notification settings - Fork 63
Fix secret unpacking #2736
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
base: main
Are you sure you want to change the base?
Fix secret unpacking #2736
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2736 +/- ##
==========================================
- Coverage 79.19% 79.18% -0.02%
==========================================
Files 670 670
Lines 54253 54259 +6
Branches 734 734
==========================================
- Hits 42967 42964 -3
- Misses 11206 11215 +9
Partials 80 80
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| def setup(self, secrets): | ||
| for type, key, data, secret_store in secrets: | ||
| for type, key, data, *extra in secrets: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we also check that they array has at least 3 elements as well? If secrets is [1,2] it will raise ValueError: not enough values to unpack (expected at least 3, got 2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be an invalid config. Shouldn't we error in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do these secrets get set? As long as it is validated when it is set then there can only be 3 or 4 items. I'm just not sure where or if this validation is occuring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They come from the microservice config. I don't see checks earlier in the microservice initialization logic than here, so I'm adding a check here
b15ce91 to
3a6cf8a
Compare
If you only pass three values (like the example in our docs), Ruby unpacks
nilbut Python throwsValueError: not enough values to unpack (expected 4, got 3)