Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infer issuer canisterId from origin on localhost #2364

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

frederikrothenberger
Copy link
Member

@frederikrothenberger frederikrothenberger commented Mar 14, 2024

For issuers hosted on localhost (using the a canister id as a subdomain) II will no longer make a network request to get the canister ID during the attribute sharing flow. Instead, the canister id will be parsed from the origin directly.

This change makes it possible to integrate issuers with II in a local dev setup if canisterId subdomain
of localhost is used as the issuer (derivation) origin.


🟡 Some screens were changed

For issuers hosted on `localhost` (using the a canister id as a subdomain)
II will no longer make a network request to get the canister ID during
the attribute sharing flow. Instead, the canister id will be parsed from
the origin directly.

This change makes it possible to integrate issuers with
II in a local dev setup if canisterId subdomain
of `localhost` is used as the issuer (derivation) origin.
@@ -334,28 +365,28 @@ const getValidatedIssuerDerivationOrigin = async ({
}
| { kind: "ok"; origin: string }
> => {
const result = await vcIssuer.getDerivationOrigin({ origin: issuerOrigin });
const derivationOriginResult = await vcIssuer.getDerivationOrigin({
Copy link
Member Author

Choose a reason for hiding this comment

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

I took the liberty of renaming a few variables in this function because I think it makes following the logic a bit easier.

Copy link
Collaborator

@przydatek przydatek left a comment

Choose a reason for hiding this comment

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

LGTM for the logic, thanks!
(I suppose @lmuntaner will take a look also on TS-changes)

Copy link
Contributor

@lmuntaner lmuntaner left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@frederikrothenberger frederikrothenberger added this pull request to the merge queue Mar 15, 2024
Merged via the queue into main with commit 8443a79 Mar 15, 2024
63 checks passed
@frederikrothenberger frederikrothenberger deleted the frederik/simplify-issuer-resolution branch March 15, 2024 08:13
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.

None yet

3 participants