Skip to content

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.
@tekin tekin force-pushed the global-non-expiring-ids branch from 332ed94 to 433cae1 Compare July 31, 2020 07:05
@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