From 81a6196e76e0f81ee73c414f4475c637b8a9f2bd Mon Sep 17 00:00:00 2001 From: Kai Song Date: Thu, 27 Feb 2025 09:19:33 -0800 Subject: [PATCH] Update naming --- IdentityCore/src/MSIDBrokerConstants.h | 2 +- IdentityCore/src/MSIDBrokerConstants.m | 2 +- .../src/broker_operation/response/MSIDDeviceInfo.m | 4 ++-- .../tests/MSIDBrokerNativeAppOperationResponseTests.m | 2 +- .../MSIDBrokerOperationGetPasskeyAssertionResponseTests.m | 2 +- ...MSIDBrokerOperationGetPasskeyCredentialResponseTests.m | 2 +- IdentityCore/tests/MSIDBrokerOperationResponseTests.m | 4 ++-- .../tests/MSIDBrokerOperationTokenResponseTests.m | 2 +- IdentityCore/tests/MSIDDeviceInfoTests.m | 8 ++++---- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/IdentityCore/src/MSIDBrokerConstants.h b/IdentityCore/src/MSIDBrokerConstants.h index fcdf8ef1c..a350c11d6 100644 --- a/IdentityCore/src/MSIDBrokerConstants.h +++ b/IdentityCore/src/MSIDBrokerConstants.h @@ -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; diff --git a/IdentityCore/src/MSIDBrokerConstants.m b/IdentityCore/src/MSIDBrokerConstants.m index d1a59bda4..c4dbedfa9 100644 --- a/IdentityCore/src/MSIDBrokerConstants.m +++ b/IdentityCore/src/MSIDBrokerConstants.m @@ -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"; diff --git a/IdentityCore/src/broker_operation/response/MSIDDeviceInfo.m b/IdentityCore/src/broker_operation/response/MSIDDeviceInfo.m index 689b742c8..16fbc4b37 100644 --- a/IdentityCore/src/broker_operation/response/MSIDDeviceInfo.m +++ b/IdentityCore/src/broker_operation/response/MSIDDeviceInfo.m @@ -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]; @@ -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) diff --git a/IdentityCore/tests/MSIDBrokerNativeAppOperationResponseTests.m b/IdentityCore/tests/MSIDBrokerNativeAppOperationResponseTests.m index a03e5e420..40b40febf 100644 --- a/IdentityCore/tests/MSIDBrokerNativeAppOperationResponseTests.m +++ b/IdentityCore/tests/MSIDBrokerNativeAppOperationResponseTests.m @@ -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 diff --git a/IdentityCore/tests/MSIDBrokerOperationGetPasskeyAssertionResponseTests.m b/IdentityCore/tests/MSIDBrokerOperationGetPasskeyAssertionResponseTests.m index e16dd2796..cea8be784 100644 --- a/IdentityCore/tests/MSIDBrokerOperationGetPasskeyAssertionResponseTests.m +++ b/IdentityCore/tests/MSIDBrokerOperationGetPasskeyAssertionResponseTests.m @@ -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 }; diff --git a/IdentityCore/tests/MSIDBrokerOperationGetPasskeyCredentialResponseTests.m b/IdentityCore/tests/MSIDBrokerOperationGetPasskeyCredentialResponseTests.m index 10b1c937d..d938cf81b 100644 --- a/IdentityCore/tests/MSIDBrokerOperationGetPasskeyCredentialResponseTests.m +++ b/IdentityCore/tests/MSIDBrokerOperationGetPasskeyCredentialResponseTests.m @@ -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 }; diff --git a/IdentityCore/tests/MSIDBrokerOperationResponseTests.m b/IdentityCore/tests/MSIDBrokerOperationResponseTests.m index e53d0b725..0bb651e71 100644 --- a/IdentityCore/tests/MSIDBrokerOperationResponseTests.m +++ b/IdentityCore/tests/MSIDBrokerOperationResponseTests.m @@ -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 @@ -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 diff --git a/IdentityCore/tests/MSIDBrokerOperationTokenResponseTests.m b/IdentityCore/tests/MSIDBrokerOperationTokenResponseTests.m index 78e2e21a2..20ffd7541 100644 --- a/IdentityCore/tests/MSIDBrokerOperationTokenResponseTests.m +++ b/IdentityCore/tests/MSIDBrokerOperationTokenResponseTests.m @@ -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 diff --git a/IdentityCore/tests/MSIDDeviceInfoTests.m b/IdentityCore/tests/MSIDDeviceInfoTests.m index e01b30bde..2fc573dbb 100644 --- a/IdentityCore/tests/MSIDDeviceInfoTests.m +++ b/IdentityCore/tests/MSIDDeviceInfoTests.m @@ -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 = @{ @@ -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 = @{ @@ -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]); @@ -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]);