-
Notifications
You must be signed in to change notification settings - Fork 61
Add new pppc keys #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
a2c8a4c
Added changelog entry for ty's fix
watkyn 9a262a6
updated the changelog with author tags
watkyn b737070
adding in some unit tests to help with making changes to the structur…
watkyn 0725bd7
Added allowed and authorization as optionals so they can be left out …
watkyn c7791e7
Updated the change log
watkyn dde4022
added some tests for handling the authoriztion vs allowed legacy prop…
watkyn 11f0fbb
Added the new Authorization key as the default instead of Allowed
watkyn cd778ab
Added some more tests around importing a profile and making sure it h…
watkyn ca30501
Added constants for the key display values and some more tests around…
watkyn e3e2e99
Fixed the parsing issue when importing a profile with apple events an…
watkyn 3595c41
Added the new key to the drop down for screen capture and listen event.
watkyn 20ae824
Added some support for an info message if the user is trying to use t…
watkyn 4373629
Working through some changes. There are currently failing unit tests …
watkyn 832fef1
Fix application list layout
5f084fe
Revert "Fix application list layout"
c5847dc
Fix Applications table view cell height
c7bc881
Fixing some more UI issues and causing some others
watkyn dc66431
fixed up the unit tests
watkyn a551bc0
Fix table view cell height
9f3f146
Merge branch 'add-new-pppc-keys' of github.com:jamf/PPPC-Utility into…
43da4ec
Changed the width of the popup buttons to allow for the new value to …
watkyn 8420641
More UI tweaks and also added a cancel option for the alert when user…
watkyn 6268925
Added constrainsts for the big sur switch
watkyn 37041be
Got rid of as many interface builder warnings as I could. There is st…
watkyn e5af14c
Moved the import button to the same row as the Save and Upload buttons.
watkyn 18e1c6a
upgraded swiftlint and fixed the issue
watkyn 8561d1b
Fixed some wording and spelling issues.
watkyn 58f3331
Added spacing in the error message for better readablility
watkyn 28e1570
added note to changelog that 10.15 is the min deployment target now
watkyn cb9b65a
changed to use a setup() method for the ModelTests
watkyn 7a8ace4
Removed a comment and made the method name more descriptive.
watkyn fdb805c
Updated readme to reference 10.15 as the min version
watkyn c0ec9ab
changed the format of switch statments to be consistent
watkyn e2243d7
added guard in weak self pointer is actually nil
watkyn 5bd7c60
disabled hardened runtime for debug builds so that unit tests can be …
watkyn 05f2854
Added some internal jenkins related files.
watkyn aacfc9f
adding a sleep for troubleshooting
watkyn 11f23ef
Adding import to the shared fastlane lib using ENV
watkyn 14bb4d6
Trying to fix the build issues by taking of sign to run locally
watkyn 60cf2a3
removed Jenkins changes and moved them to another experimental branch
watkyn 0284f6f
changed back to use the hardented runtime for debug mode to try and f…
watkyn c2a4fae
Going back to setting the team explicitly.
watkyn 5cd46ce
Disabled the hardened runtime again so the unit tests locally can be …
watkyn bb50ba9
One more try at the build by turning off automatic code signing
watkyn 30982e7
Only changing back the main app not the unit tests to see if we can a…
watkyn 3ad7a83
giving up, just leaving the team assigned
watkyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.