web/backend/secretapi/regulatory_profile.go
Joshua a3a53992bd
Some checks are pending
check / secretapi (push) Waiting to run
W0: add regulatory profile baseline to checkout and ID flows
2026-02-19 18:13:05 -08:00

31 lines
802 B
Go

package main
import "strings"
const (
regulatoryProfileUSGeneral2026 = "us_general_2026"
regulatoryProfileEUAIBaseline2026 = "eu_ai_act_2026_baseline"
defaultRegulatoryProfileID = regulatoryProfileUSGeneral2026
)
func normalizeRegulatoryProfileID(raw string) string {
value := strings.ToLower(strings.TrimSpace(raw))
switch value {
case "", "us", "us_general", regulatoryProfileUSGeneral2026:
return regulatoryProfileUSGeneral2026
case "eu", "eu_ai_act", regulatoryProfileEUAIBaseline2026:
return regulatoryProfileEUAIBaseline2026
default:
return value
}
}
func isKnownRegulatoryProfileID(value string) bool {
switch normalizeRegulatoryProfileID(value) {
case regulatoryProfileUSGeneral2026, regulatoryProfileEUAIBaseline2026:
return true
default:
return false
}
}