Skip to content

Commit

Permalink
Merge pull request #1179 from matrix-org/element_4362
Browse files Browse the repository at this point in the history
Stable ids for MSC 2858
  • Loading branch information
ismailgulek authored Aug 9, 2021
2 parents 24e8951 + 6e3356e commit 1a1e9d1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion MatrixSDK/JSONModels/Login/MXLoginSSOFlow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 1 addition & 3 deletions MatrixSDK/JSONModels/Login/MXLoginSSOFlow.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#import "MXLoginSSOFlow.h"

NSString *const MXLoginSSOFlowIdentityProvidersKey = @"identity_providers";
NSString *const MXLoginSSOFlowMSC2858IdentityProvidersKey = @"org.matrix.msc2858.identity_providers";

@interface MXLoginSSOFlow()

Expand All @@ -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<MXLoginSSOIdentityProvider*> *identityProviders;

Expand Down
12 changes: 6 additions & 6 deletions MatrixSDK/JSONModels/Login/MXLoginSSOIdentityProviderBrand.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";
2 changes: 1 addition & 1 deletion MatrixSDKTests/MXAuthenticationSessionUnitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MXAuthenticationSessionUnitTests: XCTestCase {
],
["type": "m.login.sso",
"stages": [],
MXLoginSSOFlowMSC2858IdentityProvidersKey: [
MXLoginSSOFlowIdentityProvidersKey: [
["id": "gitlab",
"name": "GitLab"
],
Expand Down
1 change: 1 addition & 0 deletions changelog.d/4362.api
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SSO: Stable ids for MSC 2858.

0 comments on commit 1a1e9d1

Please sign in to comment.