mirror of
https://github.com/RocketChat/Rocket.Chat.git
synced 2025-12-28 06:47:25 +00:00
Merge branch 'release-8.0.0' into regression-abac-fields
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
This commit is contained in:
commit
1e382cd9b7
@ -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';
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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,
|
||||
},
|
||||
};
|
||||
|
||||
@ -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() });
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user