Skip to content

FIX: Restore zone TSIG key state on startup.#590

Open
ximon18 wants to merge 50 commits intomainfrom
restore-tsig-keys-in-zone-state-on-startup
Open

FIX: Restore zone TSIG key state on startup.#590
ximon18 wants to merge 50 commits intomainfrom
restore-tsig-keys-in-zone-state-on-startup

Conversation

@ximon18
Copy link
Copy Markdown
Member

@ximon18 ximon18 commented Apr 16, 2026

On startup ensure that the TSIG key field on the server source of a zone is set to Some(key) rather than None. This required changing the sequence in which state is loaded by main() because TSIG keys must be loaded before zones are reconstituted from their state files so that the loaded key can be placed in the Some(key) field of the zone server source.


  • If you are changing Rust code or integration tests (Cargo.*, crates/, etc/, integration-tests/, src/):

    • Did you run the integration tests with act through the act-wrapper (as described in TESTING.md)?
  • If you are adding/deleting man pages:

    • Did you update the man_pages config in doc/manual/source/conf.py?
    • Did you update the packaged man pages in the Cargo.toml?
    • Did you commit the freshly built man pages?
  • If you are modifying man pages:

    • Did you commit the updated built man pages?

ximon18 and others added 30 commits April 2, 2026 11:38
- New `cascade tsig add` client command to request that the daemon add a
TSIG key to the Cascade TSIG store.
- New cascaded POST /tsig/ API to add a TSIG key to the Cascade TSIG
store.
- Extension of the `cascade zone add` command `--source` argument with
an optional `!<TSIG key name>` syntax to define the TSIG key that
Cascade should use when sending an XFR request to the upstream.
- Pass the key defined by the source to the zone loader instead of None
(the zone loader is already capable of using the key, it just wasn't
being told which key to use)
As Base64 is typically how tooling present/accept TSIG key secret data
to/from users.
Begin with a test that should fail: fetching a zone without using the
required TSIG key.
@ximon18 ximon18 added this to the 0.1.0-beta1 milestone Apr 16, 2026
Copy link
Copy Markdown
Contributor

@bal-e bal-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can merge if necessary, but I'd like to have my comments addressed first.

Comment thread src/zone/state/v1.rs
Comment on lines +511 to +513
let key_name = KeyName::from_str(&tsig_key.to_string()).map_err(|_| {
ZoneLoadSourceSpecParseError::InvalidTsigKeyName(tsig_key.clone())
})?;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error is not possible. KeyName is just Name<Array<255>>, i.e. an arbitrary domain name. I would suggest using tsig_key.flatten_into().expect("'KeyName' can hold any domain name") and removing the InvalidTsigKeyName error.

Comment thread src/main.rs
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I also ended up making similar changes to this file in #589, so we will have merge conflicts to deal with.

@ximon18 ximon18 mentioned this pull request Apr 28, 2026
2 tasks
Base automatically changed from tsig-downstream-support to main April 30, 2026 11:48
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.

3 participants