Skip to content

Commit a21d29d

Browse files
committed
review
1 parent e8d43c0 commit a21d29d

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

cmd/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func CreateFlags(defaultPath string) []cli.Flag {
8989
},
9090
&cli.StringFlag{
9191
Name: "http.s3-bucket",
92-
Usage: "Set the s3 bucket name to use for HTTP-01 based challenges. Challenges will be written to the s3 bucket.",
92+
Usage: "Set the S3 bucket name to use for HTTP-01 based challenges. Challenges will be written to the S3 bucket.",
9393
},
9494
&cli.BoolFlag{
9595
Name: "tls",

docs/data/zz_cli_help.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ GLOBAL OPTIONS:
3535
--http.proxy-header value Validate against this HTTP header when solving HTTP-01 based challenges behind a reverse proxy. (default: "Host")
3636
--http.webroot value Set the webroot folder to use for HTTP-01 based challenges to write directly to the .well-known/acme-challenge file. This disables the built-in server and expects the given directory to be publicly served with access to .well-known/acme-challenge
3737
--http.memcached-host value [ --http.memcached-host value ] Set the memcached host(s) to use for HTTP-01 based challenges. Challenges will be written to all specified hosts.
38-
--http.s3-bucket value Set the s3 bucket name to use for HTTP-01 based challenges. Challenges will be written to the s3 bucket.
38+
--http.s3-bucket value Set the S3 bucket name to use for HTTP-01 based challenges. Challenges will be written to the S3 bucket.
3939
--tls Use the TLS-ALPN-01 challenge to solve challenges. Can be mixed with other types of challenges. (default: false)
4040
--tls.port value Set the port and interface to use for TLS-ALPN-01 based challenges to listen on. Supported: interface:port or :port. (default: ":443")
4141
--dns value Solve a DNS-01 challenge using the specified provider. Can be mixed with other types of challenges. Run 'lego dnshelp' for help on usage.

providers/http/s3/s3.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Name = "Amazon Route S3"
1+
Name = "Amazon S3"
22
Description = ''''''
33
URL = "https://aws.amazon.com/s3/"
44
Code = "s3"
5-
Since = "v4.13.4"
5+
Since = "v4.14.0"
66

77
Example = '''
88
AWS_ACCESS_KEY_ID=your_key_id \
@@ -29,9 +29,10 @@ See also: https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/
2929
3030
### Broad privileges for testing purposes
3131
32-
Will need to create an s3 bucket which has read permissions set for Everyone(public access)
33-
The s3 bucket doesn't require static website hosting to be enabled
34-
AWS_REGION must match the region where the s3 bucket is hosted
32+
Will need to create an S3 bucket which has read permissions set for Everyone (public access).
33+
The S3 bucket doesn't require static website hosting to be enabled.
34+
AWS_REGION must match the region where the s3 bucket is hosted.
35+
'''
3536

3637
[Configuration]
3738
[Configuration.Credentials]
@@ -50,4 +51,4 @@ AWS_REGION must match the region where the s3 bucket is hosted
5051
[Links]
5152
API = "https://docs.aws.amazon.com/AmazonS3/latest/userguide//Welcome.html"
5253
GoClient = "https://docs.aws.amazon.com/sdk-for-go/"
53-
'''
54+

providers/http/s3/s3_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"fmt"
77
"io"
88
"net/http"
9+
"os"
910
"testing"
1011

11-
1212
"github.com/go-acme/lego/v4/challenge/http01"
1313
"github.com/go-acme/lego/v4/platform/tester"
1414
"github.com/stretchr/testify/assert"
@@ -27,7 +27,7 @@ var envTest = tester.NewEnvTest(
2727
"AWS_REGION",
2828
"S3_BUCKET")
2929

30-
func TestNewS3ProviderValid(t *testing.T) {
30+
func TestLiveNewHTTPProvider_Valid(t *testing.T) {
3131
if !envTest.IsLiveTest() {
3232
t.Skip("skipping live test")
3333
}
@@ -38,22 +38,23 @@ func TestNewS3ProviderValid(t *testing.T) {
3838
require.NoError(t, err)
3939
}
4040

41-
func TestLiveS3ProviderPresent(t *testing.T) {
41+
func TestLiveNewHTTPProvider(t *testing.T) {
4242
if !envTest.IsLiveTest() {
4343
t.Skip("skipping live test")
4444
}
4545

4646
envTest.RestoreEnv()
4747

48-
s3Bucket := envTest.GetValue("S3_BUCKET")
48+
s3Bucket := os.Getenv("S3_BUCKET")
4949

5050
provider, err := NewHTTPProvider(s3Bucket)
5151
require.NoError(t, err)
5252

53+
// Present
54+
5355
err = provider.Present(domain, token, keyAuth)
5456
require.NoError(t, err)
5557

56-
5758
chlgPath := fmt.Sprintf("http://%s.s3.%s.amazonaws.com%s",
5859
s3Bucket, envTest.GetValue("AWS_REGION"), http01.ChallengePath(token))
5960

@@ -67,11 +68,11 @@ func TestLiveS3ProviderPresent(t *testing.T) {
6768

6869
assert.Equal(t, []byte(keyAuth), data)
6970

71+
// CleanUp
72+
7073
err = provider.CleanUp(domain, token, keyAuth)
7174
require.NoError(t, err)
7275

73-
74-
7576
cleanupResp, err := http.Get(chlgPath)
7677
require.NoError(t, err)
7778

0 commit comments

Comments
 (0)