Skip to content

[Server] Name the path when the token signing key file is a directory #2364

Done

Description

@shba24

Is your feature request related to a problem? Please describe.

When server.token-signing-private-key-file points to a directory, the server fails at startup with only:

java.io.IOException: Is a directory

The message doesn't name the path, so it is hard to tell which setting is wrong. The other bad key files do name it: a missing file gives "No token signing key file at ", and an empty, encrypted or malformed file gives "Cannot read the RSA private key in ; …".

This happens because requireFile checks only that the path exists, and the directory then reaches Files.readAllBytes (line 213).

Raised in the review of #2081 (#2081 (comment)).

Describe the solution you would like

  1. In requireFile, also fail when the path is not a regular file (Files.isRegularFile), with an IllegalStateException that names the absolute path, like the missing-file case.
  2. Add a row for a directory to the existing SecurityConfigurationTest tests of unusable key files.

Activity

  1. added
    enhancement
    good first issue
    on Nov 24, 2026
  2. Verlintas commented on Nov 27, 2026

    @Verlintas
    Contributor

    take

    Plan: make requireFile also reject a path that is not a regular file, with an IllegalStateException naming the absolute path (same wording shape as the missing-file case), and add a directory row to SecurityConfigurationTest. I'll run build/sbt "server/testOnly io.unitycatalog.server.security.SecurityConfigurationTest" and build/sbt javafmtAll; the commit will be DCO signed off.

    Transparency: prepared with an AI coding agent (OpenCode, DeepSeek V4.1 Flash) under human supervision; the code and description will be reviewed before submission.

  3. Verlintas commented on Nov 27, 2026

    @Verlintas
    Contributor

    take

  4. added a commit that references this issue on Dec 1, 2026
    7a3c269
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions