Skip to content

Commit

Permalink
Posting v1.1.0 code to Github.
Browse files Browse the repository at this point in the history
  • Loading branch information
macblazer committed Jan 8, 2021
1 parent fc6e72e commit f966134
Show file tree
Hide file tree
Showing 30 changed files with 593 additions and 64 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@ 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
## [1.1.0] - 2021-01
### Added
- The compiled framework now includes simulator code for simulators running on Macs with Apple silicon.
- Added a `Package.swift` file for integration with Swift Package Manager.

### Changed
- The compiled framework is now an XCFramework to allow easy integration with Xcode 12 projects.

### Fixed
- Fixed an issue that caused two `certificate(request:error:)` calls to be made to the delegate if the SDK could not reach Jamf Pro to request a new AppConfig.

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

Expand Down
30 changes: 11 additions & 19 deletions Certificate SDK Sample App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 52;
objects = {

/* Begin PBXBuildFile section */
9797329420B37D7000CF87D8 /* CertificateSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9797329320B37D7000CF87D8 /* CertificateSDK.framework */; };
9797329520B37D7000CF87D8 /* CertificateSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9797329320B37D7000CF87D8 /* CertificateSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
972DA469258D542E00ABD6A3 /* CertificateSDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 972DA467258D53C900ABD6A3 /* CertificateSDK.xcframework */; };
972DA46A258D542E00ABD6A3 /* CertificateSDK.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 972DA467258D53C900ABD6A3 /* CertificateSDK.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
97BE793320AB6FF3009579E5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97BE793220AB6FF3009579E5 /* AppDelegate.swift */; };
97BE793520AB6FF3009579E5 /* SetupTestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97BE793420AB6FF3009579E5 /* SetupTestViewController.swift */; };
97BE793720AB6FF3009579E5 /* ActionLogViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97BE793620AB6FF3009579E5 /* ActionLogViewController.swift */; };
Expand All @@ -29,7 +29,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
9797329520B37D7000CF87D8 /* CertificateSDK.framework in Embed Frameworks */,
972DA46A258D542E00ABD6A3 /* CertificateSDK.xcframework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -38,7 +38,7 @@

/* 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>"; };
972DA467258D53C900ABD6A3 /* CertificateSDK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = CertificateSDK.xcframework; 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>"; };
97BE793420AB6FF3009579E5 /* SetupTestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetupTestViewController.swift; sourceTree = "<group>"; };
Expand All @@ -59,7 +59,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9797329420B37D7000CF87D8 /* CertificateSDK.framework in Frameworks */,
972DA469258D542E00ABD6A3 /* CertificateSDK.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -71,7 +71,7 @@
children = (
9712A85B213EED15003A2789 /* .swiftlint.yml */,
97BE793120AB6FF3009579E5 /* Certificate SDK Sample App */,
9797329320B37D7000CF87D8 /* CertificateSDK.framework */,
972DA467258D53C900ABD6A3 /* CertificateSDK.xcframework */,
97BE793020AB6FF3009579E5 /* Products */,
);
sourceTree = "<group>";
Expand Down Expand Up @@ -132,7 +132,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0930;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1220;
ORGANIZATIONNAME = Jamf;
TargetAttributes = {
97BE792E20AB6FF3009579E5 = {
Expand Down Expand Up @@ -191,7 +191,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -258,6 +258,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -318,6 +319,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -351,18 +353,13 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = "Certificate SDK Sample App/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
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 = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -373,18 +370,13 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = "Certificate SDK Sample App/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
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 = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down
1 change: 1 addition & 0 deletions Certificate SDK Sample App/CertificateRequestManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright © 2019 Jamf. All rights reserved.
//

import CertificateSDK
import UIKit

class CertificateRequestManager: NSObject {
Expand Down
Binary file removed CertificateSDK.framework/CertificateSDK
Binary file not shown.
18 changes: 0 additions & 18 deletions CertificateSDK.framework/ios-strip-framework.sh

This file was deleted.

42 changes: 42 additions & 0 deletions CertificateSDK.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>CertificateSDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7</string>
<key>LibraryPath</key>
<string>CertificateSDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
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

#import <Foundation/Foundation.h>
#import <CertificateSDK/CertificateRequestDelegate.h>
#import <CertificateSDK/CertificateRequestProtocol.h>

NS_ASSUME_NONNULL_BEGIN

/**
This class is the base class for all CertificateRequestProtocol objects.
Subclasses will have a concrete implementation of requesting certificates.
*/
NS_CLASS_AVAILABLE_IOS(10_0)
@interface CertificateRequestBase : NSObject <CertificateRequestProtocol>

/**
The object that will be called back with progress, errors, and completion.
*/
@property (weak, readonly) id<CertificateRequestDelegate> delegate;

/**
This is the maximum number of steps in the progress of a certificate request.
May be approximate until the actual call of -startNewCertificateRequest
*/
@property (assign, readonly) NSUInteger maxNumberOfSteps;

/**
Create an object.
@param delegate Your delegate that will be called as the certificate request workflow proceeds
@return An initialized object; may be nil if memory is full
*/
- (nullable instancetype)initWithDelegate:(id<CertificateRequestDelegate>)delegate NS_DESIGNATED_INITIALIZER;

@end

NS_ASSUME_NONNULL_END

#endif /* CertificateRequestBase_h */
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
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

NS_ASSUME_NONNULL_BEGIN

@protocol CertificateRequestProtocol;

/**
Third party apps should have a class that implements these methods for notification on progress, errors, and completion.
*/
@protocol CertificateRequestDelegate <NSObject>

@required
/**
When any kind of error occurs in the process for requesting certificates, this delegate method will be called.
@param request The object that initiated the request
@param error An error object
*/
- (void)certificateRequest:(id<CertificateRequestProtocol>)request errorOccurred:(NSError *)error NS_SWIFT_NAME(certificate(request:error:));

@required
/**
When the request to Jamf Pro is completed, this method will be called. If there were errors, the identity will be nil.
@param request The object that started the request.
@param identity An identity that encapsulates the info from the server.
*/
- (void)certificateRequest:(id<CertificateRequestProtocol>)request completedWithIdentity:(nullable SecIdentityRef)identity
NS_SWIFT_NAME(certificate(request:completedWith:));

@optional
/**
As the steps are completed during the request to Jamf Pro, this method can be called. The current progress can be checked
against the request.maxNumberOfSteps to show progress percentage.
NOTE: Each step may take a different (unknown) amount of time as the actual request will be using network resources.
@param request The object that started the request.
@param current The current progress
*/
- (void)certificateRequest:(id<CertificateRequestProtocol>)request progress:(NSUInteger)current;

@optional
/**
When the CertificateRequest SDK begins accessing the network and when it ends accessing the network, this method
is called if implemented.
@param request The object that started the request.
@param isUsingNetwork Whether or not the request is currently using the network.
*/
- (void)certificateRequest:(id<CertificateRequestProtocol>)request isUsingNetwork:(BOOL)isUsingNetwork;


@optional
/**
When the CertificateRequest SDK detects no settings in the Managed App Config key, or if the invitation in the
Managed App Config has expired this will be called to let you know that it is waiting for a new MAC to be delivered
from the Jamf Pro server. Will be called again when the MAC comes in; the timing on this can vary greatly.
@param request The object that started the request.
@param waitingForMAC Whether or not the request is currently waiting for settings in the Managed App Config.
*/
- (void)certificateRequest:(id<CertificateRequestProtocol>)request isWaitingForMAC:(BOOL)waitingForMAC;

@end

NS_ASSUME_NONNULL_END

#endif /* CertificateRequestDelegate_h */
Loading

0 comments on commit f966134

Please sign in to comment.