Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable ids for MSC 2858 #1179

Merged
merged 5 commits into from
Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.