Skip to content

feat: DI-1192 client-visible rejection messages via SSH auth banner - #50

Draft
MatthewwTN wants to merge 1 commit into
masterfrom
di-1192
Draft

feat: DI-1192 client-visible rejection messages via SSH auth banner#50
MatthewwTN wants to merge 1 commit into
masterfrom
di-1192

Conversation

@MatthewwTN

Copy link
Copy Markdown

Clever Coding Standards Agreement

Linear

DI-1192

Overview

  • As part of the static IP migration (DI-1192), clever-sftp will reject logins from districts tagged use_sftp2_host_only when they connect to the legacy us-west-1 host. Today a rejected login only shows the client's generic "Permission denied, please try again." — districts get no explanation of why they can no longer connect, which will drive support load during the sftp2.clever.com rollout.
  • The server's auth-callback error string never reaches the client (SSH only transmits a failure flag); the protocol's mechanism for messaging during a rejected login is the auth banner, which OpenSSH/WinSCP/FileZilla print by default.
  • This adds an opt-in, backwards-compatible API: NewManagedServerWithError accepts a generator returning (ServerDriver, error); returning a nil driver with a *RejectionError sends its message to the client as an auth banner via ssh.BannerError. All other denials (nil driver, plain/nil error) behave exactly as today. NewManagedServer is unchanged, so the other consumer (lockbox-sftp) is unaffected.
  • Bumps golang.org/x/crypto to v0.40.0 (matching clever-sftp) — ssh.BannerError did not exist in the previously pinned 2022 version.

Testing

  • go build and the package test suite pass.
  • New table-driven test TestRejectionToSSHError covers: banner from a RejectionError, banner from a wrapped RejectionError, trailing-newline normalization, and generic denial for nil/plain errors.
  • End-to-end banner display will be verified against clever-dev when clever-sftp is wired up (companion PR: Clever/clever-sftp#126).

Rollout

  • No behavior change for existing consumers until they opt in via NewManagedServerWithError.
  • Merge order: this PR merges first, then Clever/clever-sftp#126 pins the new commit and adopts the API.

Rollback

  • Revert the commit; consumers that haven't adopted NewManagedServerWithError are unaffected. If clever-sftp has already adopted it, re-pin its go.mod to the prior pseudo-version as part of the revert.

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