-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix(getToken): fix getToken() #212
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit Test: SUCCESS, e2e Test: FAILURE, Jenkins_job:http://192.168.99.101:30080/job/mlwb_build/1049/
The case of secret given and over 3.5 should be covered in the if block below checking if the first if was success or not. This was due to the change of GET vs POST that was changed with v3.5.
Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: billshitg ***@***.***>
Sent: Tuesday, February 13, 2024 5:42:20 PM
To: tigergraph/pyTigerGraph ***@***.***>
Cc: parkererickson-tg ***@***.***>; Author ***@***.***>
Subject: Re: [tigergraph/pyTigerGraph] fix(getToken): fix getToken() (PR #212)
@billshitg commented on this pull request.
________________________________
In pyTigerGraph/pyTigerGraphAuth.py<#212 (comment)>:
@@ -231,7 +231,7 @@ def getToken(self, secret: str = None, setToken: bool = True, lifetime: int = No
elif not(success) and not(secret):
res = self._post(self.restppUrl+"/requesttoken", authMode="pwd", data=str({"graph": self.graphname}), resKey="results")
success = True
- else:
+ elif not(success) and (int(s) < 3 or (int(s) == 3 and int(m) < 5)):
Seems like it is still missing the case when secret is given and the version is above 3.5. Do we use the secret to get token or use username/password?
—
Reply to this email directly, view it on GitHub<#212 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A36AN3WJ74ZABYVNJX3Y2ODYTP25ZAVCNFSM6AAAAABDHG44HGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNZZGEZTQMBQGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Is it this line: |
No, it is line 238-248: if not success:
try:
data = {"secret": secret}
if lifetime:
data["lifetime"] = str(lifetime)
res = json.loads(requests.post(self.restppUrl + "/requesttoken",
data=json.dumps(data), verify=False).text)
except Exception as e:
raise e (I don't know why it was implemented this way either) |
https://dev.tigergraph.com/forum/t/tigergraphexception-cannot-request-a-token-with-username-password-for-versions-3-5/3877/8