dfinity / agent-js

A collection of libraries and tools for building software around the Internet Computer, in JavaScript.
https://agent-js.icp.xyz
Apache License 2.0
155 stars 96 forks source link

chore: skip range check when the certificate comes from the management canister #945

Closed dfx-json closed 1 month ago

dfx-json commented 1 month ago

Resolves SDKTG-403 and a regression in the NNS dapp in versions of agent > 2.0.0

github-actions[bot] commented 1 month ago

size-limit report 📦

Path Size
@dfinity/agent 86.79 KB (+0.9% 🔺)
@dfinity/candid 13.58 KB (0%)
@dfinity/principal 4.97 KB (0%)
@dfinity/auth-client 61.04 KB (+1.14% 🔺)
@dfinity/assets 81.67 KB (+0.59% 🔺)
@dfinity/identity 58.17 KB (+1.05% 🔺)
@dfinity/identity-secp256k1 131.39 KB (+0.06% 🔺)
krpeacock commented 1 month ago

I think this is safe to add. We were overriding this check with a custom transformation for our getManagementCanister utility anyway, and this will make the tools more reliable for downstream features

krpeacock commented 1 month ago

@dfx-json did you try this with any live code? Do we know that @dfinity/ic-management was passing the correct vs the effective-canister-id, such that this check would match against aaaaa-aa?

krpeacock commented 1 month ago

image

Tested using @dfinity/ic-management - I can still reproduce the error with these changes

https://github.com/krpeacock/ic-management-bug-repro