Repository navigation
feat: SFTP endpoint for game server files (spec 040) - #1
Merged
Merged
Conversation
Go module, version-only entrypoint with tests, Dockerfile, shared CI caller, Dependabot, coverage gate, and the guide/spec files modelled on GameplanePanel/mcp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
The scaffold's main() held the error branch, which tests cannot reach, so the 70% total gate failed at 62.5%. exitCode() now holds that logic and is tested; main() only calls os.Exit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
…PI (spec 040) - internal/apiclient: login, session check, server list and the file routes (list, stat, ranged download, streaming upload, rename, mkdir, delete) with API errors mapped to sentinels. - internal/sshserver: password and public-key login through /sftp/v1/login, SFTP subsystem only (no shell, exec, PTY or forwarding), idle timeout, per-user session cap, 30 s session check that closes revoked sessions, Prometheus metrics. - internal/vfs: one folder per server (/<server>, /_namespaces/<ns>/...) or one server for <user>+<server> logins, dotfiles hidden, server folders read-only, ranged reads, streamed uploads with resume and reordering of pipelined writes, rename, mkdir, remove, per-user transfer cap. - serve command with flags/env; specs.md and README updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
ReadAt returns a nil error when the buffer is filled, even if the stream ended at the same byte. Thread the Serve context through handle and establish, use context-aware dial/listen, errors.Is for EOF checks, and rename the service token file env constant to avoid gosec G101. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Skipping 5 bytes of "hello world" leaves " world"; the case was written in this PR with the leading space missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
The previous lint cleanup dropped the embedded Conn selector from Write, turning it into infinite recursion (staticcheck SA5007). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
…ssions Cap concurrent pre-authentication connections (--max-preauth-connections, default 64) and count refusals in gameplane_sftp_preauth_rejected_total. Reject a second concurrent session channel with ResourceShortage. End the API session through POST /sftp/v1/sessions/end when a login is refused by the session cap or a password login's handshake does not finish. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
The handshake deadline was pushed out on every read, so a client dripping bytes could hold a pre-auth slot indefinitely. It now ends LoginTimeout after accept. The idle timeout after authentication is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Accept a further session channel again, as before, but close it right after refusing its requests so it never sits idle until the idle timeout. This replaces the ResourceShortage rejection that broke TestSecondSFTPSubsystemIsRefused. 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The SFTP component of Gameplane spec 040 (
specs/040-sftp-access/in GameplanePanel/Gameplane, issue GameplanePanel/Gameplane#1051). Per the settled delivery layout, this is the one sftp repo PR; it merges before the Gameplane PR (feat/040-sftp-access), which then points thesftpsubmodule at the merged commit.Draft while the server is built. So far:
versionsubcommand, Dockerfile, CI caller of Gameplane's sharedgo-component.yaml, Dependabot, coverage gate,CLAUDE.md/AGENTS.md,README.md,specs.md.Still to come in this PR: the SSH/SFTP server that authenticates and runs every file operation through the Gameplane API as the signed-in user (T020, T021 and the story tasks).
Verification
Local compile check only (
GOWORK=off go build ./...); CI verifies the rest.Generated by Claude Code