MCPcopy Create free account
hub / github.com/Mister-leo/fssh / newSecureAgentWithTTL

Function newSecureAgentWithTTL

internal/agent/secure_agent.go:26–45  ·  view source on GitHub ↗
(ttlSeconds int)

Source from the content-addressed store, hash-verified

24}
25
26func newSecureAgentWithTTL(ttlSeconds int) (*secureAgent, error) {
27 // 获取认证提供者
28 provider, err := auth.GetAuthProvider(ttlSeconds)
29 if err != nil {
30 return nil, err
31 }
32
33 agent := &secureAgent{
34 authProvider: provider,
35 }
36
37 // 加载密钥计数用于日志
38 metas, _ := agent.loadMetas()
39 log.Info("创建安全 agent", map[string]interface{}{
40 "auth_mode": provider.Mode(),
41 "key_count": len(metas),
42 })
43
44 return agent, nil
45}
46
47// loadMetas 动态加载所有加密私钥的元数据
48func (a *secureAgent) loadMetas() ([]store.EncryptedFile, error) {

Callers 1

StartWithOptionsFunction · 0.85

Calls 4

loadMetasMethod · 0.95
GetAuthProviderFunction · 0.92
InfoFunction · 0.92
ModeMethod · 0.65

Tested by

no test coverage detected