From bf2a7189952654f8e728aabff848e58c42af3107 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 3 Aug 2021 14:06:44 +0300 Subject: [PATCH 1/4] stable ids for MSC 2858 --- MatrixSDK/JSONModels/Login/MXLoginSSOFlow.h | 1 - MatrixSDK/JSONModels/Login/MXLoginSSOFlow.m | 4 +--- .../Login/MXLoginSSOIdentityProviderBrand.h | 12 ++++++------ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/MatrixSDK/JSONModels/Login/MXLoginSSOFlow.h b/MatrixSDK/JSONModels/Login/MXLoginSSOFlow.h index a7a819488d..6fbfe1e965 100644 --- a/MatrixSDK/JSONModels/Login/MXLoginSSOFlow.h +++ b/MatrixSDK/JSONModels/Login/MXLoginSSOFlow.h @@ -21,7 +21,6 @@ NS_ASSUME_NONNULL_BEGIN extern NSString *const MXLoginSSOFlowIdentityProvidersKey; -extern NSString *const MXLoginSSOFlowMSC2858IdentityProvidersKey; // Unstable key to use MSC2858 is not finalized. /** `MXLoginSSOFlow` represents a SSO login or a register flow supported by the home server (See MSC2858 https://github.com/matrix-org/matrix-doc/pull/2858). diff --git a/MatrixSDK/JSONModels/Login/MXLoginSSOFlow.m b/MatrixSDK/JSONModels/Login/MXLoginSSOFlow.m index b4eea29a8c..a275791ae5 100644 --- a/MatrixSDK/JSONModels/Login/MXLoginSSOFlow.m +++ b/MatrixSDK/JSONModels/Login/MXLoginSSOFlow.m @@ -17,7 +17,6 @@ #import "MXLoginSSOFlow.h" NSString *const MXLoginSSOFlowIdentityProvidersKey = @"identity_providers"; -NSString *const MXLoginSSOFlowMSC2858IdentityProvidersKey = @"org.matrix.msc2858.identity_providers"; @interface MXLoginSSOFlow() @@ -35,8 +34,7 @@ + (instancetype)modelFromJSON:(NSDictionary *)JSONDictionary { NSArray *jsonIdentityProdivers; - // Use unstable MSC2858 field while MSC is not finalized - MXJSONModelSetArray(jsonIdentityProdivers, JSONDictionary[MXLoginSSOFlowMSC2858IdentityProvidersKey]); + MXJSONModelSetArray(jsonIdentityProdivers, JSONDictionary[MXLoginSSOFlowIdentityProvidersKey]); NSArray *identityProviders; diff --git a/MatrixSDK/JSONModels/Login/MXLoginSSOIdentityProviderBrand.h b/MatrixSDK/JSONModels/Login/MXLoginSSOIdentityProviderBrand.h index 7d25a3f31f..c8e698573d 100644 --- a/MatrixSDK/JSONModels/Login/MXLoginSSOIdentityProviderBrand.h +++ b/MatrixSDK/JSONModels/Login/MXLoginSSOIdentityProviderBrand.h @@ -19,9 +19,9 @@ /// Clients are free to implement any set of brands they wish, including all or any of the bellow, but are expected to apply a sensible unbranded fallback for any brand they do not recognise/support. typedef NSString *const MXLoginSSOIdentityProviderBrand NS_TYPED_EXTENSIBLE_ENUM; -static MXLoginSSOIdentityProviderBrand const MXLoginSSOIdentityProviderBrandGitlab = @"org.matrix.gitlab"; -static MXLoginSSOIdentityProviderBrand const MXLoginSSOIdentityProviderBrandGithub = @"org.matrix.github"; -static MXLoginSSOIdentityProviderBrand const MXLoginSSOIdentityProviderBrandApple = @"org.matrix.apple"; -static MXLoginSSOIdentityProviderBrand const MXLoginSSOIdentityProviderBrandGoogle = @"org.matrix.google"; -static MXLoginSSOIdentityProviderBrand const MXLoginSSOIdentityProviderBrandFacebook = @"org.matrix.facebook"; -static MXLoginSSOIdentityProviderBrand const MXLoginSSOIdentityProviderBrandTwitter = @"org.matrix.twitter"; +static MXLoginSSOIdentityProviderBrand const MXLoginSSOIdentityProviderBrandGitlab = @"gitlab"; +static MXLoginSSOIdentityProviderBrand const MXLoginSSOIdentityProviderBrandGithub = @"github"; +static MXLoginSSOIdentityProviderBrand const MXLoginSSOIdentityProviderBrandApple = @"apple"; +static MXLoginSSOIdentityProviderBrand const MXLoginSSOIdentityProviderBrandGoogle = @"google"; +static MXLoginSSOIdentityProviderBrand const MXLoginSSOIdentityProviderBrandFacebook = @"facebook"; +static MXLoginSSOIdentityProviderBrand const MXLoginSSOIdentityProviderBrandTwitter = @"twitter"; From 7e62bfd7e36db32363c22604c1c7a15f68de2d8f Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 3 Aug 2021 14:08:37 +0300 Subject: [PATCH 2/4] Update CHANGES.rst --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 25540b0206..065879e7ab 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,7 @@ Changes to be released in next version * 🙌 Improvements - * + * SSO: stable ids for MSC 2858 (vector-im/element-ios/issues/4362). 🐛 Bugfix * From 4482dadc82e50627e0f9f7b91a6ba9aa79a34ecc Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Wed, 4 Aug 2021 13:23:33 +0300 Subject: [PATCH 3/4] Fix tests --- MatrixSDKTests/MXAuthenticationSessionUnitTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MatrixSDKTests/MXAuthenticationSessionUnitTests.swift b/MatrixSDKTests/MXAuthenticationSessionUnitTests.swift index b42e4b9de4..78e8696e6f 100644 --- a/MatrixSDKTests/MXAuthenticationSessionUnitTests.swift +++ b/MatrixSDKTests/MXAuthenticationSessionUnitTests.swift @@ -39,7 +39,7 @@ class MXAuthenticationSessionUnitTests: XCTestCase { ], ["type": "m.login.sso", "stages": [], - MXLoginSSOFlowMSC2858IdentityProvidersKey: [ + MXLoginSSOFlowIdentityProvidersKey: [ ["id": "gitlab", "name": "GitLab" ], From 6e3356eeadf38a8401d6325177eff10273f85c39 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Mon, 9 Aug 2021 18:08:28 +0300 Subject: [PATCH 4/4] Add changelog --- changelog.d/4362.api | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/4362.api diff --git a/changelog.d/4362.api b/changelog.d/4362.api new file mode 100644 index 0000000000..3992781124 --- /dev/null +++ b/changelog.d/4362.api @@ -0,0 +1 @@ +SSO: Stable ids for MSC 2858.