INNER CODE UNIT · Python

_capture_skill_evolution_bearer_authority

TianGzlab/OmicsClaw · omicsclaw/surfaces/desktop/server.py:335

def _capture_skill_evolution_bearer_authority(
    app: FastAPI,
    environ: MutableMapping[str, str],
) -> _SkillEvolutionBearerAuthority:
    """Freeze the process-lifetime Skill Evolution authority at startup."""

    authority = _SkillEvolutionBearerAuthority.capture(environ)
    setattr(app.state, _SKILL_EVOLUTION_AUTH_STATE_ATTR, authority)
    if authority.source == "dedicated_environment":
        logger.warning(
            "%s is a manually managed development fallback; packaged Desktop "
            "launches must deliver this credential through the one-shot pipe",
            _SKILL_EVOLUTION_TOKEN_ENV,
        )
    return authority


def _skill_evolution_bearer_policy_for_scope(scope: Scope) -> BearerGatePolicy:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…