Skip to content

chore(api/auth): fix clippy failure for DLF default signer identifier#191

Merged
JingsongLi merged 1 commit into
apache:mainfrom
freedom3219:fix/dlf-default-signer-clippy
Apr 2, 2026
Merged

chore(api/auth): fix clippy failure for DLF default signer identifier#191
JingsongLi merged 1 commit into
apache:mainfrom
freedom3219:fix/dlf-default-signer-clippy

Conversation

@freedom3219
Copy link
Copy Markdown
Contributor

@freedom3219 freedom3219 commented Apr 2, 2026

Purpose

Fix the CI failure from cargo clippy --all-targets --workspace -- -D warnings.

cargo clippy --all-targets --workspace -- -D warnings
    Checking paimon v0.0.0 (/workspaces/paimon-rust/crates/paimon)
error: associated constant `IDENTIFIER` is never used
   --> crates/paimon/src/api/auth/[dlf_signer.rs:160](http://dlf_signer.rs:160/):15
    |
159 | impl DLFDefaultSigner {
    | --------------------- associated constant in this implementation
160 |     pub const IDENTIFIER: &'static str = "default";
    |               ^^^^^^^^^^
    |
    = note: `-D dead-code` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(dead_code)]`

error: could not compile `paimon` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `paimon` (lib test) due to 1 previous error

The failure was caused by a duplicated DLF signer identifier definition in the auth factory. DLFDefaultSigner::IDENTIFIER existed but was not referenced by the factory code path, which triggered a dead_code warning and was promoted to an error by Clippy in CI.

Brief change log

  • Remove duplicated "default" / "openapi" identifier definitions from DLFAuthProviderFactory
  • Reuse DLFDefaultSigner::IDENTIFIER and DLFOpenApiSigner::IDENTIFIER as the single source of truth
  • Update auth factory tests to assert against the shared signer identifiers
  • Add a test to verify the default signer identifier is returned when URI input is missing

Tests

  • cargo fmt --all
  • cargo test -p paimon
  • cargo clippy --all-targets --workspace -- -D warnings
  • cargo test --workspace

API and Format

Documentation

@freedom3219 freedom3219 changed the title fix(api/auth): resolve clippy dead_code warning fix(api/auth): fix clippy failure for DLF default signer identifier Apr 2, 2026
@freedom3219 freedom3219 changed the title fix(api/auth): fix clippy failure for DLF default signer identifier chore(api/auth): fix clippy failure for DLF default signer identifier Apr 2, 2026
Copy link
Copy Markdown
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit aa2cb75 into apache:main Apr 2, 2026
8 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.

2 participants