Skip to content

TC-1777 N5: gate encryption-named-keys-v1 in /info behind a config flag - #416

Merged
samgbafa merged 5 commits into
mainfrom
tc1777/n5-info-feature-flag
Oct 23, 2026
Merged

samgbafa merged 5 commits into
mainfrom
tc1777/n5-info-feature-flag

Conversation

@samgbafa

@samgbafa samgbafa commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Config key: [global.encryption_network] named_keys_v1, default false. Env override: TINYCLOUD_ENCRYPTION_NETWORK__NAMED_KEYS_V1=true.
  • The flag only controls the encryption-named-keys-v1 entry in the GET /info feature list. It does not mount or unmount routes, and it does not change request handling.
  • Decrypt refusal for an invalid or low-order receiver key returns HTTP 400 with prefix receiver_key_invalid: on both routes.
  • No protocol-version change. The flag is off in all deployment configs.

Verification

  • RUSTFLAGS="-Dwarnings" cargo clippy --workspace --all-targets: exit 0.
  • cargo fmt --all -- --check: exit 0.
  • node scripts/gen-capabilities.mjs --check: up to date.
  • cargo test -p tinycloud-core --lib: 758 passed, 0 failed.
  • cargo test -p tinycloud-node --lib: 716 passed, 0 failed. Includes named_keys_feature_is_advertised_only_behind_its_gate and the encryption_network_named_keys_* config tests.
  • Process smoke, real tinycloud binary on 127.0.0.1: /info features omit encryption-named-keys-v1 with the flag off, and include it with the env override or the TOML key set to true.

Not covered here

  • Full create, encrypt, and decrypt flow: covered by the in-process route tests of N3/N4 and by the CLI lead's real-node run of the SDK client, which depends on this PR.

Commits

  • 3350eab receiver-key refusal error code
  • f06b916 config-gated /info advertisement
  • 9fd3d2e changelog note for the config key
  • 41ae565 drop duplicate Config manage (AdHoc::config already manages it)
  • 7c99f96 config tests and example config

Details: TC-1777

dryrun added 5 commits October 23, 2026 09:08
…y_invalid

The 400 for a receiver public key that is malformed or a low-order point
now begins with the stable code receiver_key_invalid on both decrypt routes.
Status is unchanged.

Details: TC-1777
Adds encryption_network.named_keys_v1 (default off). /info and /version
advertise the feature only when it is on. Production now manages Config as
Rocket state so the route can read it.

Details: TC-1777
AdHoc::config::<Config>() already manages Config as Rocket state, so the
extra .manage(tinycloud_config.clone()) aborts startup with
"duplicated managed state". Reverts the line added in f06b916.

Details: TC-1777
Document the flag in the example tinycloud.toml (commented, off).

Details: TC-1777
@samgbafa
samgbafa marked this pull request as ready for review October 23, 2026 10:46
@samgbafa

Copy link
Copy Markdown
Contributor Author

APPROVE: see TC-1777 (reviewed exact head 7c99f96)

@samgbafa
samgbafa merged commit fed65a7 into main Oct 23, 2026
33 of 34 checks passed
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.

1 participant