Ship uds-skill-auth as a distributable skill for field UDS credential helpers.

Business skills depend on this sibling skill instead of the plugin source tree; update the auth standard docs accordingly.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-08 23:35:28 +08:00
parent 64761c8300
commit 3595f49c86
6 changed files with 286 additions and 29 deletions

View file

@ -1,4 +1,7 @@
# uds-auth skill helpers
#
# Python: add this directory to PYTHONPATH or sys.path, then:
# from uds_skill_auth import resolve, request, UdsAuthError
# Deprecated path
认证公共库已改为 **skill 分发**:请安装并使用仓库内的
`skills/uds-skill-auth/`
本目录仅作兼容备份;新 skill 不要依赖此路径。

View file

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
"""
Official uds-auth skill helpers (Python).
uds-skill-auth — Python helpers for UDS-backed skills.
Resolve current-user SSO credentials via loopback Host APIs, or call intranet
APIs through the outbound proxy (token never needed in skill code for outbound).
Resolve SSO credentials via loopback Host APIs, or call intranet APIs through
the outbound proxy.
Environment:
DSH_SESSION_ID — agent session id (injected by DSH shell-env)
@ -35,7 +35,6 @@ def _base_url() -> str:
web = (os.environ.get("DSH_WEB_URL") or "").strip().rstrip("/")
if web:
return web + "/uds-auth"
# Common local defaults — try DSH_WEB_URL first in production.
return "http://127.0.0.1:8787/uds-auth"
@ -71,7 +70,6 @@ def _http_json(
req = urllib.request.Request(url, data=data, headers=hdrs, method=method.upper())
ctx = ssl._create_unverified_context()
try:
# Prefer no-proxy opener for loopback Host
if "127.0.0.1" in url or "localhost" in url.lower():
opener = _opener_no_proxy()
with opener.open(req, timeout=timeout) as resp: