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:
5
server/test/fixtures/system-config.stub.ts
vendored
5
server/test/fixtures/system-config.stub.ts
vendored
@@ -22,6 +22,11 @@ export const systemConfigStub: Record<string, SystemConfigEntity[]> = {
|
||||
{ key: SystemConfigKey.OAUTH_MOBILE_REDIRECT_URI, value: 'http://mobile-redirect' },
|
||||
{ key: SystemConfigKey.OAUTH_BUTTON_TEXT, value: 'OAuth' },
|
||||
],
|
||||
withDefaultStorageQuota: [
|
||||
{ key: SystemConfigKey.OAUTH_ENABLED, value: true },
|
||||
{ key: SystemConfigKey.OAUTH_AUTO_REGISTER, value: true },
|
||||
{ key: SystemConfigKey.OAUTH_DEFAULT_STORAGE_QUOTA, value: 1 },
|
||||
],
|
||||
libraryWatchEnabled: [{ key: SystemConfigKey.LIBRARY_WATCH_ENABLED, value: true }],
|
||||
libraryWatchDisabled: [{ key: SystemConfigKey.LIBRARY_WATCH_ENABLED, value: false }],
|
||||
};
|
||||
|
||||
14
server/test/fixtures/user.stub.ts
vendored
14
server/test/fixtures/user.stub.ts
vendored
@@ -23,6 +23,20 @@ export const userDto = {
|
||||
name: 'User with quota',
|
||||
quotaSizeInBytes: 42,
|
||||
},
|
||||
userWithDefaultStorageQuota: {
|
||||
email: 'test@immich.com',
|
||||
name: ' ',
|
||||
oauthId: 'my-auth-user-sub',
|
||||
quotaSizeInBytes: 1_073_741_824,
|
||||
storageLabel: null,
|
||||
},
|
||||
userWithStorageQuotaClaim: {
|
||||
email: 'test@immich.com',
|
||||
name: ' ',
|
||||
oauthId: 'my-auth-user-sub',
|
||||
quotaSizeInBytes: 5_368_709_120,
|
||||
storageLabel: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const userStub = {
|
||||
|
||||
Reference in New Issue
Block a user