anishgirianish commented on code in PR #60108:
URL: https://github.com/apache/airflow/pull/60108#discussion_r2961453328
##########
airflow-core/src/airflow/api_fastapi/auth/tokens.py:
##########
@@ -447,15 +447,33 @@ def signing_arg(self) -> AllowedPrivateKeys | str:
assert self._secret_key
return self._secret_key
- def generate(self, extras: dict[str, Any] | None = None, headers:
dict[str, Any] | None = None) -> str:
+ def generate_workload_token(self, sub: str) -> str:
+ """Generate a long-lived workload token for executor queues."""
+ from airflow.configuration import conf
+
+ workload_valid_for = conf.getint(
+ "execution_api", "jwt_workload_token_expiration_time",
fallback=86400
+ )
+ return self.generate(
+ extras={"sub": sub, "scope": "workload"},
+ valid_for=workload_valid_for,
+ )
Review Comment:
This went through serveral of iteration, and the implementation has evolved
along the way, so description was outdated, but now I have updated it
--
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]