Implement authorization import and revocation checks (T-503)

This commit is contained in:
ila
2026-07-20 09:07:30 +08:00
parent b4453130de
commit 76f6108496
36 changed files with 2197 additions and 68 deletions
+5
View File
@@ -47,6 +47,8 @@ type InstalledApp struct {
Entrypoint string `json:"entrypoint,omitempty"`
WorkingDirectory string `json:"working_directory,omitempty"`
MinOS string `json:"min_os,omitempty"`
ProductID string `json:"product_id,omitempty"`
SupportsTrial bool `json:"supports_trial"`
RequiresAdmin bool `json:"requires_admin"`
Files []InstalledFile `json:"files"`
}
@@ -332,6 +334,9 @@ func (record InstalledApp) validate() error {
record.MinOS != "windows-10" && record.MinOS != "windows-11" {
return fmt.Errorf("%w: min_os=%q", ErrInstalledAppInvalid, record.MinOS)
}
if record.ProductID != "" && !appIDPattern.MatchString(record.ProductID) {
return fmt.Errorf("%w: invalid product_id", ErrInstalledAppInvalid)
}
if record.Files == nil {
return fmt.Errorf("%w: files must be an array", ErrInstalledAppInvalid)
}