MCPcopy Create free account
hub / github.com/cloudwan/gohan / getMatchingPolicy

Function getMatchingPolicy

cli/template.go:324–332  ·  view source on GitHub ↗
(schemaUsed *schema.Schema, policies []*schema.Policy)

Source from the content-addressed store, hash-verified

322}
323
324func getMatchingPolicy(schemaUsed *schema.Schema, policies []*schema.Policy) []*schema.Policy {
325 var matchedPolicies []*schema.Policy
326 for _, policy := range policies {
327 if policy.GetResourcePathRegexp().MatchString(schemaUsed.URL) {
328 matchedPolicies = append(matchedPolicies, policy)
329 }
330 }
331 return matchedPolicies
332}
333
334func filterActions(schemaToFilter *schema.Schema, nobodyPolicies []*schema.Policy, policies []*schema.Policy) []schema.Action {
335 actions := make([]schema.Action, 0)

Callers 1

filterSchemasForPolicyFunction · 0.85

Calls 1

GetResourcePathRegexpMethod · 0.80

Tested by

no test coverage detected