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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add service that generates Base(58) secure tokens #580

Merged
merged 4 commits into from
Dec 5, 2019

Conversation

Cruikshanks
Copy link
Member

In WEX and FRAE we have relied on using HasSecureToken to generate unique random tokens of a fixed length in the objects we create.

We have a need to unqiuely identify a record, but cannot use its ID because it also has to be something 'unguessable'.

HasSecureToken works for WEX and FRAE because it is designed to work with ActiveRecord models. WCR on the overhand uses MongoDb, which means we can't use it.

So instead, we've copied it wholesale into our project as a service we can call when we need to generate a token. Thanks @robertomiranda 馃榿!

In WEX and FRAE we have relied on using [HasSecureToken](https://github.com/robertomiranda/has_secure_token) to generate unique random tokens of a fixed length in the objects we create.

We have a need to unqiuely identify a record, but cannot use its ID because it also has to be something 'unguessable'.

HasSecureToken works for WEX and FRAE because it is designed to work with ActiveRecord models. WCR on the overhand uses MongoDb, which means we can't use it.

So instead, we've copied it wholesale into our project as a service we can call when we need to generate a token. Thanks @robertomiranda 馃榿!
@Cruikshanks Cruikshanks added the enhancement New feature or request label Dec 5, 2019
@Cruikshanks Cruikshanks self-assigned this Dec 5, 2019
cintamani
cintamani previously approved these changes Dec 5, 2019
Copy link
Contributor

@cintamani cintamani left a comment

Choose a reason for hiding this comment

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

Super-nits :D but good to go

Because whitespace slows @cintamini down!

Co-Authored-By: cintamani <cintamani.puddu@gmail.com>
Because white space slows @cintamani down!

Co-Authored-By: cintamani <cintamani.puddu@gmail.com>
@Cruikshanks Cruikshanks merged commit 0c280ef into master Dec 5, 2019
@Cruikshanks Cruikshanks deleted the add-secure-token-generator branch December 5, 2019 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants