fix(server): don't publicly reveal user count (#4409)

* fix: don't reveal user count publicly

* fix: mobile and user controller

* fix: update other frontend endpoints

* fix: revert openapi change

* chore: open api

* fix: initialize

* openapi

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Jonathan Jogenfors 2023-10-11 04:37:13 +02:00 committed by GitHub
parent 09bf1c9175
commit 41befc0948
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 101 additions and 15 deletions

View file

@ -13,12 +13,15 @@ part of openapi.api;
class ServerConfigDto {
/// Returns a new [ServerConfigDto] instance.
ServerConfigDto({
required this.isInitialized,
required this.loginPageMessage,
required this.mapTileUrl,
required this.oauthButtonText,
required this.trashDays,
});
bool isInitialized;
String loginPageMessage;
String mapTileUrl;
@ -29,6 +32,7 @@ class ServerConfigDto {
@override
bool operator ==(Object other) => identical(this, other) || other is ServerConfigDto &&
other.isInitialized == isInitialized &&
other.loginPageMessage == loginPageMessage &&
other.mapTileUrl == mapTileUrl &&
other.oauthButtonText == oauthButtonText &&
@ -37,16 +41,18 @@ class ServerConfigDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(isInitialized.hashCode) +
(loginPageMessage.hashCode) +
(mapTileUrl.hashCode) +
(oauthButtonText.hashCode) +
(trashDays.hashCode);
@override
String toString() => 'ServerConfigDto[loginPageMessage=$loginPageMessage, mapTileUrl=$mapTileUrl, oauthButtonText=$oauthButtonText, trashDays=$trashDays]';
String toString() => 'ServerConfigDto[isInitialized=$isInitialized, loginPageMessage=$loginPageMessage, mapTileUrl=$mapTileUrl, oauthButtonText=$oauthButtonText, trashDays=$trashDays]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'isInitialized'] = this.isInitialized;
json[r'loginPageMessage'] = this.loginPageMessage;
json[r'mapTileUrl'] = this.mapTileUrl;
json[r'oauthButtonText'] = this.oauthButtonText;
@ -62,6 +68,7 @@ class ServerConfigDto {
final json = value.cast<String, dynamic>();
return ServerConfigDto(
isInitialized: mapValueOfType<bool>(json, r'isInitialized')!,
loginPageMessage: mapValueOfType<String>(json, r'loginPageMessage')!,
mapTileUrl: mapValueOfType<String>(json, r'mapTileUrl')!,
oauthButtonText: mapValueOfType<String>(json, r'oauthButtonText')!,
@ -113,6 +120,7 @@ class ServerConfigDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'isInitialized',
'loginPageMessage',
'mapTileUrl',
'oauthButtonText',