@property
def valid(self):
"""Checks the validity of the credentials.
This is True if the credentials have a :attr:`token` and the token
is not :attr:`expired`.
.. deprecated:: v2.24.0
Prefer checking :attr:`token_state` instead.
"""
return self.token is not None and not self.expired
In the google.auth package, it is now recommended to use
.token_state
over.valid
for checking validity of credentials.Token state gives more information such as if token is stale, expired, invalid etc.
.valid
is now marked as deprecated (code):Closes #286
Should also unblock #245