| 478 | return runner |
| 479 | |
| 480 | def _create_auth_token(self, context, action_db, liveaction_db): |
| 481 | if not context: |
| 482 | return None |
| 483 | |
| 484 | user = context.get("user", None) |
| 485 | if not user: |
| 486 | return None |
| 487 | |
| 488 | metadata = { |
| 489 | "service": "actions_container", |
| 490 | "action_name": action_db.name, |
| 491 | "live_action_id": str(liveaction_db.id), |
| 492 | } |
| 493 | |
| 494 | ttl = cfg.CONF.auth.service_token_ttl |
| 495 | token_db = access.create_token( |
| 496 | username=user, ttl=ttl, metadata=metadata, service=True |
| 497 | ) |
| 498 | return token_db |
| 499 | |
| 500 | def _delete_auth_token(self, auth_token): |
| 501 | if auth_token: |