@@ -437,25 +437,9 @@ export class DwnApi {
437
437
438
438
if ( this . delegateDid ) {
439
439
// NOTE: currently protocol configure only allows normal permission grants, not delegated grants.
440
- // However, protocol grants should be used in a delegated scenario as they modify state.
441
- // Additionally currently ProtocolConfigure does not scope to specific protocols, which it should.
442
440
// TODO: Add Delegate Grants to ProtocolConfigure https://github.com/TBD54566975/dwn-sdk-js/issues/801
443
441
// TODO: Scope Protocol Permissions to a specific protocol. https://github.com/TBD54566975/dwn-sdk-js/issues/802
444
-
445
- const { grant : { id : permissionGrantId } } = await this . permissionsApi . getPermissionForRequest ( {
446
- connectedDid : this . connectedDid ,
447
- delegateDid : this . delegateDid ,
448
- delegate : true ,
449
- cached : true ,
450
- messageType : agentRequest . messageType
451
- } ) ;
452
-
453
- agentRequest . messageParams = {
454
- ...agentRequest . messageParams ,
455
- permissionGrantId
456
- } ;
457
-
458
- agentRequest . granteeDid = this . delegateDid ;
442
+ throw new Error ( 'Delegated grants are not yet supported for protocol configuration: https://github.com/TBD54566975/dwn-sdk-js/issues/801' ) ;
459
443
}
460
444
461
445
const agentResponse = await this . agent . processDwnRequest ( agentRequest ) ;
@@ -487,12 +471,14 @@ export class DwnApi {
487
471
// If the protocol is public, the query should be successful. This allows the app to query for public protocols without having a grant.
488
472
489
473
try {
474
+ const protocolFromRequest = request . message . filter ?. protocol ;
475
+
490
476
// NOTE: Currently protocol permissions are not scoped to specific protocols.
491
477
// TODO: Scope Protocol Permissions to a specific protocol. https://github.com/TBD54566975/dwn-sdk-js/issues/802
492
-
493
478
const { grant : { id : permissionGrantId } } = await this . permissionsApi . getPermissionForRequest ( {
494
479
connectedDid : this . connectedDid ,
495
480
delegateDid : this . delegateDid ,
481
+ protocol : protocolFromRequest ,
496
482
delegate : true ,
497
483
cached : true ,
498
484
messageType : agentRequest . messageType
0 commit comments