-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[fips140][configurablehttpprovider.TestFunctionalityDownloadFileHTTPS] Skip test if GODEBUG=fips140=only is set
#14076
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
Open
ycombinator
wants to merge
7
commits into
open-telemetry:main
Choose a base branch
from
ycombinator:fips-skip-sha1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9a5781b
Skip tests using generateCertificate when GODEBUG=fips140=only is set
ycombinator 51635fc
Running make goporto
ycombinator 87349a7
Add separate module for test utilities
ycombinator d572257
Move FIPS test utility into internal/testutil module
ycombinator 3aba4a9
Update usage
ycombinator 3ce3098
Adding Makefile
ycombinator e6d6ad6
Add replace statement to point to relative path
ycombinator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| include ../../Makefile.Common |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ## Test Utilities | ||
|
|
||
| The `go.opentelemetry.io/collector/internal/testutil` module provides utility functions, etc. for use by tests in other | ||
| OpenTelemetry Collector modules. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package testutil // import "go.opentelemetry.io/collector/internal/testutil" | ||
|
|
||
| import ( | ||
| "os" | ||
| "strings" | ||
| "testing" | ||
| ) | ||
|
|
||
| // SkipIfFIPSOnly will mark the passed test as skipped if GODEBUG=fips140=only is detected. | ||
| // If GODEBUG=fips140=on, go may call non-compliant algorithms and the test does not need to be skipped. | ||
| func SkipIfFIPSOnly(t *testing.T, msg string) { | ||
| // NOTE: This only checks env var; at the time of writing fips140 can only be set via env | ||
| // other GODEBUG settings can be set via embedded comments or in go.mod, we may need to account for this in the future. | ||
| s := os.Getenv("GODEBUG") | ||
| if strings.Contains(s, "fips140=only") { | ||
| t.Skip("GODEBUG=fips140=only detected, skipping test:", msg) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| module go.opentelemetry.io/collector/internal/testutil | ||
|
|
||
| go 1.24.0 | ||
|
|
||
| require ( | ||
| github.com/stretchr/testify v1.11.1 | ||
| go.uber.org/goleak v1.3.0 | ||
| ) | ||
|
|
||
| require ( | ||
| github.com/davecgh/go-spew v1.1.1 // indirect | ||
| github.com/kr/text v0.2.0 // indirect | ||
| github.com/pmezard/go-difflib v1.0.0 // indirect | ||
| gopkg.in/yaml.v3 v3.0.1 // indirect | ||
| ) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own education: is the
GOFIPS140env variable only used for deciding the version but not for enabling/disabling then?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that the
GOFIPS140environment variable is used to select the version of the Go Cryptographic Module to use but, as of now, none of these versions are validated as being FIPS-compliant (mentioned further down in the same doc). So, IMO, there is no benefit to setting this variable, again, as of now.