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

Figure out SignatureDoesNotMatch issue #1

Closed
bcspragu opened this issue Nov 6, 2023 · 2 comments
Closed

Figure out SignatureDoesNotMatch issue #1

bcspragu opened this issue Nov 6, 2023 · 2 comments

Comments

@bcspragu
Copy link
Owner

bcspragu commented Nov 6, 2023

Currently, the API can issue temporary credentials that have a policy allowed to access a random /temp/... scratchpad in the bucket, but when the Logseq client generates presigned upload URLs, they're invalid. Snippet:

 
Can not upload temp file, code=403: <?xml version="1.0" encoding="UTF-8"?>
<Error>
	<Code>
		SignatureDoesNotMatch
	</Code>
<Message>
	The request signature we calculated does not match the signature you provided. Check your key and signing method.
</Message>

These types of things are always annoying to debug because a single bit in the wrong place messes up the signatures. I've compared the responses from the self-hosted server versus the real server, and they look fine, and I've gone through the s3_presign code used in rsapi, but haven't seen anything obvious yet.

@bcspragu
Copy link
Owner Author

An annoying update: I had made a few tweaks and this briefly worked, e.g.:

image

^^ shows an example of the Logseq client uploading a few encrypted blobs to the S3 bucket successfully, using the STS credentials to generate presigned URLs and then upload things. I haven't been able to replicate this, despite not (as far as I remember) changing anything. But it indicates that it isn't broken in some major way, just some finicky minor way.

@bcspragu
Copy link
Owner Author

Okay, I've traced this to the s3-presign crate used by Logseq's rsapi code, and until that's fixed upstream, I can continue development using my fork, which swaps out the s3-presign crate for the rust-s3 crate.

Here's the upstream issue on logseq/rsapi, I'm closing this one out.

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