-
Notifications
You must be signed in to change notification settings - Fork 49
feat: decode_session_id - to solve #395 #409
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
Conversation
|
Is Marked as duplicate because this is now mentioned in the comment below |
|
@TheCommCraft
Also, since merging this PR will cause niche incompatibility issues, this probably calls for a change in the Semantic Version number. |
|
If it's an incompatible change, it should be a major version change. https://tom.preston-werner.com/2022/05/23/major-version-numbers-are-not-sacred.html Although, if we decide to make incompatible changes, we should probably fix some important problems directly with it. |
|
properties should definitely be used |
|
maybe the xtoken could be used to check against |
|
i checked and |
Signed-off-by: faretek <107722825+FAReTek1@users.noreply.github.com>
|
it still appears to work, so should this be merged? |
|
Do you know why there is a _username attribute? |
|
apparently it is for backwards compatibility |
|
But it is a protected attribute? We could make it a property |
Decode session_id to reduce request count (solves #395)
Upon logging in, scratchattach fetches the xtoken separately from the session id, although the session id, when decoded, actually contains the xtoken and some other useful information.
This PR implements
utils.commons.b62_decode- this decodes the base 62 timestamp (part 2 of the session id) into a unix timestampsite.session.decode_session_id- this decodes the session id into a dictionary containing various pieces of data (part 1 of the session id), and a datetime object generated from the base62 encoded timestampsite.session.Session._process_session_id- this sets attributes of the Session object using data which is collected from the session id. Note the use of the word process, which implies that no web requests are made. This method is automatically called upon__init__if a session id is providednote: the ip is not collected from the session id. This is because this information is much more likely to be harmful than be helpful. Do tell if you want this changed
todo: