TF-571 Check OIDC is available

This commit is contained in:
dab246
2022-05-20 12:38:31 +07:00
committed by Dat H. Pham
parent c5aa9f7d69
commit 239234f836
29 changed files with 625 additions and 55 deletions
+2 -2
View File
@@ -77,7 +77,6 @@ export 'data/constants/constant.dart';
// Network
export 'data/network/config/authorization_interceptors.dart';
export 'data/network/config/dynamic_url_interceptors.dart';
export 'data/network/config/endpoint.dart';
export 'data/network/config/service_path.dart';
export 'data/network/dio_client.dart';
export 'data/network/download/download_client.dart';
@@ -95,4 +94,5 @@ export 'data/local/database_client.dart';
export 'data/local/database_manager.dart';
// Model
export 'data/model/data_source_type.dart';
export 'data/model/source_type/data_source_type.dart';
export 'data/model/query/query_parameter.dart';
@@ -0,0 +1,19 @@
abstract class QueryParameter<T> {
final String queryName;
final T queryValue;
QueryParameter(this.queryName, this.queryValue);
}
class BooleanQueryParameter extends QueryParameter<bool> {
BooleanQueryParameter(String queryName, bool queryValue) : super(queryName, queryValue);
}
class StringQueryParameter extends QueryParameter<String> {
StringQueryParameter(String queryName, String queryValue) : super(queryName, queryValue);
}
class IntQueryParameter extends QueryParameter<int> {
IntQueryParameter(String queryName, int queryValue) : super(queryName, queryValue);
}
@@ -1,5 +0,0 @@
import 'package:core/data/network/config/service_path.dart';
class Endpoint {
static final ServicePath authentication = ServicePath('/api/login');
}
+1 -14
View File
@@ -1,19 +1,6 @@
class ServicePath {
final String path;
ServicePath(this.path);
}
extension ServicePathExtension on ServicePath {
String generateEndpointPath() {
return '$path';
}
String generateAuthenticationUrl(Uri? baseUrl) {
if (baseUrl == null) {
return generateEndpointPath();
} else {
return baseUrl.origin + generateEndpointPath();
}
}
}
@@ -5,13 +5,16 @@ extension URLExtension on String {
static final String prefixUrlHttp = 'http://';
String formatURLValid() {
if (startsWith(prefixUrlHttps)) {
return this;
} else if (startsWith(prefixUrlHttp)) {
return kReleaseMode ? replaceAll(prefixUrlHttp, prefixUrlHttps) : this;
} else {
return '$prefixUrlHttps${this}';
if (isNotEmpty) {
if (startsWith(prefixUrlHttps)) {
return this;
} else if (startsWith(prefixUrlHttp)) {
return kReleaseMode ? replaceAll(prefixUrlHttp, prefixUrlHttps) : this;
} else {
return '$prefixUrlHttps${this}';
}
}
return '';
}
String removePrefix() {