-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1815 from matrix-org/release/0.27.1/release
Release 0.27.1
- Loading branch information
Showing
13 changed files
with
191 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
MatrixSDK/JSONModels/AutoDiscovery/MXWellKnownAuthentication.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// Copyright 2023 The Matrix.org Foundation C.I.C | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import "MXJSONModel.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
MSC2965: OIDC Authentication | ||
"org.matrix.msc2965.authentication": { | ||
"issuer": "https://example.com/", | ||
"account": "https://example.com/account" | ||
} | ||
*/ | ||
|
||
@interface MXWellKnownAuthentication : MXJSONModel<NSCoding> | ||
|
||
@property (nonatomic, readonly) NSString *issuer; | ||
@property (nonatomic, readonly, nullable) NSString *account; | ||
|
||
-(NSURL * _Nullable) getLogoutDeviceURLFromID: (NSString * ) deviceID; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
82 changes: 82 additions & 0 deletions
82
MatrixSDK/JSONModels/AutoDiscovery/MXWellKnownAuthentication.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// | ||
// Copyright 2023 The Matrix.org Foundation C.I.C | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
#import "MXWellKnownAuthentication.h" | ||
|
||
static NSString *const kMXIssuer = @"issuer"; | ||
static NSString *const kMXAccount = @"account"; | ||
|
||
@interface MXWellKnownAuthentication () | ||
|
||
@property (nonatomic, readwrite) NSString *issuer; | ||
@property (nonatomic, readwrite, nullable) NSString *account; | ||
|
||
@end | ||
|
||
@implementation MXWellKnownAuthentication | ||
|
||
+ (instancetype)modelFromJSON:(NSDictionary *)JSONDictionary | ||
{ | ||
MXWellKnownAuthentication *wellKnownAuthentication; | ||
|
||
NSString *issuer; | ||
MXJSONModelSetString(issuer, JSONDictionary[kMXIssuer]); | ||
|
||
if (issuer) | ||
{ | ||
wellKnownAuthentication = [[MXWellKnownAuthentication alloc] init]; | ||
wellKnownAuthentication.issuer = issuer; | ||
MXJSONModelSetString(wellKnownAuthentication.account, JSONDictionary[kMXAccount]) | ||
} | ||
|
||
return wellKnownAuthentication; | ||
} | ||
|
||
-(NSURL * _Nullable) getLogoutDeviceURLFromID: (NSString * ) deviceID | ||
{ | ||
if (!_account) | ||
{ | ||
return nil; | ||
} | ||
NSURLComponents *components = [NSURLComponents componentsWithString:_account]; | ||
components.queryItems = @[ | ||
[NSURLQueryItem queryItemWithName:@"device_id" value:deviceID], | ||
[NSURLQueryItem queryItemWithName:@"action" value:@"session_end"] | ||
]; | ||
return components.URL; | ||
} | ||
|
||
|
||
#pragma mark - NSCoding | ||
|
||
- (id)initWithCoder:(NSCoder *)aDecoder | ||
{ | ||
self = [super init]; | ||
if (self) | ||
{ | ||
_issuer = [aDecoder decodeObjectForKey:kMXIssuer]; | ||
_account = [aDecoder decodeObjectForKey: kMXAccount]; | ||
} | ||
return self; | ||
} | ||
|
||
- (void)encodeWithCoder:(NSCoder *)aCoder | ||
{ | ||
[aCoder encodeObject:_issuer forKey:kMXIssuer]; | ||
[aCoder encodeObject:_account forKey:kMXAccount]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters