I was looking to find a good topic for some questions for certification v2.
I’m a bit distraught that v1 is being considered to be deprecated as it is hard enough to understand. After reading CEL Compatible HTTP Request / Response Certification - Google Docs about v2 I’m even more confused. Please forgive my simpleness here, but I think I need a bit of a “dummies guide” for this. A few simple questions:
-
The certifying of headers is super strange to me. I get the examples that someone can ‘fake’ a cache control or redirect, but does that mean that I need to think at the time of asset upload(or generation) about what RESPONSE headers I’m going to send? Do I put them in a separate place? Do I need to predict my users request headers? That seems super odd…does that mean I could certify my assets to only be served if the request has a google chrome browser tag in the browser header? What would be the use case for a request validation that can be predicted?
-
I guess some specifics would be good: In this example in @nomeata 's example IC certified assets demo the page assets need to go in http_assets path and it is just a hash of the data that gets added to the Tree. Joachim did the lords work in getting juggling all the CBOR and Encoding for us for v1, but I’m kind of at a loss at where to start to modify it to get the headers in with the data as well(unless they go somewhere else and we need to return two branches of a tree).
-
It looks like there is some kind of Certification Expression syntax, but I’m not following exactly how it should work:
IC-CertificateExpression: default_certification(ValidationArgs{certification: Certification{request_certification: RequestCertification{certified_request_headers: ["host"], certified_query_parameters: ["filter"]}, response_certification: ResponseCertification{certified_response_headers: ResponseHeaderList{headers: ["Content-Type","X-Frame-Options","Content-Security-Policy","Strict-Transport-Security","Referrer-Policy","Permissions-Policy"]}}}})
Do I just dump the above out in text and it tells the service worker what headers to validate and what headers not to validate? I think I’m following the thread, but want to make sure. In this example I’d have to predict all these values ahead of time so I can put them somewhere and certify them?(see question 2…where?).
- It also looks like I have to certify that expression as well for every page? I just include that with other response headers in some kind of structure?
I’m sorry to be dense, but perhaps we can hash it all out(hey-o) and get the Motoko ic-certification library updated with this new scheme? I’m also concerned about seeing some Protobuff references and
EBMF as that concerns me that we’re going to need to bootstrap yet more base motoko libraries to support this.