-
Notifications
You must be signed in to change notification settings - Fork 96
feat!: set canister env in cookies for html files #4387
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viviveevee
reviewed
Sep 24, 2025
src/canisters/frontend/ic-certified-assets/src/state_machine/mod.rs
Outdated
Show resolved
Hide resolved
Additionally, fixes tests
3 tasks
Member
Author
|
After merging #4392, we should be able to fix tests here |
viviveevee
reviewed
Sep 26, 2025
Contributor
viviveevee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a test that shows that PUBLIC_ env vars are added to the cookie?
Member
Author
Adding them in a follow-up PR |
viviveevee
approved these changes
Sep 26, 2025
ilbertt
added a commit
that referenced
this pull request
Sep 26, 2025
After #4387, some methods already have two parameters (time and canister env) that can be condensed into a "system context". Using a system context simplifies the tests as well. This PR introduces the `system_context` module and refactors the state methods to accept is as the last argument. --------- Co-authored-by: Vivienne Siffert <[email protected]>
This was referenced Sep 26, 2025
ilbertt
added a commit
that referenced
this pull request
Oct 2, 2025
This was referenced Oct 5, 2025
ilbertt
added a commit
to dfinity/icp-cli
that referenced
this pull request
Oct 9, 2025
dfinity/sdk#4387 enables asset canisters to serve the canister environment variables prefixed with `PUBLIC_` in the `ic_env` cookie. Additionally, switches the frontend-environment-variables asset canister to the one hosted on GitHub, which supports the `ic_env` cookie. Additionally, aligns the doc comments to the latest pushes on dfinity/icp-js-core#1156.
ilbertt
added a commit
to dfinity/icp-js-core
that referenced
this pull request
Oct 22, 2025
…#1156) Introduces the `getCanisterEnv` and `safeGetCanisterEnv` functions to load the canister environment from the `ic_env` cookie. This is an _experimental_ feature. Additionally, adds the `@types/jsdom` package to the dev dependencies to avoid typescript errors. Related: dfinity/sdk#4387.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Returns the
ic_envcookie for all the html files. The cookie includes the root key and all the canister environment variables prefixed withPUBLIC_.How Has This Been Tested?
Tests will be added in a follow-up PR.
Checklist: