This should address crashes we've seen, when no secret was set yet and the shovel plugin crashed starting dynamic shovels. (Why there was no secret could be because of independent circumstances)
Alternatively it would be possible to support all terms unchanged (as since PR 15encrypt_term is used under the hood). This would be a breaking change though.
Another alternative is to support unicode:chardata() instead of iodata() as input (but still always return binaries) which would more reflect the modern notion of a "string" - but probably more expensive to convert.
Types of Changes
What types of changes does your code introduce to this project?
Put an x in the boxes that apply
[x] Bug fix (non-breaking change which fixes issue #NNNN)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Documentation (correction or otherwise)
[ ] Cosmetics (whitespace, appearance)
Checklist
Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.
[x] I have added tests that prove my fix is effective or that my feature works
[x] I have added necessary documentation (if appropriate)
[ ] Any dependent changes have been merged and published in related repositories
Further Comments
If this is a relatively large or complex change, kick off the discussion by
explaining why you chose the solution you did and what alternatives you
considered, etc.
Proposed Changes
This way the type signature does not depend on the service state and is consistently:
decrypt(encrypt(Data)) -> binary()
.Some users like
rabbit_shovel_parameters
rely on this (https://github.com/rabbitmq/rabbitmq-server/blob/master/deps/rabbitmq_shovel/src/rabbit_shovel_parameters.erl#L447)This should address crashes we've seen, when no secret was set yet and the shovel plugin crashed starting dynamic shovels. (Why there was no secret could be because of independent circumstances)
Alternatively it would be possible to support all terms unchanged (as since PR 15
encrypt_term
is used under the hood). This would be a breaking change though.Another alternative is to support
unicode:chardata()
instead ofiodata()
as input (but still always return binaries) which would more reflect the modern notion of a "string" - but probably more expensive to convert.Types of Changes
What types of changes does your code introduce to this project? Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask on the mailing list. We're here to help! This is simply a reminder of what we are going to look for before merging your code.CONTRIBUTING.md
documentFurther Comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc.