Skip to content

Commit

Permalink
Update naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Song authored and Kai Song committed Feb 27, 2025
1 parent 802fea8 commit 81a6196
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion IdentityCore/src/MSIDBrokerConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ extern NSString * _Nonnull const MSID_BROKER_DEVICE_MODE_KEY;
extern NSString * _Nonnull const MSID_BROKER_SSO_EXTENSION_MODE_KEY;
extern NSString * _Nonnull const MSID_BROKER_WPJ_STATUS_KEY;
extern NSString * _Nonnull const MSID_BROKER_BROKER_VERSION_KEY;
extern NSString * _Nonnull const MSID_BROKER_BROKER_TYPE_KEY;
extern NSString * _Nonnull const MSID_SSO_PROVIDER_TYPE_KEY;
extern NSString * _Nonnull const MSID_BROKER_IS_PERFORMING_CBA;
extern NSString * _Nonnull const MSID_ADAL_BROKER_MESSAGE_VERSION;
extern NSString * _Nonnull const MSID_MSAL_BROKER_MESSAGE_VERSION;
Expand Down
2 changes: 1 addition & 1 deletion IdentityCore/src/MSIDBrokerConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
NSString *const MSID_BROKER_SSO_EXTENSION_MODE_KEY = @"sso_extension_mode";
NSString *const MSID_BROKER_WPJ_STATUS_KEY = @"wpj_status";
NSString *const MSID_BROKER_BROKER_VERSION_KEY = @"broker_version";
NSString *const MSID_BROKER_BROKER_TYPE_KEY = @"broker_type";
NSString *const MSID_SSO_PROVIDER_TYPE_KEY = @"sso_provider_type";
NSString *const MSID_BROKER_IS_PERFORMING_CBA = @"broker_is_performing_cba";
NSString *const MSID_ADAL_BROKER_MESSAGE_VERSION = @"2";
NSString *const MSID_MSAL_BROKER_MESSAGE_VERSION = @"3";
Expand Down
4 changes: 2 additions & 2 deletions IdentityCore/src/broker_operation/response/MSIDDeviceInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ - (instancetype)initWithJSONDictionary:(NSDictionary *)json error:(__unused NSEr

#if TARGET_OS_OSX
_platformSSOStatus = [self platformSSOStatusEnumFromString:[json msidStringObjectForKey:MSID_PLATFORM_SSO_STATUS_KEY]];
_ssoProviderType = [self ssoProviderTypeEnumFromString:[json msidStringObjectForKey:MSID_BROKER_BROKER_TYPE_KEY]];
_ssoProviderType = [self ssoProviderTypeEnumFromString:[json msidStringObjectForKey:MSID_SSO_PROVIDER_TYPE_KEY]];
#endif

NSString *jsonDataString = [json msidStringObjectForKey:MSID_ADDITIONAL_EXTENSION_DATA_KEY];
Expand Down Expand Up @@ -99,7 +99,7 @@ - (NSDictionary *)jsonDictionary
json[MSID_BROKER_PREFERRED_AUTH_CONFIGURATION_KEY] = [self preferredAuthConfigurationStringFromEnum:self.preferredAuthConfig];
#if TARGET_OS_OSX
json[MSID_PLATFORM_SSO_STATUS_KEY] = [self platformSSOStatusStringFromEnum:self.platformSSOStatus];
json[MSID_BROKER_BROKER_TYPE_KEY] = [self ssoProviderTypeStringFromEnum:self.ssoProviderType];
json[MSID_SSO_PROVIDER_TYPE_KEY] = [self ssoProviderTypeStringFromEnum:self.ssoProviderType];
#endif
json[MSID_ADDITIONAL_EXTENSION_DATA_KEY] = [self.additionalExtensionData msidJSONSerializeWithContext:nil];
if (self.extraDeviceInfo)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ - (void)testJsonDictionary_whenAllPropertiesSet_shouldReturnJson
NSDictionary *json = [response jsonDictionary];
#if TARGET_OS_OSX
XCTAssertEqual(12, json.allKeys.count);
XCTAssertEqualObjects(json[MSID_BROKER_BROKER_TYPE_KEY], @"unknown");
XCTAssertEqualObjects(json[MSID_SSO_PROVIDER_TYPE_KEY], @"unknown");
#else
XCTAssertEqual(10, json.allKeys.count);
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ - (void)testJsonDictionary_whenInitWithDictionary_shouldBeConvertedBackToDiction
@"preferred_auth_config": @"preferredAuthNotConfigured",
#if TARGET_OS_OSX
@"platform_sso_status": @"platformSSONotEnabled",
@"broker_type": @"unknown"
@"sso_provider_type": @"unknown"
#endif
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ - (void)testJsonDictionary_whenInitWithDictionary_shouldBeConvertedBackToDiction
@"preferred_auth_config": @"preferredAuthNotConfigured",
#if TARGET_OS_OSX
@"platform_sso_status": @"platformSSONotEnabled",
@"broker_type": @"unknown"
@"sso_provider_type": @"unknown"
#endif
};

Expand Down
4 changes: 2 additions & 2 deletions IdentityCore/tests/MSIDBrokerOperationResponseTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ - (void)testJsonDictionary_whenAllPropertiesSet_shouldReturnJson
NSDictionary *json = [response jsonDictionary];
#if TARGET_OS_OSX
XCTAssertEqual(11, json.allKeys.count);
XCTAssertEqualObjects(json[MSID_BROKER_BROKER_TYPE_KEY], @"companyPortal");
XCTAssertEqualObjects(json[MSID_SSO_PROVIDER_TYPE_KEY], @"companyPortal");
#else
XCTAssertEqual(9, json.allKeys.count);
#endif
Expand All @@ -95,7 +95,7 @@ - (void)testJsonDictionary_whenRequiredPropertiesSet_shouldReturnJson
NSDictionary *json = [response jsonDictionary];
#if TARGET_OS_OSX
XCTAssertEqual(9, json.allKeys.count);
XCTAssertEqualObjects(json[MSID_BROKER_BROKER_TYPE_KEY], @"unknown");
XCTAssertEqualObjects(json[MSID_SSO_PROVIDER_TYPE_KEY], @"unknown");
#else
XCTAssertEqual(7, json.allKeys.count);
#endif
Expand Down
2 changes: 1 addition & 1 deletion IdentityCore/tests/MSIDBrokerOperationTokenResponseTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ - (void)testJsonDictionary_whenAllPropertiesSetForSuccessResponse_shouldReturnJs
NSDictionary *json = [response jsonDictionary];
#if TARGET_OS_OSX
XCTAssertEqual(23, json.allKeys.count);
XCTAssertEqualObjects(json[@"broker_type"], @"macBroker");
XCTAssertEqualObjects(json[@"sso_provider_type"], @"macBroker");
#else
XCTAssertEqual(21, json.allKeys.count);
#endif
Expand Down
8 changes: 4 additions & 4 deletions IdentityCore/tests/MSIDDeviceInfoTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ - (void)testJsonDictionary_whenDeserialize_shouldGenerateCorrectJson {
MSID_PLATFORM_SSO_STATUS_KEY : @"platformSSONotEnabled",
MSID_ADDITIONAL_EXTENSION_DATA_KEY: @"{\"dict\":{\"key\":\"value\"},\"feature_flag1\":1,\"token\":\"\"}",
MSID_BROKER_PREFERRED_AUTH_CONFIGURATION_KEY : @"preferredAuthNotConfigured",
MSID_BROKER_BROKER_TYPE_KEY : @"unknown"
MSID_SSO_PROVIDER_TYPE_KEY : @"unknown"
};
#else
NSDictionary *expectedJson = @{
Expand Down Expand Up @@ -286,7 +286,7 @@ - (void)testJsonDictionaryFromOldSDK_whenDeserialize_shouldGenerateCorrectJson {
MSID_PLATFORM_SSO_STATUS_KEY : @"platformSSONotEnabled",
MSID_ADDITIONAL_EXTENSION_DATA_KEY: @"{\"dict\":{\"key\":\"value\"},\"feature_flag1\":1,\"token\":\"\"}",
MSID_BROKER_PREFERRED_AUTH_CONFIGURATION_KEY : @"preferredAuthNotConfigured",
MSID_BROKER_BROKER_TYPE_KEY : @"unknown"
MSID_SSO_PROVIDER_TYPE_KEY : @"unknown"
};
#else
NSDictionary *expectedJson = @{
Expand Down Expand Up @@ -348,7 +348,7 @@ - (void)testJsonDictionaryWithPlatformSSOStatus_whenDeserialize_shouldGenerateCo
@"platformSSOEnabledAndRegistered",
MSID_BROKER_PREFERRED_AUTH_CONFIGURATION_KEY : @"preferredAuthNotConfigured",
MSID_ADDITIONAL_EXTENSION_DATA_KEY: @"{\"dict\":{\"key\":\"value\"},\"feature_flag1\":1,\"token\":\"\"}",
MSID_BROKER_BROKER_TYPE_KEY : @"macBroker",
MSID_SSO_PROVIDER_TYPE_KEY : @"macBroker",
};

XCTAssertEqualObjects(expectedJson, [deviceInfo jsonDictionary]);
Expand All @@ -375,7 +375,7 @@ - (void)testJsonDictionaryWithCompanyPortalAsSsoProvider_whenDeserialize_shouldG
@"platformSSOEnabledAndRegistered",
MSID_BROKER_PREFERRED_AUTH_CONFIGURATION_KEY : @"preferredAuthNotConfigured",
MSID_ADDITIONAL_EXTENSION_DATA_KEY: @"{\"dict\":{\"key\":\"value\"},\"feature_flag1\":1,\"token\":\"\"}",
MSID_BROKER_BROKER_TYPE_KEY : @"companyPortal",
MSID_SSO_PROVIDER_TYPE_KEY : @"companyPortal",
};

XCTAssertEqualObjects(expectedJson, [deviceInfo jsonDictionary]);
Expand Down

0 comments on commit 81a6196

Please sign in to comment.