Skip to content

Commit

Permalink
Added the v1.0.1 code to Github.
Browse files Browse the repository at this point in the history
  • Loading branch information
macblazer committed Feb 11, 2020
1 parent b7ad050 commit 99316dc
Show file tree
Hide file tree
Showing 21 changed files with 496 additions and 202 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.1] - 2020-01
### Added
- This CHANGELOG.md file.

### Changed
- The Jamf Certificate SDK now adds an interval to the time specified in the pollingTimeout setting. This enables the SDK to retrieve the Managed App Configuration prior to starting the specified pollingTimeout seconds.
- The Jamf Certificate SDK has been re-licensed under the MIT License.

### Fixed
- The Jamf Certificate SDK now properly handles network errors and status updates when making requests for a new Managed App Configuration.
- Fixed an issue that prevented the progress of steps from starting at zero and incrementing by one up to the maxNumberOfSteps.
- Fixed an issue that prevented the NSError object from being correctly sent into the certificateRequest:errorOccurred: delegate method.

## [1.0.0] - 2018-07-24
### Added
- Initial release.
7 changes: 5 additions & 2 deletions Certificate SDK Sample App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
9712A85B213EED15003A2789 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .swiftlint.yml; sourceTree = "<group>"; };
9797329320B37D7000CF87D8 /* CertificateSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CertificateSDK.framework; sourceTree = "<group>"; };
97BE792F20AB6FF3009579E5 /* Certificate SDK Sample App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Certificate SDK Sample App.app"; sourceTree = BUILT_PRODUCTS_DIR; };
97BE793220AB6FF3009579E5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -68,6 +69,7 @@
97BE792620AB6FF3009579E5 = {
isa = PBXGroup;
children = (
9712A85B213EED15003A2789 /* .swiftlint.yml */,
97BE793120AB6FF3009579E5 /* Certificate SDK Sample App */,
9797329320B37D7000CF87D8 /* CertificateSDK.framework */,
97BE793020AB6FF3009579E5 /* Products */,
Expand Down Expand Up @@ -135,6 +137,7 @@
TargetAttributes = {
97BE792E20AB6FF3009579E5 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1120;
SystemCapabilities = {
com.apple.BackgroundModes = {
enabled = 0;
Expand Down Expand Up @@ -360,7 +363,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.jamf.certificate-sdk.sample";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/CertificateSDK.framework/Headers/CertificateSDK.h";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -382,7 +385,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.jamf.certificate-sdk.sample";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/CertificateSDK.framework/Headers/CertificateSDK.h";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
13 changes: 7 additions & 6 deletions Certificate SDK Sample App/ActionLogViewController.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
//
// ActionLogViewController.swift
// Certificate SDK Sample App
// https://github.com/jamf/CertificateSDK
//
// Copyright © 2018 Jamf. All rights reserved.
// Copyright © 2019 Jamf. All rights reserved.
//

import UIKit
import CertificateSDK
import UIKit

class ActionLogViewController: UIViewController {

Expand Down Expand Up @@ -54,16 +55,16 @@ class ActionLogViewController: UIViewController {

// MARK: -

/// Start a new certificate request.
func runTest() {
// Start a new certificate request.
if let sdkSetup = setup {
requestManager?.cancelPendingRequest()
requestManager?.startRequest(with: sdkSetup)
}
}

/// Update the user interface for the detail item.
func resetBaseTextView() {
// Update the user interface for the detail item.
if let sdkSetup = setup, let textView = actionLogTextView {
textView.text = "Setup: \(sdkSetup.description)"

Expand All @@ -72,7 +73,7 @@ class ActionLogViewController: UIViewController {
}

func append(_ logText: String) {
DispatchQueue.main.async(execute: {
DispatchQueue.main.async {
if let textView = self.actionLogTextView {
let existingText = textView.text ?? ""
let newText = "\(existingText)\n\(logText)"
Expand All @@ -82,7 +83,7 @@ class ActionLogViewController: UIViewController {
let lastChar = NSRange(location: (newText as NSString).length - 1, length: 1)
textView.scrollRangeToVisible(lastChar)
}
})
}
}

func updateProgress(_ progress: Float) {
Expand Down
5 changes: 3 additions & 2 deletions Certificate SDK Sample App/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//
// AppDelegate.swift
// Certificate SDK Sample App
// https://github.com/jamf/CertificateSDK
//
// Copyright © 2018 Jamf. All rights reserved.
// Copyright © 2019 Jamf. All rights reserved.
//

import UIKit
Expand All @@ -16,7 +17,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
let requestManager = CertificateRequestManager()

func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
if let splitViewController = window!.rootViewController as? UISplitViewController {
let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1]
Expand Down
9 changes: 8 additions & 1 deletion Certificate SDK Sample App/CertificateRequestManager.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//
// CertificateRequestManager.swift
// Certificate SDK Sample App
// https://github.com/jamf/CertificateSDK
//
// Copyright © 2018 Jamf. All rights reserved.
// Copyright © 2019 Jamf. All rights reserved.
//

import UIKit
Expand Down Expand Up @@ -42,6 +43,7 @@ class CertificateRequestManager: NSObject {
}
certificateRequest = localRequest
}

certificateRequest?.startNewCertificateRequest()
}

Expand Down Expand Up @@ -80,8 +82,13 @@ extension CertificateRequestHandler: CertificateRequestDelegate {
}

func certificateRequest(_ request: CertificateRequestProtocol, isUsingNetwork: Bool) {
self.textOutputHandler?("Using network: \(isUsingNetwork)")
DispatchQueue.main.async {
UIApplication.shared.isNetworkActivityIndicatorVisible = isUsingNetwork
}
}

func certificateRequest(_ request: CertificateRequestProtocol, isWaitingForMAC waitingForMAC: Bool) {
self.textOutputHandler?("Waiting for AppConfig: \(waitingForMAC)")
}
}
3 changes: 2 additions & 1 deletion Certificate SDK Sample App/CertificateSDKSetup.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//
// CertificateSDKSetup.swift
// Certificate SDK Sample App
// https://github.com/jamf/CertificateSDK
//
// Copyright © 2018 Jamf. All rights reserved.
// Copyright © 2019 Jamf. All rights reserved.
//

/// Contains the selected options for the test run
Expand Down
2 changes: 1 addition & 1 deletion Certificate SDK Sample App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<string>1.0.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
17 changes: 11 additions & 6 deletions Certificate SDK Sample App/KeychainHandler.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//
// KeychainHandler.swift
// Certificate SDK Sample App
// https://github.com/jamf/CertificateSDK
//
// Copyright © 2018 Jamf. All rights reserved.
// Copyright © 2019 Jamf. All rights reserved.
//

import Foundation
Expand All @@ -22,6 +23,10 @@ struct KeychainHandler {
return "Keychain item already exists"
case errSecSuccess:
return "Keychain item added"
case errSecNotAvailable:
var result = "Keychain item could not be added. Your device probably does not have a passcode."
result += "Set a passcode and try again."
return result
default:
return "Keychain add resulted in status: \(status)"
}
Expand All @@ -30,10 +35,10 @@ struct KeychainHandler {
func clearKeychain() -> String {
var resultString = ""
let query = [kSecMatchLimit: kSecMatchLimitAll,
kSecReturnAttributes: kCFBooleanTrue,
kSecReturnRef: kCFBooleanTrue,
kSecReturnAttributes: true,
kSecReturnRef: true,
kSecClass: kSecClassIdentity] as CFDictionary
var result: CFTypeRef? = nil
var result: CFTypeRef?
let resultCode = SecItemCopyMatching(query, &result)

if resultCode == errSecSuccess {
Expand Down Expand Up @@ -66,9 +71,9 @@ struct KeychainHandler {
var resultString = "--- Certificates in Keychain ---\n"
var outputACert = false
let query = [kSecMatchLimit: kSecMatchLimitAll,
kSecReturnRef: kCFBooleanTrue,
kSecReturnRef: true,
kSecClass: kSecClassCertificate] as CFDictionary
var result: CFTypeRef? = nil
var result: CFTypeRef?
let resultCode = SecItemCopyMatching(query, &result)

if resultCode == errSecSuccess {
Expand Down
3 changes: 2 additions & 1 deletion Certificate SDK Sample App/SetupTestViewController.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//
// SetupTestViewController.swift
// Certificate SDK Sample App
// https://github.com/jamf/CertificateSDK
//
// Copyright © 2018 Jamf. All rights reserved.
// Copyright © 2019 Jamf. All rights reserved.
//

import UIKit
Expand Down
Binary file modified CertificateSDK.framework/CertificateSDK
100644 → 100755
Binary file not shown.
50 changes: 26 additions & 24 deletions CertificateSDK.framework/Headers/CertificateRequestBase.h
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
/*
CertificateRequestBase.h
CertificateSDK
Copyright © 2018 Jamf. All rights reserved.
This Jamf software is covered by the "Jamf Certificate SDK License".
The first two sections are included here for reference, but please refer
to the complete Jamf Certificate SDK License which is included in the SDK.
1. License Grant. Jamf hereby grants Licensee a limited, nonexclusive, nontransferable,
nonsublicensable, royalty free, fully paid up right to use the Jamf Pro software development
kit (“SDK”) solely for integrating Jamf Pro into the Licensee Product; and copy, distribute,
and connect with other software Jamf Pro as integrated into the LIcensee product, which it
may sell or offer to sell, or authorize others to the same, to end users.
2. License Restrictions. The SDK is provided under a license, not sold. Except for the rights
expressly granted by Jamf to Licensee above, there are no other licenses granted to Licensee
under this Agreement, express or implied, and Jamf reserves all rights, title, and interest in
and to the SDK. Licensee will not engage, directly or indirectly, in the disassembly, reverse
engineering, decompilation, modification, or translation of the SDK. Licensee will not copy and
sell the SDK as a stand-alone package nor create derivative works of the SDK without the prior
written consent of Jamf. Licensee shall not remove or destroy any proprietary, confidential,
copyright, trademark, or patent markings or notices placed upon the SDK.
*/
CertificateRequestBase.h
https://github.com/jamf/CertificateSDK
MIT License
Copyright (c) 2019 Jamf Open Source Community
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.
*/

#ifndef CertificateRequestBase_h
#define CertificateRequestBase_h
Expand Down
50 changes: 26 additions & 24 deletions CertificateSDK.framework/Headers/CertificateRequestDelegate.h
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
/*
CertificateRequestDelegate.h
CertificateSDK
Copyright © 2018 Jamf. All rights reserved.
This Jamf software is covered by the "Jamf Certificate SDK License".
The first two sections are included here for reference, but please refer
to the complete Jamf Certificate SDK License which is included in the SDK.
1. License Grant. Jamf hereby grants Licensee a limited, nonexclusive, nontransferable,
nonsublicensable, royalty free, fully paid up right to use the Jamf Pro software development
kit (“SDK”) solely for integrating Jamf Pro into the Licensee Product; and copy, distribute,
and connect with other software Jamf Pro as integrated into the LIcensee product, which it
may sell or offer to sell, or authorize others to the same, to end users.
2. License Restrictions. The SDK is provided under a license, not sold. Except for the rights
expressly granted by Jamf to Licensee above, there are no other licenses granted to Licensee
under this Agreement, express or implied, and Jamf reserves all rights, title, and interest in
and to the SDK. Licensee will not engage, directly or indirectly, in the disassembly, reverse
engineering, decompilation, modification, or translation of the SDK. Licensee will not copy and
sell the SDK as a stand-alone package nor create derivative works of the SDK without the prior
written consent of Jamf. Licensee shall not remove or destroy any proprietary, confidential,
copyright, trademark, or patent markings or notices placed upon the SDK.
*/
CertificateRequestDelegate.h
https://github.com/jamf/CertificateSDK
MIT License
Copyright (c) 2019 Jamf Open Source Community
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.
*/

#ifndef CertificateRequestDelegate_h
#define CertificateRequestDelegate_h
Expand Down
Loading

0 comments on commit 99316dc

Please sign in to comment.