fix(transfer): handle LOGICAL root home directory mapping#557
Merged
Nahuel990 merged 3 commits intoministackorg:mainfrom May 4, 2026
Merged
fix(transfer): handle LOGICAL root home directory mapping#557Nahuel990 merged 3 commits intoministackorg:mainfrom
Nahuel990 merged 3 commits intoministackorg:mainfrom
Conversation
|
Docker image for this PR has been published: |
Updated changelog to reflect changes in Transfer Family logical root home directory mappings and other fixes.
Nahuel990
approved these changes
May 4, 2026
Collaborator
|
Thanks for this fix @stefanmb ! |
|
Docker image for this PR has been published: |
|
Docker image for this PR has been published: |
YakirOren
pushed a commit
to YakirOren/ministack
that referenced
this pull request
May 5, 2026
…rg#557) * fix(transfer): handle LOGICAL root home directory mapping * Update CHANGELOG.md for version 1.3.26 Updated changelog to reflect changes in Transfer Family logical root home directory mappings and other fixes.
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
Fix SFTP
LOGICALhome directory mappings when the mapping entry is/.Previously, a root mapping did not match normal SFTP paths because the resolver built the match prefix as
entry + "/". ForEntry="/", that produced"//", so paths like/users.csvfailed to match the configured mapping and fell through to the unmapped fallback behavior.This change treats
/as its own prefix while preserving the existing behavior for non-root mappings.Examples
Given this Transfer user configuration:
{ "HomeDirectoryType": "LOGICAL", "HomeDirectoryMappings": [ { "Entry": "/", "Target": "/my-sftp-bucket" } ] }Expected behavior:
/users.csvs3://my-sftp-bucket/users.csv/reports/may.csvs3://my-sftp-bucket/reports/may.csv/s3://my-sftp-bucket/Before this fix,
/users.csvdid not match the/entry because the code checked for a"//"prefix.Non-root mappings still behave the same:
{ "HomeDirectoryType": "LOGICAL", "HomeDirectoryMappings": [ { "Entry": "/inbox", "Target": "/my-sftp-bucket/incoming" } ] }/inbox/today.csvs3://my-sftp-bucket/incoming/today.csvLongest-prefix matching is preserved when root and more specific mappings are combined:
{ "HomeDirectoryType": "LOGICAL", "HomeDirectoryMappings": [ { "Entry": "/", "Target": "/my-sftp-bucket/root" }, { "Entry": "/inbox", "Target": "/my-sftp-bucket/incoming" } ] }/inbox/today.csvs3://my-sftp-bucket/incoming/today.csv/other/file.csvs3://my-sftp-bucket/root/other/file.csvTesting
Added an end-to-end regression test which:
HomeDirectoryType="LOGICAL"andEntry="/"./users.csvthrough SFTP.users.csv.