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

Allow expires_in to be configured to nil globally #128

Merged
merged 1 commit into from
Sep 12, 2020

Conversation

tekin
Copy link
Contributor

@tekin tekin commented Jul 27, 2020

This makes it possible to turn off expiration globally.

Closes #127.

Copy link
Member

@jeremy jeremy left a comment

Choose a reason for hiding this comment

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

Nice. Thanks @tekin!

GlobalID.app = app.config.global_id.app ||= default_app_name
SignedGlobalID.expires_in = app.config.global_id.expires_in ||= default_expires_in
SignedGlobalID.expires_in = app.config.global_id.expires_in
Copy link
Member

Choose a reason for hiding this comment

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

May be nice to stop mutating the app config as well

Suggested change
SignedGlobalID.expires_in = app.config.global_id.expires_in
SignedGlobalID.expires_in = app.config.global_id.fetch(:expires_in, default_expires_in)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, much neater!

This makes it possible to turn off expiration globally.

Closes rails#127.
@kaspth kaspth merged commit 6cdb13f into rails:master Sep 12, 2020
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.

Cannot globally default to non-expiring ids by setting config.global_id.expires_in to nil
3 participants