Skip to content

Commit

Permalink
fix: auto accept for acapy
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Mar 13, 2022
1 parent b697371 commit d81ae2f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
4 changes: 3 additions & 1 deletion aries-backchannels/acapy/acapy_backchannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def get_agent_args(self):
("--label", self.label),
# "--auto-ping-connection",
# "--auto-accept-invites",
# "--auto-accept-requests",
"--auto-accept-requests",
# "--auto-respond-messages",
# "--auto-respond-credential-proposal",
# "--auto-respond-credential-offer",
Expand All @@ -231,6 +231,8 @@ def get_agent_args(self):
("--wallet-type", self.wallet_type),
("--wallet-name", self.wallet_name),
("--wallet-key", self.wallet_key),
"--open-mediation",
"--enable-undelivered-queue"
]

# Backchannel needs to handle operations that may be called in the protocol by the tests
Expand Down
15 changes: 2 additions & 13 deletions aries-backchannels/acapy/routes/mediation_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,12 @@ async def mediation_send_grant(request: web.Request):
connection_id: str = body.get("id")
backchannel: "AcaPyAgentBackchannel" = request["backchannel"]

# This seems to need a sleep to work
sleep(2)

mediation_record = await get_mediation_record_by_connection_id(
backchannel, connection_id
)
mediation_id = mediation_record["mediation_id"]

(resp_status, resp_text) = await backchannel.admin_POST(
f"/mediation/requests/{mediation_id}/grant", {}
)

if resp_status != 201:
return web.Response(text=resp_text, status=resp_status)

resp_json = json.loads(resp_text)
return web.json_response(mediation_record_to_response(resp_json))
# Auto accept is enabled, so we're not granting the mediation explicitly
return web.json_response(mediation_record_to_response(mediation_record))


@routes.post("/agent/command/mediation/send-deny/")
Expand Down
17 changes: 11 additions & 6 deletions aries-test-harness/features/0211-coordinate-mediation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Feature: RFC 0211 Aries Agent Mediator Coordination
| connection |
| didexchange |

@RFC0160
@RFC0160 @AIP10
Examples: 0160 connection
| connection |
| 0160 |
Expand All @@ -44,7 +44,7 @@ Feature: RFC 0211 Aries Agent Mediator Coordination
| connection |
| didexchange |

@RFC0160
@RFC0160 @AIP10
Examples: 0160 connection
| connection |
| 0160 |
Expand All @@ -65,7 +65,7 @@ Feature: RFC 0211 Aries Agent Mediator Coordination
| connection |
| didexchange |

@RFC0160
@RFC0160 @AIP10
Examples: 0160 connection
| connection |
| 0160 |
Expand Down Expand Up @@ -97,24 +97,29 @@ Feature: RFC 0211 Aries Agent Mediator Coordination
And "Faber" uses "Acme" as a mediator
And "Faber" and "Bob" create a new connection

@Transport_Http @Transport_Ws @Transport_NoInbound @normal @DIDExchangeConnection
Examples: Creating a DIDExchange connection using a mediator without having inbound transports
| acme-inbound-transports | acme-outbound-transports | bob-inbound-transports | bob-outbound-transports | faber-inbound-transports | faber-outbound-transports |
| [] | ["ws", "http"] | ["ws", "http"] | ["ws", "http"] | [] | ["ws", "http"] |

@Transport_Http @Transport_Ws @Transport_NoInbound @normal @DIDExchangeConnection
Examples: Creating a DIDExchange connection using a mediator without having inbound transports
| acme-inbound-transports | acme-outbound-transports | bob-inbound-transports | bob-outbound-transports | faber-inbound-transports | faber-outbound-transports |
| ["ws", "http"] | ["ws", "http"] | [] | ["ws", "http"] | [] | ["ws", "http"] |

# Not all agents support being started without inbound transports.
@Transport_Http @Transport_Ws @critical @DIDExchangeConnection
@Transport_Http @Transport_Ws @critical @DIDExchangeConnection
Examples: Creating a DIDExchange connection using a mediator with overlapping transports
| acme-inbound-transports | acme-outbound-transports | bob-inbound-transports | bob-outbound-transports | faber-inbound-transports | faber-outbound-transports |
| ["http", "ws"] | ["http", "ws"] | ["http", "ws"] | ["http", "ws"] | ["http", "ws"] | ["http", "ws"] |

@Transport_Http @Transport_Ws @Transport_NoInbound @normal @RFC0160
@Transport_Http @Transport_Ws @Transport_NoInbound @normal @RFC0160 @AIP10
Examples: Creating a 0160 connection using a mediator without having inbound transports
| acme-inbound-transports | acme-outbound-transports | bob-inbound-transports | bob-outbound-transports | faber-inbound-transports | faber-outbound-transports |
| ["ws", "http"] | ["ws", "http"] | [] | ["ws", "http"] | [] | ["ws", "http"] |

# Not all agents support being started without inbound transports.
@Transport_Http @Transport_Ws @critical @RFC0160
@Transport_Http @Transport_Ws @critical @RFC0160 @AIP10
Examples: Creating a 0160 connection using a mediator with overlapping transports
| acme-inbound-transports | acme-outbound-transports | bob-inbound-transports | bob-outbound-transports | faber-inbound-transports | faber-outbound-transports |
| ["http", "ws"] | ["http", "ws"] | ["http", "ws"] | ["http", "ws"] | ["http", "ws"] | ["http", "ws"] |

0 comments on commit d81ae2f

Please sign in to comment.