MCPcopy Create free account
hub / github.com/astercloud/aster / GetPolicy

Method GetPolicy

pkg/security/policy.go:556–566  ·  view source on GitHub ↗

GetPolicy 获取策略

(policyID string)

Source from the content-addressed store, hash-verified

554
555// GetPolicy 获取策略
556func (bpe *BasicPolicyEngine) GetPolicy(policyID string) (*SecurityPolicy, error) {
557 bpe.mu.RLock()
558 defer bpe.mu.RUnlock()
559
560 policy, exists := bpe.policies[policyID]
561 if !exists {
562 return nil, fmt.Errorf("policy %s not found", policyID)
563 }
564
565 return policy, nil
566}
567
568// ListPolicies 列出策略
569func (bpe *BasicPolicyEngine) ListPolicies(filters map[string]any) ([]*SecurityPolicy, error) {

Calls

no outgoing calls