Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Commit 6cc8dc3

Browse files
Support extensions with a new AppAuthCore target
For Carthage: New AppAuthCore Framework target. For CocoaPods: New AppAuth/Core subspec option. Implementation details: Goal was to support extensions through a target that doesn't contain external user-agent code that can't be compiled, *without* changing how everyone using AppAuth today integrates. This was achieved through adding a new header file AppAuthCore.h with the core files only, and a new Framework target and subspec with just those files.
1 parent 601d07d commit 6cc8dc3

File tree

9 files changed

+595
-25
lines changed

9 files changed

+595
-25
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Docs/
22
xcuserdata/
3+
Carthage/

AppAuth.podspec

+20-10
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,26 @@ It follows the OAuth 2.0 for Native Apps best current practice
3333
s.platforms = { :ios => "7.0", :osx => "10.9", :watchos => "2.0", :tvos => "9.0" }
3434

3535
s.source = { :git => "https://github.com/openid/AppAuth-iOS.git", :tag => s.version }
36-
37-
s.source_files = "Source/*.{h,m}"
3836
s.requires_arc = true
3937

40-
# iOS
41-
s.ios.source_files = "Source/iOS/**/*.{h,m}"
42-
s.ios.deployment_target = "7.0"
43-
s.ios.frameworks = "SafariServices", "AuthenticationServices"
44-
45-
# macOS
46-
s.osx.source_files = "Source/macOS/**/*.{h,m}"
47-
s.osx.deployment_target = '10.9'
38+
# Subspec for the core AppAuth library classes only, suitable for extensions.
39+
s.subspec 'Core' do |core|
40+
core.source_files = "Source/*.{h,m}"
41+
core.exclude_files = "Source/AppAuth.h"
42+
end
43+
44+
# Subspec for the full AppAuth library, including platform-dependant external user agents.
45+
s.subspec 'ExternalUserAgent' do |externalUserAgent|
46+
47+
externalUserAgent.source_files = "Source/*.{h,m}"
48+
49+
# iOS
50+
externalUserAgent.ios.source_files = "Source/iOS/**/*.{h,m}"
51+
externalUserAgent.ios.deployment_target = "7.0"
52+
externalUserAgent.ios.frameworks = "SafariServices", "AuthenticationServices"
53+
54+
# macOS
55+
externalUserAgent.osx.source_files = "Source/macOS/**/*.{h,m}"
56+
externalUserAgent.osx.deployment_target = '10.9'
57+
end
4858
end

AppAuth.xcodeproj/project.pbxproj

+341-1
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1000"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "342F42842177B1FC00574F24"
18+
BuildableName = "AppAuthCore.framework"
19+
BlueprintName = "AppAuthCore"
20+
ReferencedContainer = "container:AppAuth.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "3489707D2177B3B000ABEED4"
36+
BuildableName = "AppAuthCoreTests.xctest"
37+
BlueprintName = "AppAuthCoreTests"
38+
ReferencedContainer = "container:AppAuth.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
<MacroExpansion>
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "342F42842177B1FC00574F24"
46+
BuildableName = "AppAuthCore.framework"
47+
BlueprintName = "AppAuthCore"
48+
ReferencedContainer = "container:AppAuth.xcodeproj">
49+
</BuildableReference>
50+
</MacroExpansion>
51+
<AdditionalOptions>
52+
</AdditionalOptions>
53+
</TestAction>
54+
<LaunchAction
55+
buildConfiguration = "Debug"
56+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
57+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
58+
launchStyle = "0"
59+
useCustomWorkingDirectory = "NO"
60+
ignoresPersistentStateOnLaunch = "NO"
61+
debugDocumentVersioning = "YES"
62+
debugServiceExtension = "internal"
63+
allowLocationSimulation = "YES">
64+
<MacroExpansion>
65+
<BuildableReference
66+
BuildableIdentifier = "primary"
67+
BlueprintIdentifier = "342F42842177B1FC00574F24"
68+
BuildableName = "AppAuthCore.framework"
69+
BlueprintName = "AppAuthCore"
70+
ReferencedContainer = "container:AppAuth.xcodeproj">
71+
</BuildableReference>
72+
</MacroExpansion>
73+
<AdditionalOptions>
74+
</AdditionalOptions>
75+
</LaunchAction>
76+
<ProfileAction
77+
buildConfiguration = "Release"
78+
shouldUseLaunchSchemeArgsEnv = "YES"
79+
savedToolIdentifier = ""
80+
useCustomWorkingDirectory = "NO"
81+
debugDocumentVersioning = "YES">
82+
<MacroExpansion>
83+
<BuildableReference
84+
BuildableIdentifier = "primary"
85+
BlueprintIdentifier = "342F42842177B1FC00574F24"
86+
BuildableName = "AppAuthCore.framework"
87+
BlueprintName = "AppAuthCore"
88+
ReferencedContainer = "container:AppAuth.xcodeproj">
89+
</BuildableReference>
90+
</MacroExpansion>
91+
</ProfileAction>
92+
<AnalyzeAction
93+
buildConfiguration = "Debug">
94+
</AnalyzeAction>
95+
<ArchiveAction
96+
buildConfiguration = "Release"
97+
revealArchiveInOrganizer = "YES">
98+
</ArchiveAction>
99+
</Scheme>

