Skip to content

Add endpoint for generating adding ics key payload#1021

Draft
shannonwells wants to merge 4 commits intomainfrom
feat/support-other-schemas-for-adding-public-key-agreement
Draft

Add endpoint for generating adding ics key payload#1021
shannonwells wants to merge 4 commits intomainfrom
feat/support-other-schemas-for-adding-public-key-agreement

Conversation

@shannonwells
Copy link
Contributor

@shannonwells shannonwells commented Feb 23, 2026

Purpose

Branch for adding "schemaId" to getAddKeyPayload v1 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.

  • install ics-sdk latest release (updated)
  • update docker files to make sure it's working with docker containers
  • endpoint
  • tests for same

Copy link
Contributor

@JoeCap08055 JoeCap08055 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@JoeCap08055
Copy link
Contributor

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.

@shannonwells shannonwells changed the title add schema id to getAddKeyPayload v1 controller Add endpoint for generating adding ics key payload Mar 6, 2026
@shannonwells
Copy link
Contributor Author

@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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we check Redis first, so we don't need to query the chain for the latest schema every time?

@JoeCap08055
Copy link
Contributor

JoeCap08055 commented Mar 10, 2026

@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.

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. 👍🏻

@shannonwells shannonwells force-pushed the feat/support-other-schemas-for-adding-public-key-agreement branch from 02e3df4 to 79f197d Compare March 11, 2026 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants