Skip to content

fix(ci): accept ECDSA and security-key types in allowed-signers test - #689

Merged
c-vigo merged 1 commit into
feature/625-nix-claude-migrationfrom
bugfix/688-allowed-signers-ecdsa
Jun 24, 2026
Merged

c-vigo merged 1 commit into
feature/625-nix-claude-migrationfrom
bugfix/688-allowed-signers-ecdsa

Conversation

@c-vigo

@c-vigo c-vigo commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

tests/test_integration.py::TestHostGitSignatureSetup::test_allowed_signers_file_exists
hard-coded only two SSH key-type prefixes, so a valid ECDSA (or FIDO
security-key sk-*) signing key in the allowed-signers file spuriously failed
the assertion. This broadens the check to accept the full set of OpenSSH
signing key-type tokens.

Change

Before:

assert "ssh-ed25519" in content or "ssh-rsa" in content, (
    "Allowed signers file doesn't appear to contain SSH public keys"
)

After:

key_types = (
    "ssh-ed25519",
    "ssh-rsa",
    "ecdsa-sha2-nistp",
    "[email protected]",
    "[email protected]",
)
assert any(k in content for k in key_types), (
    "Allowed signers file doesn't appear to contain SSH public keys"
)

ecdsa-sha2-nistp as a prefix covers the three nistp curves
(nistp256/nistp384/nistp521). This mirrors the canonical key-type set
already used by test_git_signing_key_configured in the same file (lines
~106-110: ssh-rsa, ssh-ed25519, ecdsa-sha2-nistp256/384/521), and
additionally accepts the sk-*@openssh.com security-key variants per the issue.

Why no separate failing-test commit

This change repairs a too-narrow allowlist inside a test assertion — the
assertion itself is the unit under repair, not production code under test. A
strict RED→GREEN cycle with a standalone failing-test commit doesn't cleanly
apply here, so this is a single fix commit. The change is verified by pytest --collect-only (no collection/syntax breakage) and by the authoritative
dispatched integration CI run.

Scope

Touches only the assertion in tests/test_integration.py plus the CHANGELOG.md
entry (auto-mirrored into assets/workspace/.devcontainer/CHANGELOG.md).

Closes #688

@c-vigo
c-vigo force-pushed the bugfix/688-allowed-signers-ecdsa branch from 5aa75a4 to 8a1f0d7 Compare June 24, 2026 14:35
@c-vigo
c-vigo merged commit 171348c into feature/625-nix-claude-migration Jun 24, 2026
@c-vigo
c-vigo deleted the bugfix/688-allowed-signers-ecdsa branch June 24, 2026 14:35
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