diff --git a/lib/tdf3/src/tdf.ts b/lib/tdf3/src/tdf.ts index 4decf7a9b..9d03f20ed 100644 --- a/lib/tdf3/src/tdf.ts +++ b/lib/tdf3/src/tdf.ts @@ -726,8 +726,13 @@ export function splitLookupTableFactory( for (const kao of keyAccess) { const disjunction = splitPotentials[kao.sid ?? '']; if (kao.url in disjunction) { + // TODO(DSPX-3454): Handle duplicate KAS URLs with different KIDs. + // Each KAO contains a KID - the function should be updated to use this + // information to differentiate between keys from the same KAS. + // Cross-SDK validation needed via xtest. throw new InvalidFileError( - `TODO: Fallback to no split ids. Repetition found for [${kao.url}] on split [${kao.sid}]` + `Unable to decrypt: Multiple keys detected for Key Access Server [${kao.url}]. ` + + `Please contact your administrator.` ); } if (allowed(kao)) { diff --git a/lib/tests/mocha/unit/tdf.spec.ts b/lib/tests/mocha/unit/tdf.spec.ts index 2e476ac3b..e1642f3c5 100644 --- a/lib/tests/mocha/unit/tdf.spec.ts +++ b/lib/tests/mocha/unit/tdf.spec.ts @@ -302,7 +302,7 @@ describe('splitLookupTableFactory', () => { expect(() => TDF.splitLookupTableFactory(keyAccess, allowedKases)).to.throw( InvalidFileError, - 'TODO: Fallback to no split ids. Repetition found for [https://kas1] on split [split1]' + 'Unable to decrypt: Multiple keys detected for Key Access Server [https://kas1]. Please contact your administrator.' ); });