Skip to content

Commit

Permalink
Merge branch 'main' into danny/redacted-url-in-logs
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed May 30, 2024
2 parents b2aee50 + 86e852d commit 8a28c57
Show file tree
Hide file tree
Showing 20 changed files with 785 additions and 123 deletions.
55 changes: 0 additions & 55 deletions .circleci/config.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
19 changes: 19 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: actionlint

on:
push:
paths:
- .github/**

permissions:
contents: read

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: "Check GitHub workflow files"
uses: docker://docker.mirror.hashicorp.services/rhysd/actionlint:latest
with:
args: -color
23 changes: 23 additions & 0 deletions .github/workflows/pr-gofmt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Go format check
on:
pull_request:
types: ['opened', 'synchronize']

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: ./.go-version

- name: Run go format
run: |-
files=$(gofmt -s -l .)
if [ -n "$files" ]; then
echo >&2 "The following file(s) are not gofmt compliant:"
echo >&2 "$files"
exit 1
fi
17 changes: 17 additions & 0 deletions .github/workflows/pr-unit-tests-1.19.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Unit tests (Go 1.19)
on:
pull_request:
types: ['opened', 'synchronize']

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: 1.19

- name: Run unit tests
run: make test
17 changes: 17 additions & 0 deletions .github/workflows/pr-unit-tests-1.20.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Unit tests (Go 1.20+)
on:
pull_request:
types: ['opened', 'synchronize']

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: 1.22

- name: Run unit tests
run: make test
1 change: 1 addition & 0 deletions .go-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.22.2
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## 0.7.6 (May 9, 2024)

ENHANCEMENTS:

- client: support a `RetryPrepare` function for modifying the request before retrying (#216)
- client: support HTTP-date values for `Retry-After` header value (#138)
- client: avoid reading entire body when the body is a `*bytes.Reader` (#197)

BUG FIXES:

- client: fix a broken check for invalid server certificate in go 1.20+ (#210)

## 0.7.5 (Nov 8, 2023)

BUG FIXES:

- client: fixes an issue where the request body is not preserved on temporary redirects or re-established HTTP/2 connections (#207)

## 0.7.4 (Jun 6, 2023)

BUG FIXES:

- client: fixing an issue where the Content-Type header wouldn't be sent with an empty payload when using HTTP/2 (#194)

## 0.7.3 (May 15, 2023)

Initial release
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @hashicorp/go-retryablehttp-maintainers
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Copyright (c) 2015 HashiCorp, Inc.

Mozilla Public License, version 2.0

1. Definitions
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default: test

test:
go vet ./...
go test -race ./...
go test -v -race ./...

updatedeps:
go get -f -t -u ./...
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ standardClient := retryClient.StandardClient() // *http.Client
```

For more usage and examples see the
[godoc](http://godoc.org/github.com/hashicorp/go-retryablehttp).
[pkg.go.dev](https://pkg.go.dev/github.com/hashicorp/go-retryablehttp).
14 changes: 14 additions & 0 deletions cert_error_go119.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

//go:build !go1.20
// +build !go1.20

package retryablehttp

import "crypto/x509"

func isCertError(err error) bool {
_, ok := err.(x509.UnknownAuthorityError)
return ok
}
14 changes: 14 additions & 0 deletions cert_error_go120.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

//go:build go1.20
// +build go1.20

package retryablehttp

import "crypto/tls"

func isCertError(err error) bool {
_, ok := err.(*tls.CertificateVerificationError)
return ok
}
Loading

0 comments on commit 8a28c57

Please sign in to comment.