Closed midnight-wonderer closed 10 months ago
Hello,
Thanks for the PR.
Is it because the Prefix is not configured that the module cannot work?
Hey, it kinda complicated
The S3-compatible storage I am using, allows setting key prefixes access control.
For example, I can grant access to some/prefix/path
to access key A; and some/other/path
to access key B.
S3 is just a big KV store, it doesn't actually have a concept of directories.
That why:
To mimic the directory access grant, the only logical way to do it is to add a trailing /
to the rule.
Key A, which should be able to access some/prefix/path
, should have the prefix rule of some/prefix/path/
(with trailing slash), because otherwise, it will be able to access some/prefix/path-and/some/other/adjacent/path
too.
But once I add a trailing slash to the prefix rule:
certmagic-s3
with a trailing slash.certmagic-s3
without trailing slash.Both have an issue:
certmagic-s3
somehow checks for permission at the root and determines that it doesn't have write permission and fails.
To illustrate this, the prefix rule is some/path/
but certmagic checks for permission at some/path
, which is correctly denied.There are two possible solutions on the top of my head, but this PR is the better one. Simply join paths like what average people expected. I want double slashes in the middle of file paths; said no one ever.
This thing messed up my setup.
I believe this is the proper way to join paths.
Warning: untested code; I have no professional Golang experience.