fix(aliyun-oss): avoid duplicated bucket in canonicalized resource for path-style#692
Open
polyrabbit wants to merge 1 commit intoapache:mainfrom
Open
fix(aliyun-oss): avoid duplicated bucket in canonicalized resource for path-style#692polyrabbit wants to merge 1 commit intoapache:mainfrom
polyrabbit wants to merge 1 commit intoapache:mainfrom
Conversation
Member
|
I don't understand how could this happen. Can you share your config about |
Author
|
In our environment, we can only access OSS via the VPC PrivateLink endpoint, and this PrivateLink endpoint only supports path-style addressing. When using path-style addressing, it triggers a signing bug in reqsign, resulting in the following error: I also extracted a minimal reproduction snippet: const BUCKET: &str = "test-bucket";
const ENDPOINT_PRIVATELINK: &str = "http://ep-xxxxxxx-cn-shanghai-m.oss.cn-shanghai.privatelink.aliyuncs.com";
const ACCESS_KEY_ID: &str = "xxxxxxxxxxxxxxxxxxxx";
const ACCESS_KEY_SECRET: &str = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
#[tokio::main]
async fn main() -> Result<()> {
env_logger::init();
let op = Operator::new(
Oss::default()
.endpoint(ENDPOINT_PRIVATELINK)
.bucket(BUCKET)
.access_key_id(ACCESS_KEY_ID)
.access_key_secret(ACCESS_KEY_SECRET)
.addressing_style("path"),
)?
.finish();
let entries = op.list("/").await?;
for entry in entries {
println!("{}", entry.path());
}
Ok(())
} |
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.
When using PrivateLink to access OSS, users must use the path-style access method. For more information, see
https://help.aliyun.com/zh/oss/user-guide/access-oss-via-privatelink-network
But
reqsigncurrently does not support path-style signature, it always duplicates the bucket name in the path, which causes signature failure. A valid string to sign should be like:whereas the current code signs this: