TF-571 Check OIDC is available
This commit is contained in:
@@ -71,4 +71,9 @@ export 'upload/upload_response.dart';
|
||||
export 'autocomplete/auto_complete_pattern.dart';
|
||||
|
||||
// Identity
|
||||
export 'identity/identity_request_dto.dart';
|
||||
export 'identity/identity_request_dto.dart';
|
||||
|
||||
// OIDC
|
||||
export 'oidc/response/oidc_response.dart';
|
||||
export 'oidc/response/oidc_link_dto.dart';
|
||||
export 'oidc/request/oidc_request.dart';
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
class UriConverter implements JsonConverter<Uri, String> {
|
||||
const UriConverter();
|
||||
|
||||
@override
|
||||
Uri fromJson(String json) => Uri.parse(json);
|
||||
|
||||
@override
|
||||
String toJson(Uri uri) => uri.path;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class OIDCRequest with EquatableMixin {
|
||||
|
||||
final String baseUrl;
|
||||
final String resourceUrl = 'https://gateway.upn.integration-open-paas.org';
|
||||
final String relUrl = 'http://openid.net/specs/connect/1.0/issuer';
|
||||
|
||||
OIDCRequest({required this.baseUrl});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [baseUrl, resourceUrl, relUrl];
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:model/oidc/converter/uri_converter.dart';
|
||||
|
||||
part 'oidc_link_dto.g.dart';
|
||||
|
||||
@UriConverter()
|
||||
@JsonSerializable()
|
||||
class OIDCLinkDto with EquatableMixin {
|
||||
|
||||
final Uri rel;
|
||||
final Uri href;
|
||||
|
||||
OIDCLinkDto(this.rel, this.href);
|
||||
|
||||
factory OIDCLinkDto.fromJson(Map<String, dynamic> json) => _$OIDCLinkDtoFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$OIDCLinkDtoToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [rel, href];
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:model/oidc/converter/uri_converter.dart';
|
||||
import 'package:model/oidc/response/oidc_link_dto.dart';
|
||||
|
||||
part 'oidc_response.g.dart';
|
||||
|
||||
@UriConverter()
|
||||
@JsonSerializable()
|
||||
class OIDCResponse with EquatableMixin {
|
||||
|
||||
final String subject;
|
||||
final List<OIDCLinkDto> links;
|
||||
|
||||
OIDCResponse(this.subject, this.links);
|
||||
|
||||
factory OIDCResponse.fromJson(Map<String, dynamic> json) => _$OIDCResponseFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$OIDCResponseToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [subject, links];
|
||||
}
|
||||
Reference in New Issue
Block a user