Closed vrs closed 7 months ago
You need https://github.com/googleapis/google-auth-library-python/commit/bfb1f8cc8a706ce5ca2a14886c920ca2220ec349 which isn't in Debian version of python3-google-auth
(Debian has 1.5.1 which is from 2018).
I just applied that patch (well, I just copy-pasted the function) locally which was enough to get it to work. But I keep having to re-authenticate every time I run gmi
, which might I wonder if it could be due to needing a newer version for some token refresh change or something.
OK, I figured out that the constant re-authentication happens because of the credentials.expired
check here: https://github.com/gauteh/lieer/blob/master/lieer/remote.py#L530
With the packages in debian, credentials.expired
is always False
when no expiry
time is set, which is always the case when loading the saved credentials from a file. I just removed that check and it seems to be better. It's not clear to me what that condition is supposed to protect against, maybe it really isn't needed at all?
Maybe it is something leftover. If you want please submit a pull request.
fre. 13. okt. 2023, 15:18 skrev Siim Põder @.***>:
OK, I figured out that the constant re-authentication happens because of the credentials.expired check here: https://github.com/gauteh/lieer/blob/master/lieer/remote.py#L530
With the packages in debian, credentials.expired is always False when no expiry time is set, which is always the case when loading the saved credentials from a file. I just removed that check and it seems to be better. It's not clear to me what that condition is supposed to protect against, maybe it really isn't needed at all?
— Reply to this email directly, view it on GitHub https://github.com/gauteh/lieer/issues/258#issuecomment-1761507101, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAN366ZOMC7MWVFXI4JMJLX7E5R3AVCNFSM6AAAAAA5QXUXHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRRGUYDOMJQGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I'm hesitant to remove the check in case it breaks newer versions of the lib. At least until someone confirms it works on newer versions as well. The debian lib is getting quite old.
In Debian, I solved this by installing lieer in a virtual environment rather than through the deb package. This solves the lib dependency issue.
OK, I figured out that the constant re-authentication happens because of the
credentials.expired
check here: https://github.com/gauteh/lieer/blob/master/lieer/remote.py#L530With the packages in debian,
credentials.expired
is alwaysFalse
when noexpiry
time is set, which is always the case when loading the saved credentials from a file. I just removed that check and it seems to be better. It's not clear to me what that condition is supposed to protect against, maybe it really isn't needed at all?
I suddenly went into the same issue here. Likewise, I commented out the whole check if not credentials or not credentials.valid:
and it works for me now.
Think this is fixed
Can confirm this is fixed for me.
Upon granting access, I get the following output:
After that, I have an empty
.credentials.gmailieer.json
file and further runs result in this:After deleting
.credentials.gmailieer.json
and rerunning, I get the first trace again.This seems less like a migration issue (#257) and more like it being broken. Are there any additional states I should reset?