HomePhabricator
Diffusion Comm 6b2d0082d936

[Identity] Token constructor

Description

[Identity] Token constructor

Summary:
new function to generate a Token. we use the rand crate to generate a random string for the token, and chrono to get the creation time. I used len 512 for the string because that's what OAuth uses for access tokens.

@jimpo, is this the best way to generate a random String in Rust?

Depends on D3957

Test Plan: Called constructor and verified the contents of the Token

Reviewers: jimpo, karol-bisztyga, palys-swm

Reviewed By: jimpo, karol-bisztyga, palys-swm

Subscribers: ashoat, Adrian, yayabosh, jimpo, atul

Differential Revision: https://phabricator.ashoat.com/D3959

Details

Provenance
varunAuthored on May 6 2022, 11:51 AM
Reviewer
jim
Differential Revision
D3959: [Identity] Token constructor
Parents
rCOMM5f7b2a409629: [Identity] DatabaseClient method to get user token
Branches
Unknown
Tags
Unknown