mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-08-23 03:48:35 +00:00
fix(api): set min TLS version 1.3, secure HTTP-only cookie (#596)
* fix(api): set min TLS version 1.3, secure HTTP-only cookie * remove `all-tests-passed` job --------- Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
parent
bd09fd3d6e
commit
16ebf30a79
4
.github/workflows/golangci-lint.yml
vendored
4
.github/workflows/golangci-lint.yml
vendored
@ -18,9 +18,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: dorny/paths-filter@v2.2.1
|
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 #v2.2.1
|
||||||
id: filter
|
id: filter
|
||||||
with:
|
with:
|
||||||
filters: |
|
filters: |
|
||||||
|
11
.github/workflows/test.yml
vendored
11
.github/workflows/test.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
- uses: dorny/paths-filter@v2.2.1
|
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 #v2.2.1
|
||||||
id: filter
|
id: filter
|
||||||
with:
|
with:
|
||||||
filters: |
|
filters: |
|
||||||
@ -49,7 +49,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
- uses: dorny/paths-filter@v2.2.1
|
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 #v2.2.1
|
||||||
id: filter
|
id: filter
|
||||||
with:
|
with:
|
||||||
filters: |
|
filters: |
|
||||||
@ -70,10 +70,3 @@ jobs:
|
|||||||
if: steps.filter.outputs.go == 'true'
|
if: steps.filter.outputs.go == 'true'
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
run: go test -v -cover ./...
|
run: go test -v -cover ./...
|
||||||
|
|
||||||
all-tests-passed:
|
|
||||||
name: All Tests Passed
|
|
||||||
needs: test
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- run: echo "PASS"
|
|
||||||
|
@ -75,6 +75,7 @@ func NewConnection(endpoint string, insecure bool) (*Connection, error) {
|
|||||||
|
|
||||||
var transport http.RoundTripper = &http.Transport{
|
var transport http.RoundTripper = &http.Transport{
|
||||||
TLSClientConfig: &tls.Config{
|
TLSClientConfig: &tls.Config{
|
||||||
|
MinVersion: tls.VersionTLS13,
|
||||||
InsecureSkipVerify: insecure, //nolint:gosec
|
InsecureSkipVerify: insecure, //nolint:gosec
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,9 @@ func (t *ticketAuthenticator) AuthenticateRequest(ctx context.Context, req *http
|
|||||||
}
|
}
|
||||||
|
|
||||||
req.AddCookie(&http.Cookie{
|
req.AddCookie(&http.Cookie{
|
||||||
|
HttpOnly: true,
|
||||||
Name: "PVEAuthCookie",
|
Name: "PVEAuthCookie",
|
||||||
|
Secure: true,
|
||||||
Value: *a.Ticket,
|
Value: *a.Ticket,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -382,6 +382,7 @@ func fileCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag
|
|||||||
httpClient := http.Client{
|
httpClient := http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
TLSClientConfig: &tls.Config{
|
TLSClientConfig: &tls.Config{
|
||||||
|
MaxVersion: tls.VersionTLS13,
|
||||||
InsecureSkipVerify: sourceFileInsecure,
|
InsecureSkipVerify: sourceFileInsecure,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user