Open zitnik opened 7 years ago
I have some work under way that will check for these sorts of errors when invalid configuration is passed; this concerns the way in which configuration will be handled in general, not only for this particular case.
In addition, as discussed offline, it probably doesn't make sense for the same verifier to support multiple organizations, as each verifier runs on behalf of a single organization, so all references to organization names will also be removed.
If organization name passed in TransferCredential RPC is not a name of saved organization ("org1"),
dlogMap["p"]
returns nil, which causespanic: interface conversion: interface {} is nil, not string
here: https://github.com/xlab-si/emmy/blob/ee2f257ecefbcb121b9f2786a5ff9c911e9fa97d/config/config.go#L114I assume the same would happen on other functions loading configuration parameters.
I suggest checking if the organization exists, returning nil, and handling that in higher functions as well, so that the server returns a request error.
The issue can be reproduced with the demo Android app pushed here: https://github.com/zitnik/emmy-demo-android/tree/invalid-org-test