Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 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 Oct 1, 2020
9a262a6
updated the changelog with author tags
watkyn Oct 1, 2020
b737070
adding in some unit tests to help with making changes to the structur…
watkyn Oct 1, 2020
0725bd7
Added allowed and authorization as optionals so they can be left out …
watkyn Oct 2, 2020
c7791e7
Updated the change log
watkyn Oct 2, 2020
dde4022
added some tests for handling the authoriztion vs allowed legacy prop…
watkyn Oct 5, 2020
11f0fbb
Added the new Authorization key as the default instead of Allowed
watkyn Oct 6, 2020
cd778ab
Added some more tests around importing a profile and making sure it h…
watkyn Oct 6, 2020
ca30501
Added constants for the key display values and some more tests around…
watkyn Oct 7, 2020
e3e2e99
Fixed the parsing issue when importing a profile with apple events an…
watkyn Oct 7, 2020
3595c41
Added the new key to the drop down for screen capture and listen event.
watkyn Oct 7, 2020
20ae824
Added some support for an info message if the user is trying to use t…
watkyn Oct 7, 2020
4373629
Working through some changes. There are currently failing unit tests …
watkyn Oct 12, 2020
832fef1
Fix application list layout
Oct 13, 2020
5f084fe
Revert "Fix application list layout"
Oct 13, 2020
c5847dc
Fix Applications table view cell height
Oct 13, 2020
c7bc881
Fixing some more UI issues and causing some others
watkyn Oct 13, 2020
dc66431
fixed up the unit tests
watkyn Oct 13, 2020
a551bc0
Fix table view cell height
Oct 13, 2020
9f3f146
Merge branch 'add-new-pppc-keys' of github.com:jamf/PPPC-Utility into…
Oct 13, 2020
43da4ec
Changed the width of the popup buttons to allow for the new value to …
watkyn Oct 14, 2020
8420641
More UI tweaks and also added a cancel option for the alert when user…
watkyn Oct 14, 2020
6268925
Added constrainsts for the big sur switch
watkyn Oct 14, 2020
37041be
Got rid of as many interface builder warnings as I could. There is st…
watkyn Oct 14, 2020
e5af14c
Moved the import button to the same row as the Save and Upload buttons.
watkyn Oct 14, 2020
18e1c6a
upgraded swiftlint and fixed the issue
watkyn Oct 14, 2020
8561d1b
Fixed some wording and spelling issues.
watkyn Oct 14, 2020
58f3331
Added spacing in the error message for better readablility
watkyn Oct 14, 2020
28e1570
added note to changelog that 10.15 is the min deployment target now
watkyn Oct 14, 2020
cb9b65a
changed to use a setup() method for the ModelTests
watkyn Oct 14, 2020
7a8ace4
Removed a comment and made the method name more descriptive.
watkyn Oct 15, 2020
fdb805c
Updated readme to reference 10.15 as the min version
watkyn Oct 15, 2020
c0ec9ab
changed the format of switch statments to be consistent
watkyn Oct 15, 2020
e2243d7
added guard in weak self pointer is actually nil
watkyn Oct 15, 2020
5bd7c60
disabled hardened runtime for debug builds so that unit tests can be …
watkyn Oct 15, 2020
05f2854
Added some internal jenkins related files.
watkyn Oct 20, 2020
aacfc9f
adding a sleep for troubleshooting
watkyn Oct 20, 2020
11f23ef
Adding import to the shared fastlane lib using ENV
watkyn Oct 20, 2020
14bb4d6
Trying to fix the build issues by taking of sign to run locally
watkyn Oct 20, 2020
60cf2a3
removed Jenkins changes and moved them to another experimental branch
watkyn Oct 20, 2020
0284f6f
changed back to use the hardented runtime for debug mode to try and f…
watkyn Oct 20, 2020
c2a4fae
Going back to setting the team explicitly.
watkyn Oct 20, 2020
5cd46ce
Disabled the hardened runtime again so the unit tests locally can be …
watkyn Oct 20, 2020
bb50ba9
One more try at the build by turning off automatic code signing
watkyn Oct 20, 2020
30982e7
Only changing back the main app not the unit tests to see if we can a…
watkyn Oct 20, 2020
3ad7a83
giving up, just leaving the team assigned
watkyn Oct 20, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Added

- Added this changelog file
- (@hisaac) Added this changelog file
- (@ty-wilson) Fixed issue #72 changing the default value on Apple Events to "Allow"
- (@watkyn) Added support for the new Authorization key in Big Sur

## [1.2.1] - 2020-09-17

Expand Down
48 changes: 35 additions & 13 deletions PPPC Utility.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/* Begin PBXBuildFile section */
345B01D623FDBF55008838B6 /* TCCProfileExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345B01D523FDBF55008838B6 /* TCCProfileExtensions.swift */; };
345B01D723FDBF55008838B6 /* TCCProfileExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345B01D523FDBF55008838B6 /* TCCProfileExtensions.swift */; };
34DED4D323FDC77E00C53FB9 /* TCCProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EC409F4214D95D200BE4F17 /* TCCProfile.swift */; };
34DED4D423FDCAFD00C53FB9 /* SwiftyCMSDecoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F95AE1523158F03002E0A22 /* SwiftyCMSDecoder.swift */; };
34DED4D623FDDB2B00C53FB9 /* TCCProfileConfigurationPanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DED4D523FDDB2B00C53FB9 /* TCCProfileConfigurationPanel.swift */; };
5901A2772534DF1400A1CD2F /* ModelBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5901A2762534DF1400A1CD2F /* ModelBuilder.swift */; };
59206D6925265F0C00B94795 /* TCCProfileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59206D6825265F0C00B94795 /* TCCProfileTests.swift */; };
59798B82252D16310070A204 /* TCCProfileBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59798B81252D16310070A204 /* TCCProfileBuilder.swift */; };
5F90EBDD2319934F00738D09 /* ArrayExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F90EBDC2319934F00738D09 /* ArrayExtensions.swift */; };
5F90EBDF2319970000738D09 /* TCCProfileImportError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F90EBDE2319970000738D09 /* TCCProfileImportError.swift */; };
5F90EBE12319970500738D09 /* TCCProfileImporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F90EBE02319970500738D09 /* TCCProfileImporter.swift */; };
Expand Down Expand Up @@ -56,6 +57,9 @@
/* Begin PBXFileReference section */
345B01D523FDBF55008838B6 /* TCCProfileExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TCCProfileExtensions.swift; sourceTree = "<group>"; };
34DED4D523FDDB2B00C53FB9 /* TCCProfileConfigurationPanel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TCCProfileConfigurationPanel.swift; sourceTree = "<group>"; };
5901A2762534DF1400A1CD2F /* ModelBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelBuilder.swift; sourceTree = "<group>"; };
59206D6825265F0C00B94795 /* TCCProfileTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TCCProfileTests.swift; sourceTree = "<group>"; };
59798B81252D16310070A204 /* TCCProfileBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TCCProfileBuilder.swift; sourceTree = "<group>"; };
5F90EBDC2319934F00738D09 /* ArrayExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayExtensions.swift; sourceTree = "<group>"; };
5F90EBDE2319970000738D09 /* TCCProfileImportError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TCCProfileImportError.swift; sourceTree = "<group>"; };
5F90EBE02319970500738D09 /* TCCProfileImporter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TCCProfileImporter.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -112,6 +116,15 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
5901A2752534DEFF00A1CD2F /* Helpers */ = {
isa = PBXGroup;
children = (
59798B81252D16310070A204 /* TCCProfileBuilder.swift */,
5901A2762534DF1400A1CD2F /* ModelBuilder.swift */,
);
path = Helpers;
sourceTree = "<group>";
};
5F90EBDB2319931100738D09 /* Extensions */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -151,6 +164,7 @@
5F95AE1C2315A6AD002E0A22 /* PPPC UtilityTests */ = {
isa = PBXGroup;
children = (
5901A2752534DEFF00A1CD2F /* Helpers */,
5F90EBE22319991600738D09 /* ModelTests */,
5F95AE272315B069002E0A22 /* TCCProfileImporter */,
5F95AE1F2315A6AD002E0A22 /* Info.plist */,
Expand All @@ -166,13 +180,15 @@
5F95AE2C2315B172002E0A22 /* TestTCCUnsignedProfile-Empty.mobileconfig */,
5F95AE292315B172002E0A22 /* TestTCCUnsignedProfile.mobileconfig */,
5F95AE252315A7CB002E0A22 /* TCCProfileImporterTests.swift */,
59206D6825265F0C00B94795 /* TCCProfileTests.swift */,
);
path = TCCProfileImporter;
sourceTree = "<group>";
};
6E651CC623143969001CC974 /* Views */ = {
isa = PBXGroup;
children = (
B5E09547250BCCFC00A40409 /* Alert.swift */,
6E651CC72314397D001CC974 /* FlippedClipView.swift */,
6E651CC9231439CE001CC974 /* InfoButton.swift */,
);
Expand Down Expand Up @@ -230,7 +246,6 @@
6EC40A1D214EF87E00BE4F17 /* Model */ = {
isa = PBXGroup;
children = (
B5E09547250BCCFC00A40409 /* Alert.swift */,
6EC40A1B214EF87800BE4F17 /* SigningIdentity.swift */,
6EC40A13214DFB5800BE4F17 /* Model.swift */,
6EC40A0F214DE3B200BE4F17 /* Executable.swift */,
Expand Down Expand Up @@ -391,9 +406,10 @@
files = (
34DED4D423FDCAFD00C53FB9 /* SwiftyCMSDecoder.swift in Sources */,
5F95AE262315A7CB002E0A22 /* TCCProfileImporterTests.swift in Sources */,
59206D6925265F0C00B94795 /* TCCProfileTests.swift in Sources */,
5901A2772534DF1400A1CD2F /* ModelBuilder.swift in Sources */,
59798B82252D16310070A204 /* TCCProfileBuilder.swift in Sources */,
5F90EBE42319992B00738D09 /* ModelTests.swift in Sources */,
34DED4D323FDC77E00C53FB9 /* TCCProfile.swift in Sources */,
345B01D723FDBF55008838B6 /* TCCProfileExtensions.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -454,18 +470,19 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = XPLDEEDNHE;
INFOPLIST_FILE = "PPPC UtilityTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
PRODUCT_BUNDLE_IDENTIFIER = "com.jamf.PPPC-UtilityTests";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PPPC Utility.app/Contents/MacOS/PPPC Utility";
Expand All @@ -477,18 +494,19 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = XPLDEEDNHE;
INFOPLIST_FILE = "PPPC UtilityTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
PRODUCT_BUNDLE_IDENTIFIER = "com.jamf.PPPC-UtilityTests";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PPPC Utility.app/Contents/MacOS/PPPC Utility";
};
Expand Down Expand Up @@ -544,7 +562,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
IBSC_NOTICES = NO;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -598,7 +617,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
IBSC_NOTICES = NO;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
Expand All @@ -612,9 +632,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "Resources/PPPC Utility.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = XPLDEEDNHE;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = Resources/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -634,9 +655,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "Resources/PPPC Utility.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = XPLDEEDNHE;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = Resources/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
53 changes: 53 additions & 0 deletions PPPC UtilityTests/Helpers/ModelBuilder.swift
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
}

}
74 changes: 74 additions & 0 deletions PPPC UtilityTests/Helpers/TCCProfileBuilder.swift
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
}

}
Loading