feat: Add environment variable support with CLI options and file loading#176
Conversation
🔍 Security Audit WarningsThe Click to view cargo audit outputThese are warnings (not vulnerabilities) but should be reviewed for:
The security job will continue to pass as these are warnings, not blocking security issues. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds environment variable support to the runtime with CLI options and file loading capabilities. It allows users to set environment variables through --env flags, load them from files using --env-file, and integrates these with the existing policy-based environment system.
Key changes:
- Added CLI options
--envfor individual variables and--env-filefor loading from files - Environment variables from CLI args take precedence over file variables, which take precedence over system variables
- Updated WASI state creation to use the provided environment variables instead of reading system environment directly
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main.rs | Adds environment variable parsing functions and CLI argument handling |
| src/config.rs | Extends Config struct and adds from_serve method for environment variable merging |
| src/env_tests.rs | Comprehensive test suite for environment variable parsing functionality |
| crates/wassette/src/lib.rs | Updates LifecycleManager to accept and store environment variables |
| crates/wassette/src/wasistate.rs | Modifies WASI state creation to use provided environment variables |
| crates/wassette/src/policy_internal.rs | Updates policy-related functions to pass environment variables |
| tests/transport_integration_test.rs | Updates test setup to provide empty environment variables |
| CHANGELOG.md | Documents the new CLI environment variable features |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
🔍 Security Audit WarningsThe Click to view cargo audit outputThese are warnings (not vulnerabilities) but should be reviewed for:
The security job will continue to pass as these are warnings, not blocking security issues. |
5c0f43f to
af99c2e
Compare
🔍 Security Audit WarningsThe Click to view cargo audit outputThese are warnings (not vulnerabilities) but should be reviewed for:
The security job will continue to pass as these are warnings, not blocking security issues. |
2 similar comments
🔍 Security Audit WarningsThe Click to view cargo audit outputThese are warnings (not vulnerabilities) but should be reviewed for:
The security job will continue to pass as these are warnings, not blocking security issues. |
🔍 Security Audit WarningsThe Click to view cargo audit outputThese are warnings (not vulnerabilities) but should be reviewed for:
The security job will continue to pass as these are warnings, not blocking security issues. |
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
9faf088 to
f25527b
Compare
🔍 Security Audit WarningsThe Click to view cargo audit outputThese are warnings (not vulnerabilities) but should be reviewed for:
The security job will continue to pass as these are warnings, not blocking security issues. |
1 similar comment
🔍 Security Audit WarningsThe Click to view cargo audit outputThese are warnings (not vulnerabilities) but should be reviewed for:
The security job will continue to pass as these are warnings, not blocking security issues. |
|
Going to merge this in |
Closes #175