refactor: reorganize security policy into dedicated packag (#5088)

This commit is contained in:
fatedier
2025-12-05 16:26:09 +08:00
committed by GitHub
parent 2e2802ea13
commit 0fe8f7a0b6
8 changed files with 136 additions and 71 deletions

View File

@@ -248,23 +248,3 @@ type AuthOIDCClientConfig struct {
type VirtualNetConfig struct {
Address string `json:"address,omitempty"`
}
const (
UnsafeFeatureTokenSourceExec = "TokenSourceExec"
)
type UnsafeFeatures struct {
features map[string]bool
}
func NewUnsafeFeatures(allowed []string) UnsafeFeatures {
features := make(map[string]bool)
for _, f := range allowed {
features[f] = true
}
return UnsafeFeatures{features: features}
}
func (u UnsafeFeatures) IsEnabled(feature string) bool {
return u.features[feature]
}