Skip to content

feat: per-user SFTP username, display name by default - #1089

Merged
ValgulNecron merged 7 commits into
masterfrom
fix/sftp-login-display-name
Nov 24, 2026
Merged

ValgulNecron merged 7 commits into
masterfrom
fix/sftp-login-display-name

Conversation

@ValgulNecron

@ValgulNecron ValgulNecron commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

SSO accounts are named by their email address, so SFTP logins had to type it. Each user now has an SFTP username (spec 040 FR-005a, amended here):

  • Default: the display name, when it is a valid login name (no space, control character, / or +, at most 64 characters) and no other account has it as username, SFTP username or display name. Otherwise the panel username.
  • Changeable under Settings, SFTP (PUT /users/me/sftp/login-name; "" resets to the default). A name another account holds is refused (409 server.sftp.login_name_taken), an invalid one with 400 server.sftp.login_name_invalid.
  • Login matches chosen SFTP usernames, then panel usernames (always work), then default display names. The credential is still checked against the resolved account.
  • GET /users/me/sftp adds loginName and customLoginName; username stays the panel username.

Changes

  • Migration 027_sftp_login_name.sql: users.sftp_username with a unique index.
  • api/internal/auth/sftp_login_name.go: default rule, set, resolve.
  • Dashboard: "SFTP username" row with a Default/Custom tag and a Change dialog (design in design.fig, export updated).
  • Spec 040 amended: FR-005a, US3 scenario 1a, contract, data model, tasks T057–T059. Docs: docs/sftp.md, api/specs.md.

Tests

New: api/internal/auth/sftp_login_name_test.go, api/internal/handlers/sftp_login_display_name_test.go, five new cases in web/src/routes/ProfileSftp.test.tsx. One existing fixture (selfBody) gained the two new response fields. A blind peer review rated it purely additive (no weakening, no deletion).


Generated by Claude Code

SSO accounts are named by their email address. The SFTP login now also
resolves a display name that exactly one account has; panel usernames
always win and a shared display name resolves to nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
@ValgulNecron ValgulNecron added area: api REST/WebSocket gateway type: feature New capability or user-facing addition labels Nov 23, 2026 — with Claude
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

SFTP login now resolves the validated base username to a panel username. Exact username matches take precedence; otherwise, a display name resolves only when exactly one account matches. Tests and documentation describe these rules.

Changes

SFTP Login Resolution

Layer / File(s) Summary
Resolve login names and authenticate
api/internal/auth/sftp.go, api/internal/handlers/sftp_login.go, api/internal/handlers/sftp_login_display_name_test.go, api/specs.md, specs/040-sftp-access/contracts/api.md, docs/sftp.md, changelog/unreleased/1089-sftp-display-name-login.md
SessionStore.ResolveSFTPLoginName prefers exact usernames and resolves display names only when unique. The login handler uses the resolved username for subsequent processing. Tests cover unique, shared, and conflicting names; specifications and user documentation describe the resolution rules.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related issues

  • Issue 1051 — This change covers how SFTP login names map to accounts, but does not add the SFTP server requested by the issue.

Possibly related PRs

Suggested labels: area: specs, type: test

Merge Risk: Minimal · up to 93b70

SFTP login now accepts a unique display name alongside the panel username. Shared or unknown names are refused as before, and no merge-blocking risk was identified.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Title check Warning The title names two changes: a per-user SFTP username and display-name login by default. The changeset adds display-name resolution for SFTP login (exact panel username first, then a unique display na… Rewrite the title to describe the implemented change, for example: "feat(api): let SFTP logins use a unique display name" (the wording used in PR #1089). If a per-user SFTP username change is part of this PR, confirm it appears in the chang…
Passed Passed checks: 3 passed

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names two changes: a per-user SFTP username and display-name login by default. The changeset adds display-name resolution for SFTP login (exact panel username first, then a unique display name). The phrase "per-user SFTP username" does not match the summarized changes, which do not add a per-user username feature. The title is partially related: the display-name part matches the main change, but the first clause describes something not present in the changeset.

Resolution

Rewrite the title to describe the implemented change, for example: "feat(api): let SFTP logins use a unique display name" (the wording used in PR #1089). If a per-user SFTP username change is part of this PR, confirm it appears in the changeset. Otherwise, remove that clause.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

CI Report - edeaaab

run 45302978348 - attempt 1

0 failed - 26 passed - 7 skipped - 40m14s elapsed

Test selection: partial - per-suite table

Coverage

Module Measured Gate Margin
web L94.27 S92.45 B87.48 F90.22 L92 S92 B82 F76 +0.45

Changed

Area Files +/-
assets/ 24 +741/-339
api/ 8 +521/-5
web/ 4 +210/-7
i18n/ 1 +52/-0
specs/ 4 +14/-2
docs/ 1 +7/-0
changelog/ 1 +3/-0
(root) 1 +0/-0

Slowest jobs

Job Duration
e2e telemetry / arm64 (kind) 24m38s
e2e telemetry / amd64 (kind) 24m11s
e2e postgres / amd64 (kind) 21m2s
e2e restricted-workloads / arm64 (kind) 15m10s
e2e restricted-workloads / amd64 (kind) 15m9s

e2e buckets run

api-agent, api-auth, api-mods, api-rbac, api-roles, backup-preparation, bot-fast, management-placement, monitoring, multicluster, network-isolation, operator, optional-components, postgres-availability, postgres-ha, postgres-pitr, ratelimit, recovery, restricted-workloads, sftp, standalone, telemetry, upgrade, wake-hostport

Each user gets an SFTP username (FR-005a): the display name when no other
account holds it, otherwise the panel username, and a name the user can
choose with PUT /users/me/sftp/login-name. The login matches chosen names,
then panel usernames, then default display names. Spec 040 amended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
@ValgulNecron ValgulNecron changed the title feat(api): let SFTP logins use a unique display name feat: per-user SFTP username, display name by default Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
…40 T058)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
Shows the SFTP username with a Default or Custom tag, builds the login
forms from it, and lets the user choose another name or reset to the
default (spec 040 T059).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
@ValgulNecron ValgulNecron added area: specs spec-kit feature specs and design docs area: web React dashboard labels Nov 24, 2026 — with Claude
@ValgulNecron
ValgulNecron merged commit 2d43961 into master Nov 24, 2026
88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: api REST/WebSocket gateway area: specs spec-kit feature specs and design docs area: web React dashboard type: feature New capability or user-facing addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants