feat(sdk): 模式叠加——在线优先、文件 license 兜底
sdk-ci / test (push) Successful in 2m24s
sdk-release / release (push) Failing after 41s
sdk-release / cleanup (push) Successful in 4s

- 文件/字节 license 与远程/代理模式可叠加:在线激活/认证失败时保留文件基线
- 无 activation_token 时心跳自动重新激活;代理模式心跳自动 attest
- 在线/内存模式增加 tick 循环推进过期/宽限/强制校验
- 新增回退/重试/内存 license 过期测试
This commit is contained in:
iceking2nd committed 2026-11-14 21:23:55 +08:00
1 parent a6de41a0d9
commit c320f7c91f
3 files changed
+189 -20

No files matched your search

+11
View File
@@ -171,6 +171,14 @@ func (c *Client) renewProxy(ctx context.Context) error {
func (c *Client) heartbeatOnce(ctx context.Context) error {
const logField = "pkg.sdk.Client.heartbeatOnce"
if c.opts.proxyAddr != "" {
c.mu.Lock()
token := c.actToken
c.mu.Unlock()
if token == "" {
if err := c.attestProxy(ctx); err != nil {
return err
}
}
return c.renewProxy(ctx)
}
c.mu.Lock()
@@ -178,6 +186,9 @@ func (c *Client) heartbeatOnce(ctx context.Context) error {
grace := c.gracePeriod
c.mu.Unlock()
if token == "" {
if key := c.activationKey(); key != "" {
return c.Activate(ctx, key)
}
return errors.New("sdk: 未激活(无 activation_token)")
}