Add downstream_compliance_region hostcall#403
Conversation
df89966 to
5732ccb
Compare
5732ccb to
9ab65ba
Compare
elliottt
left a comment
There was a problem hiding this comment.
Looks good, though the max_len param should be kept if downstream_compliance_region can return an arbitrary-length vector.
| downstream-tls-ja4: func(max-len: u64) -> result<list<u8>, error>; | ||
|
|
||
| downstream-compliance-region: func(max-len: u64) -> result<list<u8>, error>; | ||
| downstream-compliance-region: func() -> result<list<u8>, error>; |
There was a problem hiding this comment.
Could you add max-len back in? It's to help with the adapter, as it's ensuring that the returned vector that will be placed in the guest-provided buffer will be large enough.
| async fn downstream_compliance_region(&mut self) -> Result<Vec<u8>, types::Error> { | ||
| Ok(Vec::from(b"none")) |
There was a problem hiding this comment.
Could you also add a check here that max_len >= 4?
|
Can we find a place to keep track of hardcoded values like this, so that as part of the discussion about making development and testing easier (the 'redesign fastly.toml' topic) we can provide ways to make these configurable in the future? "none" is certainly a valid and expected value, but customers should be able to test their code against the other values they could see in production. cc @kailan |
For now I've made this part of the |
This PR implements the
downstream_compliance_regionhostcall, which will eventually be exposed in the SDK when the Compliance Regions GA happens. I've made it so that it currently always returns"none", which is what you will see in Compute when you aren't using Compliance Regions with your service.I've also updated the signature of the component interface to be more similar to
downstream-tls-ja3-md5, since it just returns aVec<u8>and doesn't need to know themax-len. (Let me know if I'm misunderstanding how the component interfaces should work.)