You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Present makes the token available at `HTTP01ChallengePath(token)` by creating a file in the given s3 bucket.func (s*HTTPProvider) Present(domain, token, keyAuthstring) error {
ctx:=context.Background()
params:=&s3.PutObjectInput{
//ACL: "public-read",Bucket: aws.String(s.bucket),
Key: aws.String("acme"+http01.ChallengePath(token)),
Body: bytes.NewReader([]byte(keyAuth)),
}
_, err:=s.client.PutObject(ctx, params)
iferr!=nil {
returnfmt.Errorf("s3: failed to upload token to s3: %w", err)
}
returnnil
}
// CleanUp removes the file created for the challenge.func (s*HTTPProvider) CleanUp(domain, token, keyAuthstring) error {
ctx:=context.Background()
params:=&s3.DeleteObjectInput{
Bucket: aws.String(s.bucket),
Key: aws.String("acme"+http01.ChallengePath(token)),
}
_, err:=s.client.DeleteObject(ctx, params)
iferr!=nil {
returnfmt.Errorf("s3: could not remove file in s3 bucket after HTTP challenge: %w", err)
}
returnnil
}
The text was updated successfully, but these errors were encountered:
Welcome
How do you use lego?
Library
Detailed Description
reference: https://www.amazonaws.cn/articles/storage/object-acl-or-bucket-policy/
Additionally, the Key should also support configuring sub paths
The text was updated successfully, but these errors were encountered: