fix!: do not allow insecure oauth requests by default (#27844)

* fix!: do not allow insecure oauth requests by default

* fix: format

* fix: make open-api

* fix: tests

* nit: casing

* chore: migration to allow insecure if current oauth uses http
This commit is contained in:
bo0tzz 2026-04-16 16:11:58 +02:00 committed by GitHub
parent 9c642bd6fc
commit 3356e81c85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 77 additions and 3 deletions

View file

@ -13,6 +13,7 @@ part of openapi.api;
class SystemConfigOAuthDto {
/// Returns a new [SystemConfigOAuthDto] instance.
SystemConfigOAuthDto({
required this.allowInsecureRequests,
required this.autoLaunch,
required this.autoRegister,
required this.buttonText,
@ -33,6 +34,9 @@ class SystemConfigOAuthDto {
required this.tokenEndpointAuthMethod,
});
/// Allow insecure requests
bool allowInsecureRequests;
/// Auto launch
bool autoLaunch;
@ -93,6 +97,7 @@ class SystemConfigOAuthDto {
@override
bool operator ==(Object other) => identical(this, other) || other is SystemConfigOAuthDto &&
other.allowInsecureRequests == allowInsecureRequests &&
other.autoLaunch == autoLaunch &&
other.autoRegister == autoRegister &&
other.buttonText == buttonText &&
@ -115,6 +120,7 @@ class SystemConfigOAuthDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(allowInsecureRequests.hashCode) +
(autoLaunch.hashCode) +
(autoRegister.hashCode) +
(buttonText.hashCode) +
@ -135,10 +141,11 @@ class SystemConfigOAuthDto {
(tokenEndpointAuthMethod.hashCode);
@override
String toString() => 'SystemConfigOAuthDto[autoLaunch=$autoLaunch, autoRegister=$autoRegister, buttonText=$buttonText, clientId=$clientId, clientSecret=$clientSecret, defaultStorageQuota=$defaultStorageQuota, enabled=$enabled, issuerUrl=$issuerUrl, mobileOverrideEnabled=$mobileOverrideEnabled, mobileRedirectUri=$mobileRedirectUri, profileSigningAlgorithm=$profileSigningAlgorithm, roleClaim=$roleClaim, scope=$scope, signingAlgorithm=$signingAlgorithm, storageLabelClaim=$storageLabelClaim, storageQuotaClaim=$storageQuotaClaim, timeout=$timeout, tokenEndpointAuthMethod=$tokenEndpointAuthMethod]';
String toString() => 'SystemConfigOAuthDto[allowInsecureRequests=$allowInsecureRequests, autoLaunch=$autoLaunch, autoRegister=$autoRegister, buttonText=$buttonText, clientId=$clientId, clientSecret=$clientSecret, defaultStorageQuota=$defaultStorageQuota, enabled=$enabled, issuerUrl=$issuerUrl, mobileOverrideEnabled=$mobileOverrideEnabled, mobileRedirectUri=$mobileRedirectUri, profileSigningAlgorithm=$profileSigningAlgorithm, roleClaim=$roleClaim, scope=$scope, signingAlgorithm=$signingAlgorithm, storageLabelClaim=$storageLabelClaim, storageQuotaClaim=$storageQuotaClaim, timeout=$timeout, tokenEndpointAuthMethod=$tokenEndpointAuthMethod]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'allowInsecureRequests'] = this.allowInsecureRequests;
json[r'autoLaunch'] = this.autoLaunch;
json[r'autoRegister'] = this.autoRegister;
json[r'buttonText'] = this.buttonText;
@ -173,6 +180,7 @@ class SystemConfigOAuthDto {
final json = value.cast<String, dynamic>();
return SystemConfigOAuthDto(
allowInsecureRequests: mapValueOfType<bool>(json, r'allowInsecureRequests')!,
autoLaunch: mapValueOfType<bool>(json, r'autoLaunch')!,
autoRegister: mapValueOfType<bool>(json, r'autoRegister')!,
buttonText: mapValueOfType<String>(json, r'buttonText')!,
@ -240,6 +248,7 @@ class SystemConfigOAuthDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'allowInsecureRequests',
'autoLaunch',
'autoRegister',
'buttonText',