Skip to content

Conversation

@m-005
Copy link
Member

@m-005 m-005 commented Jan 21, 2026

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

Part of the Foundation stage (2/4). Builds on: #34. Next: State Types (#36).

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
@m-005 m-005 force-pushed the spr/m-005/config-loading-toml-file-io-and-env-overrides branch from f3b3890 to 005b091 Compare January 21, 2026 03:47
@m-005 m-005 changed the base branch from spr/m-005/main.config-loading-toml-file-io-and-env-overrides to spr/m-005/config-types-nodeconfig-struct-definitions January 21, 2026 03:48
@m-005 m-005 force-pushed the spr/m-005/config-types-nodeconfig-struct-definitions branch from 6029800 to ad96b9d Compare January 21, 2026 03:48
@m-005 m-005 force-pushed the spr/m-005/config-loading-toml-file-io-and-env-overrides branch from 005b091 to f6abbbc Compare January 23, 2026 23:22
@m-005 m-005 force-pushed the spr/m-005/config-types-nodeconfig-struct-definitions branch from ad96b9d to 1525ce6 Compare January 23, 2026 23:22
@claude
Copy link

claude bot commented Jan 23, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

1 similar comment
@claude
Copy link

claude bot commented Jan 23, 2026

Code review

No 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
@m-005 m-005 force-pushed the spr/m-005/config-loading-toml-file-io-and-env-overrides branch from f6abbbc to b73bee5 Compare January 24, 2026 00:19
@m-005 m-005 force-pushed the spr/m-005/config-types-nodeconfig-struct-definitions branch from 1525ce6 to 0f9ef1c Compare January 24, 2026 00:19
@m-005 m-005 deleted the branch spr/m-005/config-types-nodeconfig-struct-definitions January 24, 2026 09:56
@m-005 m-005 closed this Jan 24, 2026
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants