Merge branch 'release-8.0.0' into regression-abac-fields
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled

This commit is contained in:
Martin Schoeler 2025-12-26 11:18:07 -03:00 committed by GitHub
commit 1e382cd9b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 7 deletions

View File

@ -1,5 +1,5 @@
const { subtle } = crypto;
export const randomUUID = crypto.randomUUID.bind(crypto);
export const randomUUID = () => crypto.randomUUID();
export const getRandomValues = crypto.getRandomValues.bind(crypto);
interface IAesGcmParams extends AesGcmParams {
@ -40,7 +40,7 @@ export const decryptBuffer = <TKey extends IKey>(
params: ParamsOf<TKey>,
data: BufferSource,
): Promise<ArrayBuffer> => subtle.decrypt(params, key, data) as Promise<ArrayBuffer>;
export const deriveBits = subtle.deriveBits.bind(subtle);
export const deriveBits = (...args: Parameters<typeof subtle.deriveBits>) => subtle.deriveBits(...args);
type AesParams = {
name: 'AES-CBC' | 'AES-GCM' | 'AES-CTR';

View File

@ -345,6 +345,10 @@ class E2E extends Emitter {
}
async startClient(userId: string): Promise<void> {
if (!isSecureContext) {
throw new Error('E2E encryption can only be enabled in secure contexts (HTTPS)');
}
const span = log.span('startClient');
if (this.userId === userId) {
return;

View File

@ -128,17 +128,17 @@ export const ABACQueryKeys = {
all: ['abac'] as const,
logs: {
all: () => [...ABACQueryKeys.all, 'logs'] as const,
list: (query?: PaginatedRequest) => [...ABACQueryKeys.logs.all(), 'list', query] as const,
list: (...args: [query?: PaginatedRequest]) => [...ABACQueryKeys.logs.all(), 'list', ...args] as const,
},
roomAttributes: {
all: () => [...ABACQueryKeys.all, 'room-attributes'] as const,
list: (query?: PaginatedRequest) => [...ABACQueryKeys.roomAttributes.all(), query] as const,
list: (...args: [query?: PaginatedRequest]) => [...ABACQueryKeys.roomAttributes.all(), ...args] as const,
attribute: (attributeId: string) => [...ABACQueryKeys.roomAttributes.all(), attributeId] as const,
},
rooms: {
all: () => [...ABACQueryKeys.all, 'rooms'] as const,
list: (query?: PaginatedRequest) => [...ABACQueryKeys.rooms.all(), query] as const,
autocomplete: (query?: PaginatedRequest) => [...ABACQueryKeys.rooms.all(), 'autocomplete', query] as const,
list: (...args: [query?: PaginatedRequest]) => [...ABACQueryKeys.rooms.all(), ...args] as const,
autocomplete: (...args: [query?: PaginatedRequest]) => [...ABACQueryKeys.rooms.all(), 'autocomplete', ...args] as const,
room: (roomId: string) => [...ABACQueryKeys.rooms.all(), roomId] as const,
},
};

View File

@ -75,7 +75,7 @@ const AttributesContextualBar = ({ attributeData, onClose }: AttributesContextua
dispatchToastMessage({ type: 'error', message: error });
},
onSettled: () => {
queryClient.invalidateQueries({ queryKey: ABACQueryKeys.roomAttributes.list({}) });
queryClient.invalidateQueries({ queryKey: ABACQueryKeys.roomAttributes.list() });
},
});