Link to the new AppSSO private framework
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jun 2019 08:17:04 +0000 (08:17 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jun 2019 08:17:04 +0000 (08:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=198949
<rdar://problem/51281897>

Reviewed by Brent Fulgham.

* PAL.xcodeproj/project.pbxproj:
* pal/cocoa/AppSSOSoftLink.h:
* pal/cocoa/AppSSOSoftLink.mm:
* pal/spi/cocoa/AppSSOSPI.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246534 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
Source/WebCore/PAL/pal/cocoa/AppSSOSoftLink.h
Source/WebCore/PAL/pal/cocoa/AppSSOSoftLink.mm
Source/WebCore/PAL/pal/spi/cocoa/AppSSOSPI.h [new file with mode: 0644]

index 15028d9..151f765 100644 (file)
@@ -1,3 +1,16 @@
+2019-06-18  Jiewen Tan  <jiewen_tan@apple.com>
+
+        Link to the new AppSSO private framework
+        https://bugs.webkit.org/show_bug.cgi?id=198949
+        <rdar://problem/51281897>
+
+        Reviewed by Brent Fulgham.
+
+        * PAL.xcodeproj/project.pbxproj:
+        * pal/cocoa/AppSSOSoftLink.h:
+        * pal/cocoa/AppSSOSoftLink.mm:
+        * pal/spi/cocoa/AppSSOSPI.h: Added.
+
 2019-06-17  Jiewen Tan  <jiewen_tan@apple.com>
 
         Move SOAuthorization from WebKitAdditions to WebKit
index ab85e48..9a9aba4 100644 (file)
                570AB8F120AE2E8D00B8BE87 /* SecKeyProxySPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 570AB8F020AE2E8D00B8BE87 /* SecKeyProxySPI.h */; };
                570AB8F920AF6E3D00B8BE87 /* NSXPCConnectionSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 570AB8F820AF6E3D00B8BE87 /* NSXPCConnectionSPI.h */; };
                572A107822B456F500F410C8 /* AuthKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 572A107722B456F500F410C8 /* AuthKitSPI.h */; };
