Fix policy decode#109
Conversation
WalkthroughThe base64 decoding method in the Changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (1.64.8)level=warning msg="[runner] Can't run linter goanalysis_metalinter: buildir: failed to load package session: could not load export data: no export data for "github.com/vultisig/go-wrappers/go-dkls/sessions"" 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learningsplugin/payroll/policy.go (2)🔇 Additional comments (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Base64 decoding mechanism for policy recipes to use the standard encoding instead of the raw, unpadded variant.
- Switched from
base64.RawStdEncodingtobase64.StdEncodingfor decoding policy recipes. - Ensures incoming recipes must be padded per standard Base64.
Comments suppressed due to low confidence (1)
plugin/payroll/policy.go:156
- Add a comment explaining why standard Base64 (with padding) is now required, so future maintainers understand the change and its implications.
policyBytes, err := base64.StdEncoding.DecodeString(policyDoc.Recipe)
Follow the same patter in:
https://github.com/vultisig/verifier/blob/0d7a07d1969c01f043ed699bc2137b9696b4f72a/types/policy.go#L60
Summary by CodeRabbit