elevate: add ParsePolicy helper

This commit is contained in:
Levi Neely 2026-07-27 11:03:18 +02:00
parent bd40dc9637
commit 116c7fa671
1 changed files with 5 additions and 0 deletions

View File

@ -65,6 +65,11 @@ func (p *Policy) Marshal() ([]byte, error) {
return yaml.Marshal(p)
}
// ParsePolicy parses YAML data into a Policy.
func ParsePolicy(data []byte, p *Policy) error {
return yaml.Unmarshal(data, p)
}
// PolicyStore manages a disk-backed global policy and in-memory session policies.
type PolicyStore struct {
mu sync.RWMutex