Don't accept PNI as ACI in contact sync

This commit is contained in:
Fedor Indutny 2023-09-28 20:41:45 +02:00 committed by GitHub
parent da113c1fa1
commit ca45a9cf74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 26 deletions

View file

@ -5,6 +5,7 @@ import type { AciString } from '../types/ServiceId';
import type { LoggerType } from '../types/Logging';
import * as log from '../logging/log';
import { isAciString } from './isAciString';
import { strictAssert } from './assert';
export function normalizeAci(
rawAci: string,
@ -28,6 +29,7 @@ export function normalizeAci(
}
const result = rawAci.toLowerCase();
strictAssert(!result.startsWith('pni:'), 'ACI should not start with PNI:');
if (!isAciString(result)) {
logger.warn(