-
Notifications
You must be signed in to change notification settings - Fork 0
Config Loading - TOML file I/O and env overrides #35
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
Closed
m-005
wants to merge
1
commit into
spr/m-005/config-types-nodeconfig-struct-definitions
from
spr/m-005/config-loading-toml-file-io-and-env-overrides
Closed
Config Loading - TOML file I/O and env overrides #35
m-005
wants to merge
1
commit into
spr/m-005/config-types-nodeconfig-struct-definitions
from
spr/m-005/config-loading-toml-file-io-and-env-overrides
+301
−0
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
This was referenced Jan 21, 2026
m-005
added a commit
that referenced
this pull request
Jan 21, 2026
Part 1 of the Foundation stage for objects-node daemon. ## Changes Adds configuration type definitions for the node daemon: - NodeConfig - Main configuration struct with nested settings - NodeSettings - Data directory, API port, and bind address - NetworkSettings - Relay URL and discovery topic - StorageSettings - Blob size and total storage limits - IdentitySettings - Registry URL All structs include: - Default implementations with sensible values - Serde serialization support - Comprehensive documentation ## Testing - Default value tests - Serialization round-trip tests ## Dependencies - Added toml crate for TOML file parsing - Added thiserror for error handling Part of the Foundation stage (1/4). Next: Config Loading (#35). Pull Request: #38
m-005
added a commit
that referenced
this pull request
Jan 21, 2026
Part 3 of the Foundation stage for objects-node daemon. ## Changes Adds state type definitions for persistent node state: - NodeState - Persistent state with node keypair and optional identity - Uses SecretKey from objects-transport (Iroh Ed25519 key) - Optional IdentityInfo for registered OBJECTS identities - IdentityInfo - RFC-001 identity linking: - Identity ID (obj_ + base58 hash) - Registered handle - 8-byte nonce for ID derivation - Signer type (Passkey or Wallet) ## Security Comprehensive documentation on security requirements: - State files must use 600 permissions (owner read/write only) - Node key must be kept secure and never committed to version control - Supports anonymous mode (no identity) for nodes that don't publish assets ## Testing - Serialization round-trip tests - Identity persistence tests - Both Passkey and Wallet signer types validated Part of the Foundation stage (3/4). Builds on: #35. Next: State Persistence (#37). Pull Request: #40
m-005
added a commit
that referenced
this pull request
Jan 21, 2026
Pull Request: #35 Part 2 of the Foundation stage for objects-node daemon. ## Changes Implements configuration loading and validation: - ConfigError enum with proper error types (IO, Parse, Validation) - from_env() - Load configuration from environment variables only - load_or_create() - Load from TOML file or create with defaults - load() and save() - TOML file I/O with parent directory creation - validate() - Comprehensive validation: - API port in valid range (1024-65535) - Valid IP address for bind address - HTTPS-only relay URLs - RFC-002 compliant discovery topic format - Environment variable overrides with proper precedence ## Testing Uses temp-env for safe environment variable testing (no unsafe blocks): - Config file creation and loading - Environment variable override tests - Validation error cases (invalid port, IP, URL, topic) - Round-trip serialization ## Dependencies - Added temp-env for safe test environment manipulation - Added tempfile for temporary test directories
f3b3890 to
005b091
Compare
6029800 to
ad96b9d
Compare
005b091 to
f6abbbc
Compare
ad96b9d to
1525ce6
Compare
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
1 similar comment
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Pull Request: #35 Part 2 of the Foundation stage for objects-node daemon. ## Changes Implements configuration loading and validation: - ConfigError enum with proper error types (IO, Parse, Validation) - from_env() - Load configuration from environment variables only - load_or_create() - Load from TOML file or create with defaults - load() and save() - TOML file I/O with parent directory creation - validate() - Comprehensive validation: - API port in valid range (1024-65535) - Valid IP address for bind address - HTTPS-only relay URLs - RFC-002 compliant discovery topic format - Environment variable overrides with proper precedence ## Testing Uses temp-env for safe environment variable testing (no unsafe blocks): - Config file creation and loading - Environment variable override tests - Validation error cases (invalid port, IP, URL, topic) - Round-trip serialization ## Dependencies - Added temp-env for safe test environment manipulation - Added tempfile for temporary test directories
f6abbbc to
b73bee5
Compare
1525ce6 to
0f9ef1c
Compare
m-005
added a commit
that referenced
this pull request
Jan 24, 2026
Continuation of #35 after rebasing to main.
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.
Part 2 of the Foundation stage for objects-node daemon.
Changes
Implements configuration loading and validation:
ConfigErrorenum with proper error types (IO, Parse, Validation)from_env()- Load configuration from environment variables onlyload_or_create()- Load from TOML file or create with defaultsload()andsave()- TOML file I/O with parent directory creationvalidate()- Comprehensive validation:Testing
Uses
temp-envfor safe environment variable testing (no unsafe blocks):Dependencies
temp-envfor safe test environment manipulationtempfilefor temporary test directoriesPart of the Foundation stage (2/4). Builds on: #34. Next: State Types (#36).