We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ENDPOINT {{homeserver}}.well-known/matrix/client
{{homeserver}}.well-known/matrix/client
Response
{ ... "m.federated_identity_services": { "base_urls": [ "https://fed...com/" ] }, ... }
@JsonSerializable() class FedServerInformation with EquatableMixin { static const String fedServerKey = 'm.federated_identity_services'; @JsonKey(name: 'base_url') final Uri? baseUrl; @JsonKey(name: 'server_name') final String? serverName; FedServerInformation({ this.baseUrl, this.serverName, }); factory FedServerInformation.fromJson(Map<String, dynamic> json) => _$FedServerInformationFromJson(json); Map<String, dynamic> toJson() => _$FedServerInformationToJson(this); @override List<Object?> get props => [baseUrl, serverName]; }
FedConfigurations
class FedConfigurations with EquatableMixin { final FedServerInformation fedServerInformation; final IdentityServerInformation? identityServerInformation; final String? authUrl; final LoginType? loginType; FedConfigurations({ required this.tomServerInformation, this.identityServerInformation, this.authUrl, this.loginType, }); @override List<Object?> get props => [fedServerInformation, identityServerInformation, authUrl, loginType]; }
.well-know
FedServerInformation
HomeserverSummaryExtensions
lib/domain/model/extensions/homeserver_summary_extensions.dart
FedServerInformation? get fedServer { if (discoveryInformation?.additionalProperties == null) { return null; } final fedServerJson = discoveryInformation ?.additionalProperties[FedServerInformation.fedServerKey]; if (fedServerJson == null) { return null; } try { return FedServerInformation.fromJson(fedServerJson); } catch (e) { Logs().e('Failed to parse m.federated_identity_services from homeserver summary', e); return null; } }
FedConfigurationsRepository
abstract class FedConfigurationsRepository { Future<FedConfigurations> getFedConfigurations(String userId); Future<void> saveFedConfigurations( String userId, FedConfigurations fedConfigurations, ); Future<void> deleteFedConfigurations(String userId); }
NetworkDI
class NetworkDI extends BaseDI { static const fedServerUrlInterceptorName = 'fedServerDynamicUrlInterceptor'; static const fedServerDioName = 'fedServerDioName'; static const fedDioClientName = 'fedServerDioClientName'; void _bindInterceptor(GetIt get) { get.registerLazySingleton( () => DynamicUrlInterceptors(), instanceName: fedServerUrlInterceptorName, ); } void _bindDio(GetIt get) { _bindDioForFedServer(get); } void _bindDioForFedServer(GetIt Get) {} }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
How to extract Fed server in well-know
ENDPOINT
{{homeserver}}.well-known/matrix/client
Response
Create Fed server info:
Create
FedConfigurations
Convert response from
.well-know
toFedServerInformation
HomeserverSummaryExtensions
:lib/domain/model/extensions/homeserver_summary_extensions.dart
Create
FedConfigurationsRepository
Create new Fed dio in
NetworkDI
The text was updated successfully, but these errors were encountered: