I have been using ICX-Assets to sync my assets to my custom asset canister (not default rust one) and have been stuck trying to get ‘/index.html’ to also be certified as ‘/’. As far as i can tell this happens when ‘enable_aliasing’ is true? but i am unsure how to do this with ICX-Asset CLI
The error i get is that the path for the asset doesnt match the cert
Response verification failed: The exact expression path provided by the "IC-Certificate" response header (["http_expr", "index.html", "<$>"]) is not valid for the request path ("http_expr<$>")
when i goto ‘/’ for ‘/index.html’
Also i looked at the Rust Implementation of syncing the assets after a canister deploy, but don’t see anything to indicate ‘/index.html’ is also ‘/’ since that works as a fallback with the default Rust container
I feel like im mistaken somewhere or something but any help would be great.
1 Like
I’m not sure what ICX-Assets is, but since you’re mentioning that you’re using a custom asset canister, I just wanted to ask: do you certify your routes with alternative paths? i.e. when uploading /index.html
, do you certify the same resource for both /
and /index.html
?
I do this in my custom implementation for Juno, and the DFX asset canister does as well. There’s also a library called ic-http-certification
that helps with building responses and certification, though I’m not sure if it handles that specifically, I guess it does or it can help set it.
Basically, when data is uploaded to the canister, it gets certified for its given route, but also for “alternative paths” (see utils here as starting point). Likewise, when serving data, the lookup checks both the absolute route and any alternative paths (here my routing logic).
Not sure if that’s what you were looking for, but I hope it helps!
1 Like
I started using Mops • Motoko Package Manager for my implementation, and it allows for the ‘aliasing’ of the files but it is manual, and i see in your code that the index.html is given alternative paths, and now looking in the rust ic-certified-assets code it does seem like there is also code around index.html and / being aliases.
So i think you are right that its the motoko library that needs to be handling this and icx-asset cli just needs to worry about the files themselves
Thanks, ill see what i can do
1 Like
@Gekctek FYI, I saw your request via mail regarding this and I am now actively looking for someone who will hopefully be able to help you.
1 Like
For context for this thread, it seems that library for Motoko that im using can handle resolution of an asset at ‘/’ to ‘/index.html’ as a fallback, but an asset stored as /index.html doesn’t seem to properly certify as ‘/’ as a fallback, along with other weird misc v2 certification issues