Skip to content

Support encode_opts in Plug.Crypto.sign and Plug.Crypto.encrypt#52

Open
SteffenDE wants to merge 2 commits into
elixir-plug:mainfrom
SteffenDE:sd-local-term-to-binary
Open

Support encode_opts in Plug.Crypto.sign and Plug.Crypto.encrypt#52
SteffenDE wants to merge 2 commits into
elixir-plug:mainfrom
SteffenDE:sd-local-term-to-binary

Conversation

@SteffenDE

Copy link
Copy Markdown

Allows passing options to :erlang.term_to_binary - for example :local.

Comment thread lib/plug/crypto.ex
If no value is provided, it will be set to the current time.
* `:max_age` - the default maximum age in **seconds** of the token. Defaults to
`86400` seconds (1 day) and it may be overridden on `decrypt/4`.
* `:encode_opts` - encoding options passed to `:erlang.term_to_binary/2`. Defaults to `[]`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if we should say that we support all options? Maybe we explicitly support :local?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And perhaps :compressed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants