Skip to content

HDDS-11421. Invalid token generated by "ozone dtutil get" command - #11067

Open
echonesis wants to merge 2 commits into
apache:masterfrom
echonesis:test-HDDS-11421
Open

HDDS-11421. Invalid token generated by "ozone dtutil get" command#11067
echonesis wants to merge 2 commits into
apache:masterfrom
echonesis:test-HDDS-11421

Conversation

@echonesis

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

ozone dtutil get previously generated an empty credentials file when an o3:// or ofs:// URL was used. Only O3fsDtFetcher was registered, so Hadoop dtutil could not find a delegation token fetcher matching the o3 or ofs scheme.

This PR:

  • adds and registers OfsDtFetcher for ofs:// URLs;
  • adds and registers O3DtFetcher for o3:// URLs;
  • maps the OM authority from an o3:// URL to an ofs:// URI and reuses the existing OFS delegation token retrieval path;
  • preserves support for OM HA service IDs and direct host/port authorities;
  • adds unit tests for scheme handling, URI conversion, token storage, missing authorities, and failed token retrieval;
  • adds tests verifying that all Ozone DtFetcher providers can be loaded through ServiceLoader;
  • adds secure smoke coverage for generating and printing tokens with both o3:// and ofs:// URLs.

The change is client-side only and does not modify OM behavior or the delegation token format.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-11421

How was this patch tested?

Local Test (Unit Test)

mvn -pl :ozone-filesystem-common test \
 -Dtest=TestOzoneDtFetcher \
 -DskipShade -DskipRecon -DskipDocs

GitHub Actions CI: https://github.com/echonesis/ozone/actions/runs/32243533098

Generated-by: Codex (GPT-5)

serviceNames.add(fetcher.getServiceName().toString());
}

assertTrue(serviceNames.contains("o3fs"));

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.

nit: prefer AssertJ to match the rest of the module (HDDS-9951) — assertThat(serviceNames).contains("o3", "ofs", "o3fs").

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion!

@rich7420

Copy link
Copy Markdown
Contributor

thanks for the patch! @echonesis

@echonesis
echonesis requested a review from rich7420 August 21, 2026 15:24

@rich7420 rich7420 left a comment

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.

LGTM , thanks for the update

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