Add endpoint for generating adding ics key payload#1021
Add endpoint for generating adding ics key payload#1021shannonwells wants to merge 4 commits intomainfrom
Conversation
JoeCap08055
left a comment
There was a problem hiding this comment.
My only comment would be to make the optional parameter an IntentId instead of a SchemaId; this would insulate the consumer from schema evolution.
Then, the response should contain the actual schemaId resolved.
|
I think, since the new request parameter is optional, and, if implemented, the returned schemaId could be ignored by legacy requestors not supplying the optional request parameter, that this would not require a bump in the controller version, as it's fully backwards-compatible. |
getAddKeyPayload v1 controller|
@JoeCap08055 since I learned that the new ics key has to be encoded using the ICS avro schema, I put back the old endpoint the way it was and made a new one. |
| throw new NotFoundException(`MSA ID ${msaId} not found`); | ||
| } | ||
| const expiration = await this.getExpiration(); | ||
| const schemaId = await this.blockchainService.getLatestSchemaIdForIntent(this.icsKeyIntentId); |
There was a problem hiding this comment.
Shouldn't we check Redis first, so we don't need to query the chain for the latest schema every time?
I suppose we could dynamically determine the schema type & schema format from the chain and encode appropriately, but that's an added degree of complexity (though I've been thinking of doing it for a while...). A separate endpoint seems like a good solution for now. 👍🏻 |
02e3df4 to
79f197d
Compare
Purpose
Branch for adding "schemaId" to
getAddKeyPayloadv1 controller, so we can generate ICS keys to add when a Provider is whitelisted.Regenerates swagger docs so that can be used to submit the transaction.