-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Role based user session #39
Comments
We support extracting a SessionId from the |
I've seen SessionId , but I couldn't figure out how to advance your use case here. I could not understand whether you will use a different method according to the access_key value in the user model or with the password. Also, like, are you going to create a rule according to the role structure in the user model. I am impatiently waiting for your update. |
The // 1. Generates an `AccessKeyId`.
let key = AccessKeyId::new();
// 2. Generates a `SessionId`.
let session_id = SessionId::new::<Sha256>("your.app.com", key);
// 3. Records a map of the `SessionId` and `AccessKeyId` using a cache system.
let mut map = HashMap::new();
map.insert(session_id, key);
// 4. Extracts a `SessionId` from the request.
let session_id = req.parse_session_id().unwrap();
// 5. Gets the corresponding `AccessKey` from the cache system.
let key = map.get(session_id).unwrap();
// 6. Validates the `SessionId`.
let is_valid = session_id.validate_with::<Sha256>("your.app.com", key); If the The |
Hi,
Will you set an example for a role-based user session? With the cache system. Do we need to develop the project ourselves?
Good work and good luck.
The text was updated successfully, but these errors were encountered: