feat(server/web): add oauth defaultStorageQuota and storageQuotaClaim (#7548)

* feat(server/web): add oauth defaultStorageQuota and storageQuotaClaim

* feat(server/web): fix format and use domain.util constants

* address some pr feedback

* simplify oauth storage quota logic

* adding tests and pr feedback

* chore: cleanup

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Sam Holton
2024-03-01 19:46:07 -05:00
committed by GitHub
parent 8b02f18e99
commit 7303fab9d9
17 changed files with 208 additions and 21 deletions

View File

@@ -13,6 +13,7 @@ Name | Type | Description | Notes
**buttonText** | **String** | |
**clientId** | **String** | |
**clientSecret** | **String** | |
**defaultStorageQuota** | **num** | |
**enabled** | **bool** | |
**issuerUrl** | **String** | |
**mobileOverrideEnabled** | **bool** | |
@@ -20,6 +21,7 @@ Name | Type | Description | Notes
**scope** | **String** | |
**signingAlgorithm** | **String** | |
**storageLabelClaim** | **String** | |
**storageQuotaClaim** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -18,6 +18,7 @@ class SystemConfigOAuthDto {
required this.buttonText,
required this.clientId,
required this.clientSecret,
required this.defaultStorageQuota,
required this.enabled,
required this.issuerUrl,
required this.mobileOverrideEnabled,
@@ -25,6 +26,7 @@ class SystemConfigOAuthDto {
required this.scope,
required this.signingAlgorithm,
required this.storageLabelClaim,
required this.storageQuotaClaim,
});
bool autoLaunch;
@@ -37,6 +39,8 @@ class SystemConfigOAuthDto {
String clientSecret;
num defaultStorageQuota;
bool enabled;
String issuerUrl;
@@ -51,6 +55,8 @@ class SystemConfigOAuthDto {
String storageLabelClaim;
String storageQuotaClaim;
@override
bool operator ==(Object other) => identical(this, other) || other is SystemConfigOAuthDto &&
other.autoLaunch == autoLaunch &&
@@ -58,13 +64,15 @@ class SystemConfigOAuthDto {
other.buttonText == buttonText &&
other.clientId == clientId &&
other.clientSecret == clientSecret &&
other.defaultStorageQuota == defaultStorageQuota &&
other.enabled == enabled &&
other.issuerUrl == issuerUrl &&
other.mobileOverrideEnabled == mobileOverrideEnabled &&
other.mobileRedirectUri == mobileRedirectUri &&
other.scope == scope &&
other.signingAlgorithm == signingAlgorithm &&
other.storageLabelClaim == storageLabelClaim;
other.storageLabelClaim == storageLabelClaim &&
other.storageQuotaClaim == storageQuotaClaim;
@override
int get hashCode =>
@@ -74,16 +82,18 @@ class SystemConfigOAuthDto {
(buttonText.hashCode) +
(clientId.hashCode) +
(clientSecret.hashCode) +
(defaultStorageQuota.hashCode) +
(enabled.hashCode) +
(issuerUrl.hashCode) +
(mobileOverrideEnabled.hashCode) +
(mobileRedirectUri.hashCode) +
(scope.hashCode) +
(signingAlgorithm.hashCode) +
(storageLabelClaim.hashCode);
(storageLabelClaim.hashCode) +
(storageQuotaClaim.hashCode);
@override
String toString() => 'SystemConfigOAuthDto[autoLaunch=$autoLaunch, autoRegister=$autoRegister, buttonText=$buttonText, clientId=$clientId, clientSecret=$clientSecret, enabled=$enabled, issuerUrl=$issuerUrl, mobileOverrideEnabled=$mobileOverrideEnabled, mobileRedirectUri=$mobileRedirectUri, scope=$scope, signingAlgorithm=$signingAlgorithm, storageLabelClaim=$storageLabelClaim]';
String toString() => 'SystemConfigOAuthDto[autoLaunch=$autoLaunch, autoRegister=$autoRegister, buttonText=$buttonText, clientId=$clientId, clientSecret=$clientSecret, defaultStorageQuota=$defaultStorageQuota, enabled=$enabled, issuerUrl=$issuerUrl, mobileOverrideEnabled=$mobileOverrideEnabled, mobileRedirectUri=$mobileRedirectUri, scope=$scope, signingAlgorithm=$signingAlgorithm, storageLabelClaim=$storageLabelClaim, storageQuotaClaim=$storageQuotaClaim]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -92,6 +102,7 @@ class SystemConfigOAuthDto {
json[r'buttonText'] = this.buttonText;
json[r'clientId'] = this.clientId;
json[r'clientSecret'] = this.clientSecret;
json[r'defaultStorageQuota'] = this.defaultStorageQuota;
json[r'enabled'] = this.enabled;
json[r'issuerUrl'] = this.issuerUrl;
json[r'mobileOverrideEnabled'] = this.mobileOverrideEnabled;
@@ -99,6 +110,7 @@ class SystemConfigOAuthDto {
json[r'scope'] = this.scope;
json[r'signingAlgorithm'] = this.signingAlgorithm;
json[r'storageLabelClaim'] = this.storageLabelClaim;
json[r'storageQuotaClaim'] = this.storageQuotaClaim;
return json;
}
@@ -115,6 +127,7 @@ class SystemConfigOAuthDto {
buttonText: mapValueOfType<String>(json, r'buttonText')!,
clientId: mapValueOfType<String>(json, r'clientId')!,
clientSecret: mapValueOfType<String>(json, r'clientSecret')!,
defaultStorageQuota: num.parse('${json[r'defaultStorageQuota']}'),
enabled: mapValueOfType<bool>(json, r'enabled')!,
issuerUrl: mapValueOfType<String>(json, r'issuerUrl')!,
mobileOverrideEnabled: mapValueOfType<bool>(json, r'mobileOverrideEnabled')!,
@@ -122,6 +135,7 @@ class SystemConfigOAuthDto {
scope: mapValueOfType<String>(json, r'scope')!,
signingAlgorithm: mapValueOfType<String>(json, r'signingAlgorithm')!,
storageLabelClaim: mapValueOfType<String>(json, r'storageLabelClaim')!,
storageQuotaClaim: mapValueOfType<String>(json, r'storageQuotaClaim')!,
);
}
return null;
@@ -174,6 +188,7 @@ class SystemConfigOAuthDto {
'buttonText',
'clientId',
'clientSecret',
'defaultStorageQuota',
'enabled',
'issuerUrl',
'mobileOverrideEnabled',
@@ -181,6 +196,7 @@ class SystemConfigOAuthDto {
'scope',
'signingAlgorithm',
'storageLabelClaim',
'storageQuotaClaim',
};
}

View File

@@ -41,6 +41,11 @@ void main() {
// TODO
});
// num defaultStorageQuota
test('to test the property `defaultStorageQuota`', () async {
// TODO
});
// bool enabled
test('to test the property `enabled`', () async {
// TODO
@@ -76,6 +81,11 @@ void main() {
// TODO
});
// String storageQuotaClaim
test('to test the property `storageQuotaClaim`', () async {
// TODO
});
});