Source/AppAuth.h

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
#error "Platform Undefined"
5858
#endif
5959

60-
6160
/*! @mainpage AppAuth for iOS and macOS
6261
6362
@section introduction Introduction

Source/AppAuthCore.h

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*! @file AppAuthCore.h
2+
@brief AppAuth iOS SDK
3+
@copyright
4+
Copyright 2015 Google Inc. All Rights Reserved.
5+
@copydetails
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/
18+
19+
#import "OIDAuthState.h"
20+
#import "OIDAuthStateChangeDelegate.h"
21+
#import "OIDAuthStateErrorDelegate.h"
22+
#import "OIDAuthorizationRequest.h"
23+
#import "OIDAuthorizationResponse.h"
24+
#import "OIDAuthorizationService.h"
25+
#import "OIDError.h"
26+
#import "OIDErrorUtilities.h"
27+
#import "OIDExternalUserAgent.h"
28+
#import "OIDExternalUserAgentRequest.h"
29+
#import "OIDExternalUserAgentSession.h"
30+
#import "OIDGrantTypes.h"
31+
#import "OIDIDToken.h"
32+
#import "OIDRegistrationRequest.h"
33+
#import "OIDRegistrationResponse.h"
34+
#import "OIDResponseTypes.h"
35+
#import "OIDScopes.h"
36+
#import "OIDScopeUtilities.h"
37+
#import "OIDServiceConfiguration.h"
38+
#import "OIDServiceDiscovery.h"
39+
#import "OIDTokenRequest.h"
40+
#import "OIDTokenResponse.h"
41+
#import "OIDTokenUtilities.h"
42+
#import "OIDURLSessionProvider.h"
43+

Source/CoreFramework/AppAuthCore.h

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*! @file AppAuthCore.h
2+
@brief AppAuth iOS SDK
3+
@copyright
4+
Copyright 2018 The AppAuth Authors. All Rights Reserved.
5+
@copydetails
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/
18+
19+
#import <Foundation/Foundation.h>
20+
21+
//! Project version number for AppAuthFramework-iOS.
22+
FOUNDATION_EXPORT double AppAuthCoreVersionNumber;
23+
24+
//! Project version string for AppAuthCoreFramework.
25+
FOUNDATION_EXPORT const unsigned char AppAuthCoreVersionString[];
26+
27+
#import <AppAuthCore/OIDAuthState.h>
28+
#import <AppAuthCore/OIDAuthStateChangeDelegate.h>
29+
#import <AppAuthCore/OIDAuthStateErrorDelegate.h>
30+
#import <AppAuthCore/OIDAuthorizationRequest.h>
31+
#import <AppAuthCore/OIDAuthorizationResponse.h>
32+
#import <AppAuthCore/OIDAuthorizationService.h>
33+
#import <AppAuthCore/OIDError.h>
34+
#import <AppAuthCore/OIDErrorUtilities.h>
35+
#import <AppAuthCore/OIDExternalUserAgent.h>
36+
#import <AppAuthCore/OIDExternalUserAgentRequest.h>
37+
#import <AppAuthCore/OIDExternalUserAgentSession.h>
38+
#import <AppAuthCore/OIDGrantTypes.h>
39+
#import <AppAuthCore/OIDIDToken.h>
40+
#import <AppAuthCore/OIDRegistrationRequest.h>
41+
#import <AppAuthCore/OIDRegistrationResponse.h>
42+
#import <AppAuthCore/OIDResponseTypes.h>
43+
#import <AppAuthCore/OIDScopes.h>
44+
#import <AppAuthCore/OIDScopeUtilities.h>
45+
#import <AppAuthCore/OIDServiceConfiguration.h>
46+
#import <AppAuthCore/OIDServiceDiscovery.h>
47+
#import <AppAuthCore/OIDTokenRequest.h>
48+
#import <AppAuthCore/OIDTokenResponse.h>
49+
#import <AppAuthCore/OIDTokenUtilities.h>
50+
#import <AppAuthCore/OIDURLSessionProvider.h>
51+
52+

Source/CoreFramework/Info.plist

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>$(CURRENT_PROJECT_VERSION)</string>
21+
<key>NSHumanReadableCopyright</key>
22+
<string>Copyright © 2017 The AppAuth Authors</string>
23+
<key>NSPrincipalClass</key>
24+
<string></string>
25+
</dict>
26+
</plist>

Source/Framework/AppAuth.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/*! @file AppAuth.h
2-
@brief AppAuth iOS SDK
3-
@copyright
4-
Copyright 2015 Google Inc. All Rights Reserved.
5-
@copydetails
6-
Licensed under the Apache License, Version 2.0 (the "License");
7-
you may not use this file except in compliance with the License.
8-
You may obtain a copy of the License at
2+
@brief AppAuth iOS SDK
3+
@copyright
4+
Copyright 2015 Google Inc. All Rights Reserved.
5+
@copydetails
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
99
10-
http://www.apache.org/licenses/LICENSE-2.0
10+
http://www.apache.org/licenses/LICENSE-2.0
1111
12-
Unless required by applicable law or agreed to in writing, software
13-
distributed under the License is distributed on an "AS IS" BASIS,
14-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
See the License for the specific language governing permissions and
16-
limitations under the License.
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
1717
*/
1818

1919
#import <Foundation/Foundation.h>

0 commit comments

Comments
 (0)