Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow canister http outcalls to specify transform of another canister #345

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions spec/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2485,7 +2485,7 @@ The following parameters should be supplied for the call:

- `body` - optional, the content of the request's body

- `transform` - an optional record that includes a function that transforms raw responses to sanitized responses, and a byte-encoded context that is provided to the function upon invocation, along with the response to be sanitized. If provided, the calling canister itself must export this function.
- `transform` - an optional record that includes a function that transforms raw responses to sanitized responses, and a byte-encoded context that is provided to the function upon invocation, along with the response to be sanitized. If provided, the transform function must be exposed by a canister on the same subnet as the calling canister.

Cycles to pay for the call must be explicitly transferred with the call, i.e., they are not automatically deducted from the caller's balance implicitly (e.g., as for inter-canister calls).

Expand All @@ -2499,7 +2499,7 @@ The returned response (and the response provided to the `transform` function, if

The `transform` function may, for example, transform the body in any way, add or remove headers, modify headers, etc. The maximal number of bytes representing the response produced by the `transform` function is `2MB` (`2,000,000B`). Note that the number of bytes representing the response produced by the `transform` function includes the serialization overhead of the encoding produced by the canister.

When the transform function is invoked by the system due to a canister HTTP request, the caller's identity is the principal of the management canister. This information can be used by developers to implement access control mechanism for this function.
When the transform function is invoked by the system due to a canister HTTP request, the caller's identity is the principal of the management canister if the canister making the canister HTTP request is the same as the canister exposing the transform function, otherwise the caller's identity is the principal of the canister making the canister HTTP request. This information can be used by developers to implement access control mechanism for this function.

The following additional limits apply to HTTP requests and HTTP responses from the remote sever:

Expand Down
Loading