diff --git a/server/mdm/maintainedapps/apps.json b/server/mdm/maintainedapps/apps.json index 159d18b05ca7..9af089cf1913 100644 --- a/server/mdm/maintainedapps/apps.json +++ b/server/mdm/maintainedapps/apps.json @@ -69,6 +69,11 @@ "bundle_identifier": "notion.id", "installer_format": "dmg:app" }, + { + "identifier": "postman", + "bundle_identifier": "com.postmanlabs.mac", + "installer_format": "zip:app" + }, { "identifier": "slack", "bundle_identifier": "com.tinyspeck.slackmacgap", diff --git a/server/mdm/maintainedapps/ingest.go b/server/mdm/maintainedapps/ingest.go index f829f33091da..e24e6d60db23 100644 --- a/server/mdm/maintainedapps/ingest.go +++ b/server/mdm/maintainedapps/ingest.go @@ -183,9 +183,13 @@ type brewArtifact struct { // Pkg is a bit like Binary, it is an array with a string and an object as // first two elements. The object has a choices field with an array of // objects. See Microsoft Edge. - Pkg []optjson.StringOr[*brewPkgChoices] `json:"pkg"` - Uninstall []*brewUninstall `json:"uninstall"` - Zap []*brewZap `json:"zap"` + Pkg []optjson.StringOr[*brewPkgChoices] `json:"pkg"` + // Zap and Uninstall have the same format, they support the same stanzas. + // It's just that in homebrew, Zaps are not processed by default (only when + // --zap is provided on uninstall). For our uninstall scripts, we want to + // process the zaps. + Uninstall []*brewUninstall `json:"uninstall"` + Zap []*brewUninstall `json:"zap"` // Binary is an array with a string and an object as first two elements. See // the "docker" and "firefox" casks. Binary []optjson.StringOr[*brewBinaryTarget] `json:"binary"` @@ -206,15 +210,15 @@ type brewUninstall struct { LaunchCtl optjson.StringOr[[]string] `json:"launchctl"` Quit optjson.StringOr[[]string] `json:"quit"` PkgUtil optjson.StringOr[[]string] `json:"pkgutil"` - Script optjson.StringOr[[]string] `json:"script"` - // format: [0]=signal, [1]=process name - Signal optjson.StringOr[[]string] `json:"signal"` - Delete optjson.StringOr[[]string] `json:"delete"` - RmDir optjson.StringOr[[]string] `json:"rmdir"` -} - -// same as brewUninstall, can be []string or string (see Microsoft Teams). -type brewZap struct { - Trash optjson.StringOr[[]string] `json:"trash"` - RmDir optjson.StringOr[[]string] `json:"rmdir"` + // brew docs says string or hash, but our only case has a single string. + Script optjson.StringOr[map[string]any] `json:"script"` + // format: [0]=signal, [1]=process name (although the brew documentation says + // it's an array of arrays, it's not like that in our single case that uses + // it). + Signal optjson.StringOr[[]string] `json:"signal"` + Delete optjson.StringOr[[]string] `json:"delete"` + RmDir optjson.StringOr[[]string] `json:"rmdir"` + Trash optjson.StringOr[[]string] `json:"trash"` + LoginItem optjson.StringOr[[]string] `json:"login_item"` + Kext optjson.StringOr[[]string] `json:"kext"` } diff --git a/server/mdm/maintainedapps/testdata/expected_apps.json b/server/mdm/maintainedapps/testdata/expected_apps.json index 1da9cc4584a0..66c39b96e212 100644 --- a/server/mdm/maintainedapps/testdata/expected_apps.json +++ b/server/mdm/maintainedapps/testdata/expected_apps.json @@ -69,6 +69,11 @@ "version": "3.14.0", "platform": "darwin" }, + { + "name": "Postman", + "version": "11.12.0", + "platform": "darwin" + }, { "name": "Slack", "version": "4.40.126", diff --git a/server/mdm/maintainedapps/testdata/postman.json b/server/mdm/maintainedapps/testdata/postman.json new file mode 100644 index 000000000000..e6ca9722ad81 --- /dev/null +++ b/server/mdm/maintainedapps/testdata/postman.json @@ -0,0 +1,117 @@ +{ + "token": "postman", + "full_token": "postman", + "old_tokens": [], + "tap": "homebrew/cask", + "name": [ + "Postman" + ], + "desc": "Collaboration platform for API development", + "homepage": "https://www.postman.com/", + "url": "https://dl.pstmn.io/download/version/11.12.0/osx_arm64", + "url_specs": { + "verified": "dl.pstmn.io/download/version/" + }, + "version": "11.12.0", + "installed": null, + "installed_time": null, + "bundle_version": null, + "bundle_short_version": null, + "outdated": false, + "sha256": "f08acef5bda961130ba19055ee371183f1505a96ea73a1ee0fd41755de9b05ff", + "artifacts": [ + { + "app": [ + "Postman.app" + ] + }, + { + "zap": [ + { + "trash": [ + "~/Library/Application Support/com.postmanlabs.mac.ShipIt", + "~/Library/Application Support/Postman", + "~/Library/Caches/com.postmanlabs.mac", + "~/Library/Caches/com.postmanlabs.mac.ShipIt", + "~/Library/Caches/Postman", + "~/Library/HTTPStorages/com.postmanlabs.mac", + "~/Library/Preferences/ByHost/com.postmanlabs.mac.ShipIt.*.plist", + "~/Library/Preferences/com.postmanlabs.mac.plist", + "~/Library/Saved Application State/com.postmanlabs.mac.savedState" + ] + } + ] + } + ], + "caveats": null, + "depends_on": { + "macos": { + ">=": [ + "10.13" + ] + } + }, + "conflicts_with": null, + "container": null, + "auto_updates": true, + "deprecated": false, + "deprecation_date": null, + "deprecation_reason": null, + "disabled": false, + "disable_date": null, + "disable_reason": null, + "tap_git_head": "5bd28fbb2da3cf0c3ef1009af5fa4f36c6e74cae", + "languages": [], + "ruby_source_path": "Casks/p/postman.rb", + "ruby_source_checksum": { + "sha256": "92056b4da6ed15435fb1a668ea1d640aa99aa0e80a8a479ae65750e767555fef" + }, + "variations": { + "sequoia": { + "url": "https://dl.pstmn.io/download/version/11.12.0/osx64", + "sha256": "b84fa38db9d345215ad7e5a07ff9651e293bacbd63bad531b827c8a0daece698" + }, + "sonoma": { + "url": "https://dl.pstmn.io/download/version/11.12.0/osx64", + "sha256": "b84fa38db9d345215ad7e5a07ff9651e293bacbd63bad531b827c8a0daece698" + }, + "ventura": { + "url": "https://dl.pstmn.io/download/version/11.12.0/osx64", + "sha256": "b84fa38db9d345215ad7e5a07ff9651e293bacbd63bad531b827c8a0daece698" + }, + "monterey": { + "url": "https://dl.pstmn.io/download/version/11.12.0/osx64", + "sha256": "b84fa38db9d345215ad7e5a07ff9651e293bacbd63bad531b827c8a0daece698" + }, + "big_sur": { + "url": "https://dl.pstmn.io/download/version/11.12.0/osx64", + "sha256": "b84fa38db9d345215ad7e5a07ff9651e293bacbd63bad531b827c8a0daece698" + }, + "catalina": { + "url": "https://dl.pstmn.io/download/version/11.12.0/osx64", + "sha256": "b84fa38db9d345215ad7e5a07ff9651e293bacbd63bad531b827c8a0daece698" + }, + "mojave": { + "url": "https://dl.pstmn.io/download/version/11.12.0/osx64", + "sha256": "b84fa38db9d345215ad7e5a07ff9651e293bacbd63bad531b827c8a0daece698" + }, + "high_sierra": { + "url": "https://dl.pstmn.io/download/version/11.12.0/osx64", + "sha256": "b84fa38db9d345215ad7e5a07ff9651e293bacbd63bad531b827c8a0daece698" + } + }, + "analytics": { + "install": { + "30d": { + "postman": 12107 + }, + "90d": { + "postman": 33679 + }, + "365d": { + "postman": 131069 + } + } + }, + "generated_date": "2024-09-11" +}