Repository navigation
feat: add SFTP action (#37) - #86
Open
raphael-goetz wants to merge 2 commits into
Open
raphael-goetz wants to merge 2 commits into
raphael-goetz wants to merge 2 commits into
Conversation
Add a new Rust Hercules action, following the cron/rest/mcp conventions, that exposes four runtime functions for operating on a remote SFTP server: - sftp::file::read (path: TEXT): TEXT - sftp::file::write (path: TEXT, content: TEXT): void - sftp::file::delete (path: TEXT): void - sftp::directory::list (path: TEXT): ARRAY<SFTP_ENTRY> Connection details (host, port, username, password) are read from project-level configuration. SFTP is spoken over SSH via russh/russh-sftp (pure Rust). Registers the action in the GitLab CI rust-actions matrix. Refs #37 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
GitLab Pipeline ActionGeneral informationLink to pipeline: https://gitlab.com/code0-tech/development/centaurus/-/pipelines/3014870201 Status: Passed Job summariesdocs:previewDocumentation preview available at https://code0-tech.gitlab.io/-/development/telescopium/-/jobs/17645481206/artifacts/out/index.html |
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.
What
Adds a new Rust Hercules action,
sftp-action, following the cron/rest/mcpconventions. It speaks SFTP over SSH (via
russh/russh-sftp, pure Rust) andexposes four runtime functions:
sftp::file::read(path: TEXT): TEXTsftp::file::write(path: TEXT, content: TEXT): voidsftp::file::delete(path: TEXT): voidsftp::directory::list(path: TEXT): ARRAY<SFTP_ENTRY>(+ theSFTP_ENTRYdata type)Why
Closes #37.
The issue had no body/spec, so scope was inferred from the repo's established
Rust-action conventions.
How
SFTP_HOST/SFTP_PORT/SFTP_USERNAME/SFTP_PASSWORD)come from project-level configuration, mirroring
mcp-action's token configso secrets stay out of flow definitions. Password auth only for now.
src/config.rsresolves + validates the config (unit-tested);src/client.rswraps the SSH+SFTP session and maps failures to stable runtime error codes
(
SFTP_SSH_ERROR/SFTP_PROTOCOL_ERROR/SFTP_AUTH_FAILED/SFTP_CONFIG_ERROR/
SFTP_NOT_UTF8);src/functions.rsholds the four handlers.and logged (documented in
client.rsas a deliberate tradeoff / follow-up).russhpulls inaws-lc-rs, so the Alpine Dockerfile addsgcc make perltothe builder stage.
hercules-sdk/hercules-macrosto 1.5.0 to match the sibling actions.sftp-actionin the.rust-actionsCI matrix in.gitlab-ci.yml.Testing
All green:
cargo fmt --all --checkcargo clippy --all-targets --all-features -- -D warningscargo test— 7/7 passcargo buildcargo run -- export— all four function +SFTP_ENTRYdefinitions generate correctly🤖 Generated with Claude Code