Package s3post signs POST policy documents for browser-based file uploads to AWS S3. More details on browser-based file uploads can be found in the AWS docs.
Both s3post
and policy
packages use only stdlib deps, no aws sdk required.
To use this package, generate a POST policy document then pass that policy into the Sign method to receive a signature to be used in a POST form.
Details on Policy documents can be found in the AWS docs.
The policy package can be used to generate these documents if necessary.
p := s3post.New("us-east-1", secret)
encoded, signed := p.Sign(policyBytes)
See the examples folder for complete usage.
The policy document is signed using this calculation: