INNER CODE UNIT · Python
_skill_evolution_bearer_policy_for_scope
TianGzlab/OmicsClaw · omicsclaw/surfaces/desktop/server.py:352
def _skill_evolution_bearer_policy_for_scope(scope: Scope) -> BearerGatePolicy:
"""Resolve the frozen governance authority for the pre-routing ASGI gate."""
app = scope.get("app")
state = getattr(app, "state", None)
authority = getattr(state, _SKILL_EVOLUTION_AUTH_STATE_ATTR, None)
token = (
authority.token if isinstance(authority, _SkillEvolutionBearerAuthority) else ""
)
return BearerGatePolicy(
token=token,
realm="omicsclaw-skill-evolution",
unconfigured_detail="skill evolution bearer token is not configured",
)
def _get_core():
"""Return the omicsclaw.runtime.agent.state module, raising if not initialised."""