In Babylon.js, is it possible to “intercept” file loading process and redirect it to somewhere else? e.g. when we are loading a glTF file with external bin & texture files, while all the files come a data source which requires credentials (e.g. need AWS/Azure SDK to load), we need to redirect the request to the relevant SDK for credentials.
I used to work on similar solutions in three.js, these are the similar solutions:
- For lower security requirements, we can use “uriModifier” to intercept the URL request and add credentials in. Use case: in AWS S3, it can create “pre-signed” URL, which allows people to add credentials (by default, it’s valid for a short period) as parameters in URL, so in uriModifier, we can modify the URL by adding credentials.
- For higher security requirements, as we can’t put credentials in URL, while uriModifier is not async like SDKs, we can either update per-file-type handler (three.js/Loader.js at 4fa01465053d3d95e5c6e05fee701b1b217878aa · mrdoob/three.js · GitHub), or change the handling code (iot-app-kit/GLTFLoader.js at main · awslabs/iot-app-kit · GitHub).
Is there any similar solution in babylon.js?