openwallet-foundation / acapy

ACA-Py is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://aca-py.org
Apache License 2.0
412 stars 512 forks source link

Bug: No Error when writing Schema When Not in Endorser Role #1308

Closed wip-abramson closed 10 months ago

wip-abramson commented 3 years ago

When attempting to write a schema to the indy ledger without the appropriate role ACA-Py agent should throw error message.

Instead the schema appears to be created, including a schema_id added to list returned from "/schemas/created" endpoint.

As expected, schema is not added to ledger.

feknall commented 2 years ago

@wip-abramson, thanks for reporting! It helped me to solve my problem :)

Maybe what I have seen makes this issue a little bit clear:

First scenario: The agent doesn't have a DID which its role is Endorser. The agent can call POST /schemas, and a schema_id will be returned. Then, if the agent calls GET /schemas/created, it can see the schema_id of the schema that it just created. Therefore, it seems that the schema actually will be stored somewhere. However, if the agent call GET /schema/{schema_id} it doesn't show anything like the schema_id doesn't exist at all.

Second scenario: The agent has a DID that its role is Endorser. Everything is the same as the first scenario except the GET /schema/{schema_id} that works properly.

jamshale commented 10 months ago

I haven't been able to re-produce this. I tried by creating and registering a did with endorser role and another with user or none role. When using the endorser I can create a schema. When using the did with user role I get a 400 error.

400: Ledger request error. Request failed: client request invalid: UnauthorizedClientRequest('ULXCbVUxWT6ydSzZPS7YQ4', 1702925602425814479, 'Rule for this action is: 1 TRUSTEE signature is required OR 1 STEWARD signature is required OR 1 ENDORSER signature is required\nFailed checks:\nConstraint: 1 TRUSTEE signature is required, Error: Not enough TRUSTEE signatures\nConstraint: 1 STEWARD signature is required, Error: Not enough STEWARD signatures\nConstraint: 1 ENDORSER signature is required, Error: Not enough ENDORSER signatures').

Either I need more description about the ledger and steps to reproduce or I'm going to close as won't fix.

jamshale commented 10 months ago

Going to close. If this gets reported again or the steps to reproduce are updated we can open it back up.