jason810496 commented on code in PR #76963:
URL: https://github.com/apache/airflow/pull/76963#discussion_r4753926630
##########
airflow-core/src/airflow/models/revoked_token.py:
##########
@@ -60,6 +60,13 @@ def is_revoked(cls, jti: str, *, session: Session =
NEW_SESSION) -> bool:
cls._maybe_cleanup_expired(session)
return bool(session.scalar(select(exists().where(cls.jti == jti))))
+ @classmethod
+ async def is_revoked_async(cls, jti: str) -> bool:
Review Comment:
Thanks, done in
[`986d408`](https://github.com/apache/airflow/pull/76963/commits/986d408b58a1ff6ce4f120954144a7ab1579c6e2).
##########
airflow-core/src/airflow/models/revoked_token.py:
##########
@@ -54,11 +54,11 @@ def revoke(cls, jti: str, exp: datetime, *, session:
Session = NEW_SESSION) -> N
session.merge(cls(jti=jti, exp=exp))
@classmethod
- @provide_session
- def is_revoked(cls, jti: str, *, session: Session = NEW_SESSION) -> bool:
- """Check if a token JTI has been revoked."""
- cls._maybe_cleanup_expired(session)
- return bool(session.scalar(select(exists().where(cls.jti == jti))))
+ async def is_revoked_async(cls, jti: str) -> bool:
+ """Check token revocation using the async database engine."""
Review Comment:
Applied in
[`b71e883`](https://github.com/apache/airflow/pull/76963/commits/b71e883df2d6bc72b4eac6bac3846f8ee48d2b0a).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]