serviceDomain mandatory

This commit is contained in:
Henry Hiles 2025-06-22 15:30:51 -04:00
commit 13a469ba6d
No known key found for this signature in database
5 changed files with 14 additions and 14 deletions

View file

@ -10,11 +10,11 @@ import "package:shelf_router/shelf_router.dart";
void main(List<String> argsRaw) async { void main(List<String> argsRaw) async {
final parser = ConfigParser() final parser = ConfigParser()
..addOption("socket", abbr: "s") ..addOption("socket", abbr: "s")
..addOption("serviceDomain", abbr: "d")
..addOption("port", abbr: "p", defaultsTo: "8080") ..addOption("port", abbr: "p", defaultsTo: "8080")
..addOption("address", abbr: "a", defaultsTo: "127.0.0.1") ..addOption("address", abbr: "a", defaultsTo: "127.0.0.1")
..addOption("issuer", abbr: "i", mandatory: true) ..addOption("issuer", abbr: "i", mandatory: true)
..addOption("homeserver", abbr: "u", mandatory: true) ..addOption("homeserver", abbr: "u", mandatory: true)
..addOption("serviceDomain", abbr: "d", mandatory: true)
..addOption("jwtSecretFile", abbr: "j", mandatory: true) ..addOption("jwtSecretFile", abbr: "j", mandatory: true)
..addOption("authorizeEndpoint", abbr: "e", mandatory: true); ..addOption("authorizeEndpoint", abbr: "e", mandatory: true);

View file

@ -77,7 +77,7 @@ class ApiHelper {
redirectUri, redirectUri,
headers: { headers: {
'set-cookie': 'set-cookie':
'id_token=${json.decode(await tokenRes.readAsString())["id_token"]}; Path=/; Secure; HttpOnly; SameSite=Lax', 'id_token=${json.decode(await tokenRes.readAsString())["id_token"]}; Path=/; Secure; HttpOnly; SameSite=Lax; Domain=.${ref.watch(SettingsController.provider)!.serviceDomain}',
}, },
); );
} }

View file

@ -7,7 +7,7 @@ part "settings.g.dart";
abstract class Settings with _$Settings { abstract class Settings with _$Settings {
const factory Settings({ const factory Settings({
required String? socket, required String? socket,
required String? serviceDomain, required String serviceDomain,
required String address, required String address,
required String port, required String port,
required String homeserver, required String homeserver,

View file

@ -16,7 +16,7 @@ T _$identity<T>(T value) => value;
/// @nodoc /// @nodoc
mixin _$Settings { mixin _$Settings {
String? get socket; String? get serviceDomain; String get address; String get port; String get homeserver; String get issuer; String get jwtSecretFile; String get authorizeEndpoint; String? get socket; String get serviceDomain; String get address; String get port; String get homeserver; String get issuer; String get jwtSecretFile; String get authorizeEndpoint;
/// Create a copy of Settings /// Create a copy of Settings
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false) @JsonKey(includeFromJson: false, includeToJson: false)
@ -49,7 +49,7 @@ abstract mixin class $SettingsCopyWith<$Res> {
factory $SettingsCopyWith(Settings value, $Res Function(Settings) _then) = _$SettingsCopyWithImpl; factory $SettingsCopyWith(Settings value, $Res Function(Settings) _then) = _$SettingsCopyWithImpl;
@useResult @useResult
$Res call({ $Res call({
String? socket, String? serviceDomain, String address, String port, String homeserver, String issuer, String jwtSecretFile, String authorizeEndpoint String? socket, String serviceDomain, String address, String port, String homeserver, String issuer, String jwtSecretFile, String authorizeEndpoint
}); });
@ -66,11 +66,11 @@ class _$SettingsCopyWithImpl<$Res>
/// Create a copy of Settings /// Create a copy of Settings
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? socket = freezed,Object? serviceDomain = freezed,Object? address = null,Object? port = null,Object? homeserver = null,Object? issuer = null,Object? jwtSecretFile = null,Object? authorizeEndpoint = null,}) { @pragma('vm:prefer-inline') @override $Res call({Object? socket = freezed,Object? serviceDomain = null,Object? address = null,Object? port = null,Object? homeserver = null,Object? issuer = null,Object? jwtSecretFile = null,Object? authorizeEndpoint = null,}) {
return _then(_self.copyWith( return _then(_self.copyWith(
socket: freezed == socket ? _self.socket : socket // ignore: cast_nullable_to_non_nullable socket: freezed == socket ? _self.socket : socket // ignore: cast_nullable_to_non_nullable
as String?,serviceDomain: freezed == serviceDomain ? _self.serviceDomain : serviceDomain // ignore: cast_nullable_to_non_nullable as String?,serviceDomain: null == serviceDomain ? _self.serviceDomain : serviceDomain // ignore: cast_nullable_to_non_nullable
as String?,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable as String,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as String,port: null == port ? _self.port : port // ignore: cast_nullable_to_non_nullable as String,port: null == port ? _self.port : port // ignore: cast_nullable_to_non_nullable
as String,homeserver: null == homeserver ? _self.homeserver : homeserver // ignore: cast_nullable_to_non_nullable as String,homeserver: null == homeserver ? _self.homeserver : homeserver // ignore: cast_nullable_to_non_nullable
as String,issuer: null == issuer ? _self.issuer : issuer // ignore: cast_nullable_to_non_nullable as String,issuer: null == issuer ? _self.issuer : issuer // ignore: cast_nullable_to_non_nullable
@ -91,7 +91,7 @@ class _Settings implements Settings {
factory _Settings.fromJson(Map<String, dynamic> json) => _$SettingsFromJson(json); factory _Settings.fromJson(Map<String, dynamic> json) => _$SettingsFromJson(json);
@override final String? socket; @override final String? socket;
@override final String? serviceDomain; @override final String serviceDomain;
@override final String address; @override final String address;
@override final String port; @override final String port;
@override final String homeserver; @override final String homeserver;
@ -132,7 +132,7 @@ abstract mixin class _$SettingsCopyWith<$Res> implements $SettingsCopyWith<$Res>
factory _$SettingsCopyWith(_Settings value, $Res Function(_Settings) _then) = __$SettingsCopyWithImpl; factory _$SettingsCopyWith(_Settings value, $Res Function(_Settings) _then) = __$SettingsCopyWithImpl;
@override @useResult @override @useResult
$Res call({ $Res call({
String? socket, String? serviceDomain, String address, String port, String homeserver, String issuer, String jwtSecretFile, String authorizeEndpoint String? socket, String serviceDomain, String address, String port, String homeserver, String issuer, String jwtSecretFile, String authorizeEndpoint
}); });
@ -149,11 +149,11 @@ class __$SettingsCopyWithImpl<$Res>
/// Create a copy of Settings /// Create a copy of Settings
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? socket = freezed,Object? serviceDomain = freezed,Object? address = null,Object? port = null,Object? homeserver = null,Object? issuer = null,Object? jwtSecretFile = null,Object? authorizeEndpoint = null,}) { @override @pragma('vm:prefer-inline') $Res call({Object? socket = freezed,Object? serviceDomain = null,Object? address = null,Object? port = null,Object? homeserver = null,Object? issuer = null,Object? jwtSecretFile = null,Object? authorizeEndpoint = null,}) {
return _then(_Settings( return _then(_Settings(
socket: freezed == socket ? _self.socket : socket // ignore: cast_nullable_to_non_nullable socket: freezed == socket ? _self.socket : socket // ignore: cast_nullable_to_non_nullable
as String?,serviceDomain: freezed == serviceDomain ? _self.serviceDomain : serviceDomain // ignore: cast_nullable_to_non_nullable as String?,serviceDomain: null == serviceDomain ? _self.serviceDomain : serviceDomain // ignore: cast_nullable_to_non_nullable
as String?,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable as String,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as String,port: null == port ? _self.port : port // ignore: cast_nullable_to_non_nullable as String,port: null == port ? _self.port : port // ignore: cast_nullable_to_non_nullable
as String,homeserver: null == homeserver ? _self.homeserver : homeserver // ignore: cast_nullable_to_non_nullable as String,homeserver: null == homeserver ? _self.homeserver : homeserver // ignore: cast_nullable_to_non_nullable
as String,issuer: null == issuer ? _self.issuer : issuer // ignore: cast_nullable_to_non_nullable as String,issuer: null == issuer ? _self.issuer : issuer // ignore: cast_nullable_to_non_nullable

View file

@ -8,7 +8,7 @@ part of 'settings.dart';
_Settings _$SettingsFromJson(Map<String, dynamic> json) => _Settings( _Settings _$SettingsFromJson(Map<String, dynamic> json) => _Settings(
socket: json['socket'] as String?, socket: json['socket'] as String?,
serviceDomain: json['serviceDomain'] as String?, serviceDomain: json['serviceDomain'] as String,
address: json['address'] as String, address: json['address'] as String,
port: json['port'] as String, port: json['port'] as String,
homeserver: json['homeserver'] as String, homeserver: json['homeserver'] as String,