You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
背景
在
origin/feature/integrate中,定时任务触发 service invocation 的 token / credential 处理已经从历史上的 header/payload 透传,演进为 typed auth 模型,但当前仍存在多种并行路径。后续需要统一治理,避免 recurring schedule 中 token 过期、raw secret 持久化、入口能力不一致等问题。当前主要方式
1. SenderNyxId:保存 subject + scope,每次 fire 重新签发短 token
ScheduledServiceInvocationAuth(SenderNyxId: ...)serviceInvocation.auth.senderNyxIdIssueShortLivedAsync按 subject/scope 重新换 token。ChatRequestEvent.LlmControl.SenderNyxIdAccessToken。ConnectorHttpAuthorization = Bearer ...。问题:
ScopeOwnerNyxId一样做 binding/scope 预检,错误会延迟到 fire/run-now。2. DurableSenderBearerToken:把 bearer token 直接保存到 schedule
ScheduledServiceInvocationAuth(DurableSenderBearerToken: ...)serviceInvocation.auth.durableSenderBearerToken问题:
3. ScopeOwnerNyxId:以当前 authenticated owner subject 重新签发 token
ScheduledServiceInvocationAuth(ScopeOwnerNyxId: ...)serviceInvocation.auth.scopeOwnerNyxIdLlmControl.NyxIdAccessToken/NyxIdOrgToken,workflow 时也投影到ConnectorHttpAuthorization。问题:
IssueScopeOwnerNyxIdAsync(source, serviceIdentity, ...)当前实现基本只用 owner subject + scope,serviceIdentity没形成真实授权约束。4. 无 auth
ScheduledServiceInvocationAuth?可为空,dispatch 会继续执行。问题:
5. legacy header / metadata 路径
ChatRequestEvent.Metadata。connector.http.authorization被精确字符串跳过,避免 legacy authorization header 继续注入。问题:
需要讨论的统一方向
A. 明确 schedule credential 的权威模型
建议统一为“credential source / reference”,而不是保存可直接使用的 raw token:
SenderNyxIdCredentialSource(subject, scope)ScopeOwnerCredentialSource(ownerSubject, scope, serviceBinding?)DurableCredentialReference(id/handle),由安全 credential store 或 NyxID 管理,而不是 actor state 保存 raw bearer token待讨论:是否保留
DurableSenderBearerToken,如果保留,是否只允许内部 trusted provisioning 使用,不开放给通用 HTTP API。B. 创建/更新阶段只做无副作用 validation
目标:
C. 入口能力统一
需要对齐:
/api/schedulesHTTP entryIScheduledDispatchApplicationService目标:同一种 schedule auth policy 在所有入口含义一致,避免 Studio 有保护但通用 API 没有保护。
D. 消除 token 注入双轨
当前 token 最终可能进入:
LlmControl.NyxIdAccessTokenLlmControl.NyxIdOrgTokenLlmControl.SenderNyxIdAccessTokenConnectorHttpAuthorization需要决定:
WorkflowCallerCredential/control context 表达;ConnectorHttpAuthorization是否只是边界 adapter 兼容字段,是否能下沉到 workflow adapter 内部生成;NyxIdAccessToken与NyxIdOrgToken同写是否仍有必要。E. policy 化 required credential
不同 target/implementation 对 credential 的要求应显式表达:
避免 auth 为空时运行到下游才失败。
候选落地步骤
SenderNyxId补齐 binding/scope validation。ConnectorHttpAuthorization是否仅为 adapter 边界产物。参考代码位置
src/platform/Aevatar.GAgentService.Hosting/Endpoints/Schedules/ScheduledDispatchEndpoints.cssrc/platform/Aevatar.GAgentService.Infrastructure/Schedules/ScheduledServiceInvocationDispatchPort.cssrc/platform/Aevatar.GAgentService.Infrastructure/Schedules/NyxIdScheduledServiceInvocationCredentialExchangePort.cssrc/platform/Aevatar.GAgentService.Core/Schedules/ScheduledDispatchGAgent.cssrc/Aevatar.Studio.Application/Studio/Services/StudioWorkflowProvisioningService.cssrc/workflow/Aevatar.Workflow.Application/Schedules/WorkflowScheduleConfigurationMapper.csAll reactions