pierrejeambrun commented on code in PR #46981:
URL: https://github.com/apache/airflow/pull/46981#discussion_r1969477477
##########
airflow/auth/managers/base_auth_manager.py:
##########
@@ -102,21 +102,21 @@ def deserialize_user(self, token: dict[str, Any]) -> T:
"""Create a user object from dict."""
@abstractmethod
- def serialize_user(self, user: T) -> dict[str, Any]:
- """Create a dict from a user object."""
+ def serialize_user(self, user: T) -> tuple[str, dict[str, Any]]:
+ """Create a subject and extra claims dict from a user object."""
Review Comment:
Also the `self._get_token_signer().generate` could take a `BaseUser` and
generate a token for that user. (accessing `user.subject`)
##########
airflow/auth/managers/base_auth_manager.py:
##########
@@ -102,21 +102,21 @@ def deserialize_user(self, token: dict[str, Any]) -> T:
"""Create a user object from dict."""
@abstractmethod
- def serialize_user(self, user: T) -> dict[str, Any]:
- """Create a dict from a user object."""
+ def serialize_user(self, user: T) -> tuple[str, dict[str, Any]]:
+ """Create a subject and extra claims dict from a user object."""
Review Comment:
Also the `self._get_token_signer().generate` could take a `BaseUser` and
generate a token for that user. (accessing `user.subject` if necessary)
--
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]