Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SignatureDoesNotMatch calling S3.delete_objects #675

Open
maleadt opened this issue Jun 7, 2024 · 0 comments
Open

SignatureDoesNotMatch calling S3.delete_objects #675

maleadt opened this issue Jun 7, 2024 · 0 comments

Comments

@maleadt
Copy link

maleadt commented Jun 7, 2024

Looking at https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html#API_DeleteObjects_RequestSyntax, this API needs to be invoked with a Delete>NxObject>Key hierarchy, which AWS.jl already provides the toplevel Delete entry:

Dict{String,Any}("Delete" => Delete);

Hence I figured I should call the functionality in here as such, passing a vector of dictionaries:

function s3_delete(aws::AbstractAWSConfig, bucket, paths::Vector; kwargs...)
    delete = []
    for path in paths
        push!(delete, Dict("Object" => Dict("Key" => path)))
    end

    return parse(S3.delete_objects(bucket, delete; aws_config=aws, kwargs...))
end

That however throws a signature error:

ERROR: AWS.AWSExceptions.AWSException: SignatureDoesNotMatch -- The request signature we calculated does not match the signature you provided. Check your key and signing method.

The delete object I pass is as follows:

1-element Vector{Any}:
 Dict("Object" => Dict("Key" => "nanosoldier/Convex1d.1.6.0-DEV-1f9e8bdbcf.log"))

Calling S3.delete_object with this key works fine.

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

No branches or pull requests

1 participant