Implement authorization import and revocation checks (T-503)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user