Skip to content

Commit 195252b

Browse files
Kai SongKai Song
authored andcommitted
Merge branch 'dev' into kasong/2914053-common-interface
2 parents 5603852 + ea6ed86 commit 195252b

File tree

78 files changed

+2522
-804
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2522
-804
lines changed

IdentityCore/IdentityCore.xcodeproj/project.pbxproj

Lines changed: 111 additions & 21 deletions
Large diffs are not rendered by default.

IdentityCore/src/MSIDBrokerConstants.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,3 @@ extern NSString * _Nonnull const MSID_CREATE_NEW_URL_SESSION;
104104
extern NSString * _Nonnull const MSID_HTTP_CONNECTION_VALUE;
105105
extern NSString * _Nonnull const MSID_FORCE_REFRESH_KEY;
106106

107-
extern BOOL MSID_SUPPRESS_CAMERA_CONSENT_PROMPT_IN_WEBVIEW;
108-

IdentityCore/src/MSIDBrokerConstants.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,3 @@
104104
// Http header
105105
NSString *const MSID_HTTP_CONNECTION = @"Connection";
106106
NSString *const MSID_HTTP_CONNECTION_VALUE = @"close";
107-
108-
// Non-constant
109-
BOOL MSID_SUPPRESS_CAMERA_CONSENT_PROMPT_IN_WEBVIEW = NO;

IdentityCore/src/MSIDConstants.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,10 @@ typedef NS_ENUM(NSInteger, MSIDPlatformSequenceIndex)
179179
MSIDPlatformSequenceIndexLast = MSIDPlatformSequenceIndexBrowserCore,
180180
};
181181

182+
extern NSString * _Nonnull const MSID_BROWSER_RESPONSE_SWITCH_BROWSER;
183+
extern NSString * _Nonnull const MSID_BROWSER_RESPONSE_SWITCH_BROWSER_RESUME;
184+
185+
extern NSString * _Nonnull const MSID_FLIGHT_USE_V2_WEB_RESPONSE_FACTORY;
186+
extern NSString * _Nonnull const MSID_FLIGHT_SUPPORT_DUNA_CBA;
187+
182188
#define METHODANDLINE [NSString stringWithFormat:@"%s [Line %d]", __PRETTY_FUNCTION__, __LINE__]

IdentityCore/src/MSIDConstants.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,11 @@
7373

7474
NSString *const MSID_BROWSER_NATIVE_MESSAGE_ACCOUNT_ID_KEY = @"accountId";
7575

76+
NSString *const MSID_BROWSER_RESPONSE_SWITCH_BROWSER = @"switch_browser";
77+
NSString *const MSID_BROWSER_RESPONSE_SWITCH_BROWSER_RESUME = @"switch_browser_resume";
78+
79+
NSString *const MSID_FLIGHT_USE_V2_WEB_RESPONSE_FACTORY = @"use_v2_web_response_factory";
80+
NSString *const MSID_FLIGHT_SUPPORT_DUNA_CBA = @"support_duna_cba";
81+
82+
7683
#define METHODANDLINE [NSString stringWithFormat:@"%s [Line %d]", __PRETTY_FUNCTION__, __LINE__]

IdentityCore/src/webview/embeddedWebview/challangeHandlers/ios/MSIDCertAuthHandler+iOS.h renamed to IdentityCore/src/MSIDFlightManager.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//
12
// Copyright (c) Microsoft Corporation.
23
// All rights reserved.
34
//
@@ -19,29 +20,25 @@
1920
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2021
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2122
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22-
// THE SOFTWARE.
23+
// THE SOFTWARE.
24+
2325

24-
#ifndef MSIDCertAuthHandler_iOS_h
25-
#define MSIDCertAuthHandler_iOS_h
26+
#import <Foundation/Foundation.h>
2627

27-
#import "MSIDCertAuthHandler.h"
28+
NS_ASSUME_NONNULL_BEGIN
2829

29-
@interface MSIDCertAuthHandler (iOS)
30+
@protocol MSIDFlightManagerInterface <NSObject>
3031

31-
#if TARGET_OS_IPHONE && !MSID_EXCLUDE_SYSTEMWV
32+
- (BOOL)boolForKey:(NSString *)flightKey;
3233

33-
+ (void)setRedirectUriPrefix:(NSString *)prefix
34-
forScheme:(NSString *)scheme;
34+
@end
3535

36-
+ (void)setUseAuthSession:(BOOL)useAuthSession;
37-
+ (void)setUseLastRequestURL:(BOOL)useLastRequestURL;
36+
@interface MSIDFlightManager : NSObject <MSIDFlightManagerInterface>
3837

39-
// These are for cert auth challenge for iOS
40-
+ (void)setCustomActivities:(NSArray<UIActivity *> *)activities;
41-
+ (BOOL)completeCertAuthChallenge:(NSURL *)endUrl;
42-
+ (BOOL)isCertAuthInProgress;
38+
@property (nonatomic) id<MSIDFlightManagerInterface> flightProvider;
4339

44-
#endif
40+
+ (instancetype)sharedInstance;
4541

4642
@end
47-
#endif /* MSIDCertAuthHandler_mac_h */
43+
44+
NS_ASSUME_NONNULL_END
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
//
2+
// Copyright (c) Microsoft Corporation.
3+
// All rights reserved.
4+
//
5+
// This code is licensed under the MIT License.
6+
//
7+
// Permission is hereby granted, free of charge, to any person obtaining a copy
8+
// of this software and associated documentation files(the "Software"), to deal
9+
// in the Software without restriction, including without limitation the rights
10+
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
11+
// copies of the Software, and to permit persons to whom the Software is
12+
// furnished to do so, subject to the following conditions :
13+
//
14+
// The above copyright notice and this permission notice shall be included in
15+
// all copies or substantial portions of the Software.
16+
//
17+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
// THE SOFTWARE.
24+
25+
26+
#import "MSIDFlightManager.h"
27+
28+
@implementation MSIDFlightManager
29+
30+
+ (instancetype)sharedInstance
31+
{
32+
static MSIDFlightManager *sharedInstance = nil;
33+
static dispatch_once_t onceToken;
34+
dispatch_once(&onceToken, ^{
35+
sharedInstance = [[self.class alloc] init];
36+
});
37+
38+
return sharedInstance;
39+
}
40+
41+
#pragma mark - MSIDFlightManagerInterface
42+
43+
- (BOOL)boolForKey:(nonnull NSString *)flightKey
44+
{
45+
if (self.flightProvider) { return [self.flightProvider boolForKey:flightKey]; }
46+
47+
return NO;
48+
}
49+
50+
@end

IdentityCore/src/broker_operation/response/MSIDBrokerNativeAppOperationResponse.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,6 @@ NS_ASSUME_NONNULL_BEGIN
5353
- (instancetype)init NS_UNAVAILABLE;
5454
+ (instancetype)new NS_UNAVAILABLE;
5555

56-
#if !EXCLUDE_FROM_MSALCPP
57-
58-
- (void)trackPerfTelemetryWithLastRequest:(MSIDLastRequestTelemetry *)telemetry
59-
requestStartDate:(NSDate *)requestStartDate
60-
telemetryType:(NSString *)telemetryType;
61-
62-
#endif
63-
64-
6556
@end
6657

6758
NS_ASSUME_NONNULL_END

IdentityCore/src/broker_operation/response/MSIDBrokerNativeAppOperationResponse.m

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -124,29 +124,4 @@ - (NSDictionary *)jsonDictionary
124124
return json;
125125
}
126126

127-
#if !EXCLUDE_FROM_MSALCPP
128-
129-
- (void)trackPerfTelemetryWithLastRequest:(MSIDLastRequestTelemetry *)telemetry
130-
requestStartDate:(NSDate *)requestStartDate
131-
telemetryType:(NSString *)telemetryType
132-
{
133-
if (!requestStartDate)
134-
{
135-
MSID_LOG_WITH_CTX(MSIDLogLevelError, nil, @"trackPerfTelemetryWithLastRequest called with nil request start date");
136-
return;
137-
}
138-
139-
NSDate *responseDate = [NSDate date];
140-
NSTimeInterval totalTime = [responseDate timeIntervalSinceDate:requestStartDate];
141-
NSTimeInterval ipcRequestTime = self.requestReceivedTimeStamp ? [self.requestReceivedTimeStamp timeIntervalSinceDate:requestStartDate] : 0;
142-
NSTimeInterval ipcResponseTime = self.responseGenerationTimeStamp ? [responseDate timeIntervalSinceDate:self.responseGenerationTimeStamp] : 0;
143-
144-
[telemetry trackSSOExtensionPerformanceWithType:telemetryType
145-
totalPerfNumber:totalTime
146-
ipcRequestPerfNumber:ipcRequestTime
147-
ipcResponsePerfNumber:ipcResponseTime];
148-
}
149-
150-
#endif
151-
152127
@end

IdentityCore/src/configuration/webview/MSIDAuthorizeWebRequestConfiguration.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ - (MSIDWebviewResponse *)responseWithResultURL:(NSURL *)url
5858
error:(NSError *__autoreleasing*)error
5959
{
6060
return [factory oAuthResponseWithURL:url
61-
requestState:self.state
62-
ignoreInvalidState:self.ignoreInvalidState
63-
context:context
64-
error:error];
61+
requestState:self.state
62+
ignoreInvalidState:self.ignoreInvalidState
63+
endRedirectUri:self.endRedirectUrl
64+
context:context
65+
error:error];
6566
}
6667

6768
@end

0 commit comments

Comments
 (0)