+               576CA9D622B854AB0030143C /* AppSSOSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 576CA9D522B854AB0030143C /* AppSSOSPI.h */; };
                57FD318A22B3593E008D0E8B /* AppSSOSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 57FD318922B3593E008D0E8B /* AppSSOSoftLink.mm */; };
                57FD318B22B35989008D0E8B /* AppSSOSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 57FD318822B3592F008D0E8B /* AppSSOSoftLink.h */; };
                63C7EDC721AFAE04006A7B99 /* NSProgressSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 63E369F921AFA83F001C14BC /* NSProgressSPI.h */; };
                570AB8F020AE2E8D00B8BE87 /* SecKeyProxySPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SecKeyProxySPI.h; sourceTree = "<group>"; };
                570AB8F820AF6E3D00B8BE87 /* NSXPCConnectionSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSXPCConnectionSPI.h; sourceTree = "<group>"; };
                572A107722B456F500F410C8 /* AuthKitSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AuthKitSPI.h; sourceTree = "<group>"; };
+               576CA9D522B854AB0030143C /* AppSSOSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppSSOSPI.h; sourceTree = "<group>"; };
                57FD318822B3592F008D0E8B /* AppSSOSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppSSOSoftLink.h; sourceTree = "<group>"; };
                57FD318922B3593E008D0E8B /* AppSSOSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppSSOSoftLink.mm; sourceTree = "<group>"; };
                63E369F921AFA83F001C14BC /* NSProgressSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSProgressSPI.h; sourceTree = "<group>"; };
                0C2DA1201F3BE9E700DBC317 /* cocoa */ = {
                        isa = PBXGroup;
                        children = (
+                               576CA9D522B854AB0030143C /* AppSSOSPI.h */,
                                2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */,
                                572A107722B456F500F410C8 /* AuthKitSPI.h */,
                                0C2DA1221F3BEB4900DBC317 /* AVKitSPI.h */,
                        buildActionMask = 2147483647;
                        files = (
                                57FD318B22B35989008D0E8B /* AppSSOSoftLink.h in Headers */,
+                               576CA9D622B854AB0030143C /* AppSSOSPI.h in Headers */,
                                2D02E93C2056FAA700A13797 /* AudioToolboxSPI.h in Headers */,
                                572A107822B456F500F410C8 /* AuthKitSPI.h in Headers */,
                                077E87B2226A460300A2AFF0 /* AVFoundationSoftLink.h in Headers */,
index 614c537..f76c565 100644 (file)
@@ -27,7 +27,7 @@
 
 #if HAVE(APP_SSO)
 
-#import <AppSSO/AppSSO.h>
+#import <pal/spi/cocoa/AppSSOSPI.h>
 #import <wtf/SoftLinking.h>
 
 SOFT_LINK_FRAMEWORK_FOR_HEADER(PAL, AppSSO);
index ef1cd20..8a0c557 100644 (file)
@@ -29,7 +29,7 @@
 
 #import <wtf/SoftLinking.h>
 
-SOFT_LINK_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(PAL, AppSSO, PAL_EXPORT);
+SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(PAL, AppSSO, PAL_EXPORT);
 
 #if PLATFORM(MAC)
 SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AppSSO, SOAuthorization, PAL_EXPORT);
diff --git a/Source/WebCore/PAL/pal/spi/cocoa/AppSSOSPI.h b/Source/WebCore/PAL/pal/spi/cocoa/AppSSOSPI.h
new file mode 100644 (file)
index 0000000..f3c2497
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if HAVE(APP_SSO)
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <AppSSO/AppSSO.h>
+
+#else
+
+#if __has_include(<UIKit/UIKit.h>)
+#import <UIKit/UIKit.h>
+typedef UIViewController * SOAuthorizationViewController;
+#elif __has_include(<AppKit/AppKit.h>)
+typedef id SOAuthorizationViewController;
+#endif
+
+NS_ASSUME_NONNULL_BEGIN
+
+#define kSOErrorAuthorizationPresentationFailed -7
+
+extern NSErrorDomain const SOErrorDomain;
+
+typedef NSString * SOAuthorizationOperation;
+
+@class SOAuthorization;
+@class SOAuthorizationParameters;
+
+@protocol SOAuthorizationDelegate <NSObject>
+@optional
+- (void)authorizationDidNotHandle:(SOAuthorization *)authorization;
+- (void)authorizationDidCancel:(SOAuthorization *)authorization;
+- (void)authorizationDidComplete:(SOAuthorization *)authorization;
+- (void)authorization:(SOAuthorization *)authorization didCompleteWithHTTPAuthorizationHeaders:(NSDictionary<NSString *, NSString *> *)httpAuthorizationHeaders;
+- (void)authorization:(SOAuthorization *)authorization didCompleteWithHTTPResponse:(NSHTTPURLResponse *)httpResponse httpBody:(NSData *)httpBody;
+- (void)authorization:(SOAuthorization *)authorization didCompleteWithError:(NSError *)error;
+- (void)authorization:(SOAuthorization *)authorization presentViewController:(SOAuthorizationViewController)viewController withCompletion:(void (^)(BOOL success, NSError * _Nullable error))completion;
+@end
+
+typedef NSString * SOAuthorizationOption;
+extern SOAuthorizationOption const SOAuthorizationOptionUserActionInitiated;
+extern SOAuthorizationOption const SOAuthorizationOptionInitiatorOrigin;
+extern SOAuthorizationOption const SOAuthorizationOptionInitiatingAction;
+
+typedef NS_ENUM(NSInteger, SOAuthorizationInitiatingAction) {
+    SOAuthorizationInitiatingActionRedirect,
+    SOAuthorizationInitiatingActionPopUp,
+    SOAuthorizationInitiatingActionKerberos,
+    SOAuthorizationInitiatingActionSubframe,
+};
+
+@interface SOAuthorization : NSObject
+@property (weak) id<SOAuthorizationDelegate> delegate;
+@property (retain, nullable) dispatch_queue_t delegateDispatchQueue;
+@property (copy, nonatomic) NSDictionary *authorizationOptions;
+@property (nonatomic) BOOL enableEmbeddedAuthorizationViewController;
++ (BOOL)canPerformAuthorizationWithURL:(NSURL *)url responseCode:(NSInteger)responseCode;
++ (BOOL)canPerformAuthorizationWithURL:(NSURL *)url responseCode:(NSInteger)responseCode useInternalExtensions:(BOOL)useInternalExtensions;
+- (void)beginAuthorizationWithURL:(NSURL *)url httpHeaders:(NSDictionary <NSString *, NSString *> *)httpHeaders httpBody:(NSData *)httpBody;
+- (void)beginAuthorizationWithOperation:(nullable SOAuthorizationOperation)operation url:(NSURL *)url httpHeaders:(NSDictionary <NSString *, NSString *> *)httpHeaders httpBody:(NSData *)httpBody;
+- (void)beginAuthorizationWithParameters:(SOAuthorizationParameters *)parameters;
+- (void)cancelAuthorization;
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif // USE(APPLE_INTERNAL_SDK)
+
+#endif // HAVE(APP_SSO)