Skip to content
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

seal() options is not guarded against mutation #70

Closed
kanongil opened this issue Oct 2, 2018 · 0 comments
Closed

seal() options is not guarded against mutation #70

kanongil opened this issue Oct 2, 2018 · 0 comments
Assignees
Labels
bug
Milestone

Comments

@kanongil
Copy link
Member

@kanongil kanongil commented Oct 2, 2018

If you want to change the ttl on each invocation, you can't re-use the same object since the value is not extracted from the options object until after an await.

Example:

const config = Object.assign({}, Iron.defaults);

config.ttl = 42;
const promise = Iron.seal(object, secret, config);
config.ttl = 4200;
const sealed = await promise;

The resulting object will be sealed with a ttl == 4200.

I suspect there are similar issues with unseal() as well.

@hueniverse hueniverse self-assigned this Oct 3, 2018
@hueniverse hueniverse added the bug label Oct 3, 2018
@hueniverse hueniverse added this to the 5.0.5 milestone Nov 1, 2018
@hueniverse hueniverse closed this in e227af2 Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.