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

GolangCI-Lint Fixes #439

Merged
merged 19 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ before_install:
# `-mod=vendor` to use the vendored dependencies
install:
# Install `golangci-lint` using their installer script
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.56.2
# Install tools without `GO111MODULE` enabled so that we
# don't download Pebble's deps and just put the tools in our
# gobin.
Expand All @@ -56,6 +56,7 @@ script:
# Upload collected coverage profile to goveralls
- goveralls -coverprofile=coverage.out -service=travis-ci
# Perform a test issuance with chisel2.py
- pip install -r test/requirements.txt
- REQUESTS_CA_BUNDLE=./test/certs/pebble.minica.pem python ./test/chisel2.py example.letsencrypt.org elpmaxe.letsencrypt.org
# Run the load-generator briefly - note, because Pebble isn't using the
# load-generator's mock DNS server none of the issuances will succeed. This
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
image: Visual Studio 2019
image: Visual Studio 2022

hosts:
example.letsencrypt.org: 127.0.0.1
elpmaxe.letsencrypt.org: 127.0.0.1

environment:
PATH: C:\Python38;C:\msys64\mingw64\bin;%USERPROFILE%\go\bin;%PATH%
PATH: C:\Python39-x64;C:\msys64\mingw64\bin;%USERPROFILE%\go\bin;%PATH%
PEBBLE_WFE_NONCEREJECT: 0

# Declare artifacts that can become release assets on GitHub
Expand Down
1 change: 0 additions & 1 deletion cmd/pebble/main_test.go

This file was deleted.

9 changes: 2 additions & 7 deletions wfe/wfe.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ func New(
ca *ca.CAImpl,
strict, requireEAB bool, retryAfterAuthz int, retryAfterOrder int,
) WebFrontEndImpl {
// Seed rand from the current time so test environments don't always have
// the same nonce rejection and sleep time patterns.
rand.New(rand.NewSource(time.Now().UnixNano()))

// Read the % of good nonces that should be rejected as bad nonces from the
// environment
nonceErrPercentVal := os.Getenv(badNonceEnvVar)
Expand Down Expand Up @@ -611,7 +607,7 @@ func (wfe *WebFrontEndImpl) relativeEndpoint(request *http.Request, endpoint str
proto = "https"
}

// Allow upstream proxies to specify the forwarded protocol. Allow this value
// Allow upstream proxies to specify the forwarded protocol. Allow this value
// to override our own guess.
if specifiedProto := request.Header.Get("X-Forwarded-Proto"); specifiedProto != "" {
proto = specifiedProto
Expand Down Expand Up @@ -2529,8 +2525,7 @@ func addRetryAfterHeader(response http.ResponseWriter, second int) {
} else {
// IMF-fixdate
// see https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1
gmt, _ := time.LoadLocation("GMT")
currentTime := time.Now().In(gmt)
currentTime := time.Now().In(time.UTC)
retryAfter := currentTime.Add(time.Second * time.Duration(second))
response.Header().Add("Retry-After", retryAfter.Format(http.TimeFormat))
}
Expand Down