MCPcopy Create free account
hub / github.com/bytebase/bytebase / matchSubjectPattern

Function matchSubjectPattern

backend/plugin/idp/wif/wif.go:91–101  ·  view source on GitHub ↗
(subject, pattern string)

Source from the content-addressed store, hash-verified

89}
90
91func matchSubjectPattern(subject, pattern string) bool {
92 // Simple pattern matching - exact match or wildcard suffix
93 if pattern == "" {
94 return true
95 }
96 if strings.HasSuffix(pattern, "*") {
97 prefix := strings.TrimSuffix(pattern, "*")
98 return strings.HasPrefix(subject, prefix)
99 }
100 return subject == pattern
101}

Callers 2

ValidateTokenFunction · 0.85
TestMatchSubjectPatternFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestMatchSubjectPatternFunction · 0.68