mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(server): use base64 shared links (#2633)
* feat(server): use base64 shared links * fix: handle array values
This commit is contained in:
@@ -38,6 +38,11 @@ const yesterday = new Date();
|
||||
tomorrow.setDate(today.getDate() + 1);
|
||||
yesterday.setDate(yesterday.getDate() - 1);
|
||||
|
||||
const sharedLinkBytes = Buffer.from(
|
||||
'2c2b646895f84753bff43fb696ad124f3b0faf2a0bd547406f26fa4a76b5c71990092baa536275654b2ab7a191fb21a6d6cd',
|
||||
'hex',
|
||||
);
|
||||
|
||||
export const authStub = {
|
||||
admin: Object.freeze<AuthUserDto>({
|
||||
id: 'admin_id',
|
||||
@@ -662,7 +667,7 @@ export const sharedLinkStub = {
|
||||
id: '123',
|
||||
userId: authStub.admin.id,
|
||||
user: userEntityStub.admin,
|
||||
key: Buffer.from('secret-key', 'utf8'),
|
||||
key: sharedLinkBytes,
|
||||
type: SharedLinkType.ALBUM,
|
||||
createdAt: today,
|
||||
expiresAt: tomorrow,
|
||||
@@ -676,7 +681,7 @@ export const sharedLinkStub = {
|
||||
id: '123',
|
||||
userId: authStub.admin.id,
|
||||
user: userEntityStub.admin,
|
||||
key: Buffer.from('secret-key', 'utf8'),
|
||||
key: sharedLinkBytes,
|
||||
type: SharedLinkType.ALBUM,
|
||||
createdAt: today,
|
||||
expiresAt: yesterday,
|
||||
@@ -689,7 +694,7 @@ export const sharedLinkStub = {
|
||||
id: '123',
|
||||
userId: authStub.admin.id,
|
||||
user: userEntityStub.admin,
|
||||
key: Buffer.from('secret-key', 'utf8'),
|
||||
key: sharedLinkBytes,
|
||||
type: SharedLinkType.ALBUM,
|
||||
createdAt: today,
|
||||
expiresAt: tomorrow,
|
||||
@@ -786,7 +791,7 @@ export const sharedLinkResponseStub = {
|
||||
description: undefined,
|
||||
expiresAt: tomorrow,
|
||||
id: '123',
|
||||
key: '7365637265742d6b6579',
|
||||
key: sharedLinkBytes.toString('base64url'),
|
||||
showExif: true,
|
||||
type: SharedLinkType.ALBUM,
|
||||
userId: 'admin_id',
|
||||
@@ -800,7 +805,7 @@ export const sharedLinkResponseStub = {
|
||||
description: undefined,
|
||||
expiresAt: yesterday,
|
||||
id: '123',
|
||||
key: '7365637265742d6b6579',
|
||||
key: sharedLinkBytes.toString('base64url'),
|
||||
showExif: true,
|
||||
type: SharedLinkType.ALBUM,
|
||||
userId: 'admin_id',
|
||||
@@ -808,7 +813,7 @@ export const sharedLinkResponseStub = {
|
||||
readonly: Object.freeze<SharedLinkResponseDto>({
|
||||
id: '123',
|
||||
userId: 'admin_id',
|
||||
key: '7365637265742d6b6579',
|
||||
key: sharedLinkBytes.toString('base64url'),
|
||||
type: SharedLinkType.ALBUM,
|
||||
createdAt: today,
|
||||
expiresAt: tomorrow,
|
||||
@@ -822,7 +827,7 @@ export const sharedLinkResponseStub = {
|
||||
readonlyNoExif: Object.freeze<SharedLinkResponseDto>({
|
||||
id: '123',
|
||||
userId: 'admin_id',
|
||||
key: '7365637265742d6b6579',
|
||||
key: sharedLinkBytes.toString('base64url'),
|
||||
type: SharedLinkType.ALBUM,
|
||||
createdAt: today,
|
||||
expiresAt: tomorrow,
|
||||
|
||||
Reference in New Issue
Block a user