-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added changelog entry for ty's fix * updated the changelog with author tags * adding in some unit tests to help with making changes to the structure in the future * Added allowed and authorization as optionals so they can be left out of the xml as needed. * Updated the change log * added some tests for handling the authoriztion vs allowed legacy property. * Added the new Authorization key as the default instead of Allowed * Added some more tests around importing a profile and making sure it handles the new key correctly * Added constants for the key display values and some more tests around importing and exporting * Fixed the parsing issue when importing a profile with apple events and added unit tests * Added the new key to the drop down for screen capture and listen event. * Added some support for an info message if the user is trying to use the new Authorization key, warning them it is only Big Sur and above * Working through some changes. There are currently failing unit tests and an incomplete UI implementation of the NSSwitch for big sur. * Fix application list layout * Revert "Fix application list layout" This reverts commit 832fef1. * Fix Applications table view cell height * Fixing some more UI issues and causing some others * fixed up the unit tests * Fix table view cell height * Changed the width of the popup buttons to allow for the new value to be seen clearly. * More UI tweaks and also added a cancel option for the alert when users are going away from big sur mode and might lose some data. * Added constrainsts for the big sur switch * Got rid of as many interface builder warnings as I could. There is still one annoying one not resolved about a fixed width, and also some content notices on the storyboard. * Moved the import button to the same row as the Save and Upload buttons. * upgraded swiftlint and fixed the issue * Fixed some wording and spelling issues. Updated version to 1.3.0 * Added spacing in the error message for better readablility * added note to changelog that 10.15 is the min deployment target now * changed to use a setup() method for the ModelTests * Removed a comment and made the method name more descriptive. * Updated readme to reference 10.15 as the min version * changed the format of switch statments to be consistent * added guard in weak self pointer is actually nil * disabled hardened runtime for debug builds so that unit tests can be run with "Sign to Run Locally" * Added some internal jenkins related files. * adding a sleep for troubleshooting * Adding import to the shared fastlane lib using ENV * Trying to fix the build issues by taking of sign to run locally * removed Jenkins changes and moved them to another experimental branch * changed back to use the hardented runtime for debug mode to try and fix the buld * Going back to setting the team explicitly. * Disabled the hardened runtime again so the unit tests locally can be run. * One more try at the build by turning off automatic code signing * Only changing back the main app not the unit tests to see if we can at least build. * giving up, just leaving the team assigned Co-authored-by: Tony Eichelberger <tony.eichelberger@jamf.com> Co-authored-by: Isaac Halvorson <isaac.halvorson@jamf.com>
- Loading branch information
1 parent
8b505c1
commit 9878cc2
Showing
15 changed files
with
1,079 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// ModelBuilder.swift | ||
// | ||
// MIT License | ||
// | ||
// Copyright (c) 2019 Jamf Software | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
// | ||
|
||
import Cocoa | ||
|
||
@testable import PPPC_Utility | ||
|
||
class ModelBuilder { | ||
|
||
var model: Model | ||
|
||
init() { | ||
model = Model() | ||
} | ||
|
||
func build() -> Model { | ||
return model | ||
} | ||
|
||
func addExecutable(settings: [String: String]) -> ModelBuilder { | ||
let exe = Executable(identifier: "id", codeRequirement: "req", "display") | ||
settings.forEach { key, value in | ||
exe.policy.setValue(value, forKey: key) | ||
} | ||
model.selectedExecutables.append(exe) | ||
|
||
return self | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// | ||
// TCCProfileBuilder.swift | ||
// | ||
// MIT License | ||
// | ||
// Copyright (c) 2019 Jamf Software | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
// | ||
|
||
import Cocoa | ||
|
||
@testable import PPPC_Utility | ||
|
||
class TCCProfileBuilder: NSObject { | ||
|
||
// MARK: - build testing objects | ||
|
||
func buildTCCPolicy(allowed: Bool?, authorization: TCCPolicyAuthorizationValue?) -> TCCPolicy { | ||
var policy = TCCPolicy(identifier: "policy id", codeRequirement: "policy code req", | ||
receiverIdentifier: "policy receiver id", receiverCodeRequirement: "policy receiver code req") | ||
policy.comment = "policy comment" | ||
policy.identifierType = "policy id type" | ||
policy.receiverIdentifierType = "policy receiver id type" | ||
policy.allowed = allowed | ||
policy.authorization = authorization | ||
return policy | ||
} | ||
|
||
func buildTCCPolicies(allowed: Bool?, authorization: TCCPolicyAuthorizationValue?) -> [String: [TCCPolicy]] { | ||
return ["SystemPolicyAllFiles": [buildTCCPolicy(allowed: allowed, authorization: authorization)], | ||
"AppleEvents": [buildTCCPolicy(allowed: allowed, authorization: authorization)]] | ||
} | ||
|
||
func buildTCCContent(_ contentIndex: Int, allowed: Bool?, authorization: TCCPolicyAuthorizationValue?) -> TCCProfile.Content { | ||
return TCCProfile.Content(payloadDescription: "Content Desc \(contentIndex)", | ||
displayName: "Content Name \(contentIndex)", | ||
identifier: "Content ID \(contentIndex)", | ||
organization: "Content Org \(contentIndex)", | ||
type: "Content type \(contentIndex)", | ||
uuid: "Content UUID \(contentIndex)", | ||
version: contentIndex, | ||
services: buildTCCPolicies(allowed: allowed, authorization: authorization)) | ||
} | ||
|
||
func buildProfile(allowed: Bool? = nil, authorization: TCCPolicyAuthorizationValue? = nil) -> TCCProfile { | ||
var profile = TCCProfile(organization: "Test Org", | ||
identifier: "Test ID", | ||
displayName: "Test Name", | ||
payloadDescription: "Test Desc", | ||
services: [:]) | ||
profile.content = [buildTCCContent(1, allowed: allowed, authorization: authorization)] | ||
profile.version = 100 | ||
profile.uuid = "the uuid" | ||
return profile | ||
} | ||
|
||
} |
Oops, something went wrong.