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

Add: upstream changes #65

Merged
merged 82 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
a131b0f
Improve SHA* marking
koplas Jul 25, 2024
be2e4e7
Improve hash path handling of directory feeds
koplas Jul 31, 2024
37c9eaf
Add CLI flags to specify what hash is preferred
koplas Sep 9, 2024
c0de0c2
Check if hash present, before sending a request
koplas Sep 27, 2024
f7dc3f5
Use .test TLD for integration setup (#577)
koplas Sep 29, 2024
18e2e35
Update README.md with link update alert
bernhardreiter Oct 29, 2024
bdd8aa0
Update README.md
bernhardreiter Oct 29, 2024
bf057e2
Update repo move alert in README.md
bernhardreiter Oct 30, 2024
6ebe7f5
Update repo move alert in README.md
bernhardreiter Oct 30, 2024
7aa95c0
fix: bring aggregator schema to errata01 (#583)
s-l-teichmann Oct 30, 2024
1aad533
Update README.md
bernhardreiter Oct 30, 2024
1c860a1
Update README.md: Fix: typo
JanHoefelmeyer Oct 30, 2024
91207f2
Merge pull request #581 from gocsaf/repomove-alert
JanHoefelmeyer Oct 30, 2024
ffadad3
improve test setupscript by adding missing zip
bernhardreiter Oct 30, 2024
e8706e5
feat: perform go path repo move
bernhardreiter Oct 30, 2024
3e9b5e1
Merge pull request #584 from gocsaf/dev-12
JanHoefelmeyer Nov 5, 2024
ace8aea
fix: build-in version for release tags
bernhardreiter Nov 15, 2024
1e3504c
improve Makefile improvement
bernhardreiter Nov 15, 2024
c00dc36
Remove `-h` for preferred hash configuration
koplas Nov 21, 2024
de047b7
Feat: Add prefered hash to downloader docs
JanHoefelmeyer Nov 21, 2024
01645f5
Fix: Update downloader docs
JanHoefelmeyer Nov 21, 2024
fe4f01d
fix: Link to file was not working (#592)
JanHoefelmeyer Nov 22, 2024
f6d7589
Add required upload permissions
koplas Nov 22, 2024
9495d8b
Update Go 3rd party libs
s-l-teichmann Nov 22, 2024
7824f3b
Improve hash fetching and logging
koplas Nov 22, 2024
b218084
Update README.md that go paths can be adjusted
bernhardreiter Nov 25, 2024
a167bf6
Add Apache 2.0 license to root folder
koplas Nov 25, 2024
3dc84f3
Merge pull request #598 from gocsaf/docs-readme-12
JanHoefelmeyer Nov 26, 2024
2435abe
Merge pull request #594 from gocsaf/update_go_3rd_party_libs_2024_11_22
JanHoefelmeyer Nov 26, 2024
678f232
Merge pull request #593 from gocsaf/add-upload-permission
JanHoefelmeyer Nov 27, 2024
ffb4eff
Merge unittest into sha-handling
koplas Nov 27, 2024
a5f4b10
Merge branch 'main' into sha-handling
koplas Nov 27, 2024
56509bb
Use new path in tests
koplas Nov 27, 2024
b8a9803
fix docs link to standard
bernhardreiter Nov 28, 2024
18af28f
Merge pull request #600 from gocsaf/docs-proxy-for-2
JanHoefelmeyer Dec 2, 2024
1daaed2
ensure HTTP requests use proxy env vars (#597)
ncsc-ie-devs Dec 2, 2024
57953e4
Warn if no remote validator was specified
koplas Dec 4, 2024
938ceb8
Return exit code based on validation result
koplas Dec 4, 2024
16e8605
Be more precise about exit codes.
s-l-teichmann Dec 4, 2024
a51964b
Add initial csaf_checker provider test
koplas Dec 4, 2024
5b6af7a
WIP: Add requirement tests
koplas Dec 4, 2024
68bd046
Add requirement checker test data
koplas Dec 6, 2024
df65ad1
Fix: return correct exit code
koplas Dec 10, 2024
fc404e4
Unfix: Add should-states
JanHoefelmeyer Dec 13, 2024
a3d6d6a
Downgrade error to info in directory hash fetching
koplas Dec 13, 2024
ebd9601
Revert new requirement 17 test
koplas Dec 13, 2024
9dd4b7f
Add tests for no hash given or available
koplas Dec 13, 2024
b1a7620
Extend processor SHA fetching tests
koplas Dec 16, 2024
d38150c
Add testdata for individual hash forbidden tests
koplas Dec 16, 2024
bc5d149
Use exit code 1 for general errors, fix documentation
koplas Dec 16, 2024
95ff418
fix: Content-Type header for JSON responses
bernhardreiter Dec 18, 2024
d8e9035
Warn only if the other hash could be fetched
koplas Dec 18, 2024
8fc7f5b
Make documentation more explicit
koplas Jan 7, 2025
b8a5fa7
Fix nil check in downloader
koplas Jan 8, 2025
9275a37
Format
koplas Jan 8, 2025
b6721e1
Add check for missing either sha256 or sha512 hashes only
JanHoefelmeyer Jan 10, 2025
5907a39
Merge pull request #605 from gocsaf/dev-17
koplas Jan 17, 2025
028f468
Fix typo in error message
koplas Jan 23, 2025
59d2cef
Fix typos
koplas Jan 23, 2025
93c1a0b
Merge pull request #611 from gocsaf/label-type
cintek Jan 23, 2025
6e8c2ec
Check remote validator even if file validation fails
koplas Jan 23, 2025
8e5236a
Merge pull request #602 from gocsaf/remote-validator-warn
koplas Jan 23, 2025
ed22136
Merge pull request #599 from gocsaf/copy-license
cintek Jan 23, 2025
84026b6
Update README.md to exchange csaf.io until it is fixed
bernhardreiter Jan 28, 2025
69df4c0
Merge pull request #612 from gocsaf/bernhardreiter-patch-1
JanHoefelmeyer Jan 29, 2025
7d74543
Fix: Now give errors if lookup methods fail, refactor accordingly
JanHoefelmeyer Jan 29, 2025
02787b2
Update comments, clean up security check
JanHoefelmeyer Jan 29, 2025
82a6929
Fix: Poor phrasing corrected
JanHoefelmeyer Jan 29, 2025
c208a8f
Merge pull request #613 from gocsaf/errorsForLookupChecks
JanHoefelmeyer Feb 7, 2025
6e02de9
update release workflow dependencies and so glibc
bernhardreiter Feb 25, 2025
a4a90f4
update go version to 1.23
bernhardreiter Feb 25, 2025
3afa8d8
Upgrade to artifact action v4
koplas Feb 25, 2025
20fdffa
Merge pull request #615 from gocsaf/dev-19
JanHoefelmeyer Mar 3, 2025
e91bdec
Add example for iterating product id and product helper (#617)
koplas Mar 3, 2025
1d1c569
Merge branch 'main' into sha-handling
koplas Mar 5, 2025
24f9af7
Add documentation for externally signed documents
koplas Mar 5, 2025
900dced
Merge pull request #619 from gocsaf/uploader-signed-docu
koplas Mar 6, 2025
ec0c3f9
Fix potential leak of HTTP response body in downloadJSON of csaf_aggr…
marcusperlick Mar 10, 2025
3e16741
Merge pull request #554 from gocsaf/sha-handling
koplas Mar 10, 2025
d867dc1
Merge branch 'main' into merge-upstream
mgoetzegb Mar 11, 2025
1042e76
change back paths to non-internal
mgoetzegb Mar 11, 2025
180ee4a
fix wrongly resolved merge conflicts
mgoetzegb Mar 11, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/itest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.0
go-version: '^1.23.6'

- name: Set up Node.js
uses: actions/setup-node@v4
Expand All @@ -25,7 +25,7 @@ jobs:
sudo apt install -y make nginx fcgiwrap gnutls-bin
cp -r $GITHUB_WORKSPACE ~
cd ~
cd csaf_distribution/docs/scripts/
cd csaf/docs/scripts/
# keep in sync with docs/scripts/Readme.md
export FOLDERNAME=devca1 ORGANAME="CSAF Tools Development (internal)"
source ./TLSConfigsForITest.sh
Expand Down
73 changes: 73 additions & 0 deletions LICENSE-Apache-2.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.

"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:

(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.

You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# SPDX-FileCopyrightText: 2021 German Federal Office for Information Security (BSI) <https://www.bsi.bund.de>
# Software-Engineering: 2021 Intevation GmbH <https://intevation.de>
#
# Makefile to build csaf_distribution components
# Makefile to build csaf components

SHELL = /bin/bash
BUILD = go build
Expand Down Expand Up @@ -41,7 +41,7 @@ tag_checked_out:
# into a semver version. For this we increase the PATCH number, so that
# any commit after a tag is considered newer than the semver from the tag
# without an optional 'v'
# Note we need `--tags` because github release only creates lightweight tags
# Note we need `--tags` because github releases only create lightweight tags
# (see feature request https://github.com/github/feedback/discussions/4924).
# We use `--always` in case of being run as github action with shallow clone.
# In this case we might in some situations see an error like
Expand All @@ -50,16 +50,16 @@ tag_checked_out:
GITDESC := $(shell git describe --tags --always)
GITDESCPATCH := $(shell echo '$(GITDESC)' | sed -E 's/v?[0-9]+\.[0-9]+\.([0-9]+)[-+]?.*/\1/')
SEMVERPATCH := $(shell echo $$(( $(GITDESCPATCH) + 1 )))
# Hint: The regexp in the next line only matches if there is a hyphen (`-`)
# followed by a number, by which we assume that git describe
# has added a string after the tag
SEMVER := $(shell echo '$(GITDESC)' | sed -E 's/v?([0-9]+\.[0-9]+\.)([0-9]+)(-[1-9].*)/\1$(SEMVERPATCH)\3/' )
# Hint: The second regexp in the next line only matches
# if there is a hyphen (`-`) followed by a number,
# by which we assume that git describe has added a string after the tag
SEMVER := $(shell echo '$(GITDESC)' | sed -E -e 's/^v//' -e 's/([0-9]+\.[0-9]+\.)([0-9]+)(-[1-9].*)/\1$(SEMVERPATCH)\3/' )
testsemver:
@echo from \'$(GITDESC)\' transformed to \'$(SEMVER)\'


# Set -ldflags parameter to pass the semversion.
LDFLAGS = -ldflags "-X github.com/csaf-poc/csaf_distribution/v3/util.SemVersion=$(SEMVER)"
LDFLAGS = -ldflags "-X github.com/gocsaf/csaf/v3/util.SemVersion=$(SEMVER)"

# Build binaries and place them under bin-$(GOOS)-$(GOARCH)
# Using 'Target-specific Variable Values' to specify the build target system
Expand All @@ -78,7 +78,7 @@ build_linux build_win build_mac_amd64 build_mac_arm64:
env GOARCH=$(GOARCH) GOOS=$(GOOS) $(BUILD) -o $(BINDIR) $(LDFLAGS) -v ./cmd/...


DISTDIR := csaf_distribution-$(SEMVER)
DISTDIR := csaf-$(SEMVER)
dist: build_linux build_win build_mac_amd64 build_mac_arm64
mkdir -p dist
mkdir -p dist/$(DISTDIR)-windows-amd64/bin-windows-amd64
Expand Down
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@
Software-Engineering: 2024 Intevation GmbH <https://intevation.de>
-->

# csaf_distribution

Implements a [CSAF](https://csaf.io/)
> [!IMPORTANT]
> To avoid future breakage, if you still use `csaf-poc`:
> 1. Adjust your HTML links.
> 2. Adjust your go module paths, see [#579](https://github.com/gocsaf/csaf/issues/579#issuecomment-2497244379).
>
> (This repository was moved here on 2024-10-28. The old one is deprecated
> and redirection will be switched off a few months later.)


# csaf

Implements a [CSAF](https://oasis-open.github.io/csaf-documentation/)
([specification v2.0](https://docs.oasis-open.org/csaf/csaf/v2.0/os/csaf-v2.0-os.html)
and its [errata](https://docs.oasis-open.org/csaf/csaf/v2.0/csaf-v2.0.html))
trusted provider, checker, aggregator and downloader.
Expand Down Expand Up @@ -42,10 +52,10 @@ is a CSAF Aggregator, to list or mirror providers.
## Other stuff

### [examples](./examples/README.md)
are small examples of how to use `github.com/csaf-poc/csaf_distribution`
are small examples of how to use `github.com/gocsaf/csaf`
as an API. Currently this is a work in progress, as usage of this repository
as a library to access is _not officially supported_, e.g.
see https://github.com/csaf-poc/csaf_distribution/issues/367 .
see https://github.com/gocsaf/csaf/issues/367 .

## Setup
Binaries for the server side are only available and tested
Expand All @@ -69,9 +79,9 @@ Download the binaries from the most recent release assets on Github.

### Build from sources

- A recent version of **Go** (1.22+) should be installed. [Go installation](https://go.dev/doc/install)
- A recent version of **Go** (1.23+) should be installed. [Go installation](https://go.dev/doc/install)

- Clone the repository `git clone https://github.com/csaf-poc/csaf_distribution.git `
- Clone the repository `git clone https://github.com/gocsaf/csaf.git `

- Build Go components Makefile supplies the following targets:
- Build for GNU/Linux system: `make build_linux`
Expand Down Expand Up @@ -100,7 +110,7 @@ For further details of the development process consult our [development page](./

## License

- `csaf_distribution` is licensed as Free Software under the terms of the [Apache License, Version 2.0](./LICENSES/Apache-2.0.txt).
- `csaf` is licensed as Free Software under the terms of the [Apache License, Version 2.0](./LICENSES/Apache-2.0.txt).

- See the specific source files
for details, the license itself can be found in the directory `LICENSES/`.
Expand Down
14 changes: 8 additions & 6 deletions cmd/csaf_aggregator/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,25 @@ package main

import (
"errors"
"fmt"
"io"
"net/http"

"github.com/csaf-poc/csaf_distribution/v3/util"
"github.com/gocsaf/csaf/v3/util"
)

var errNotFound = errors.New("not found")

func downloadJSON(c util.Client, url string, found func(io.Reader) error) error {
res, err := c.Get(url)
if err != nil || res.StatusCode != http.StatusOK ||
if err != nil {
return fmt.Errorf("not found: %w", err)
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK ||
res.Header.Get("Content-Type") != "application/json" {
// ignore this as it is expected.
return errNotFound
}
return func() error {
defer res.Body.Close()
return found(res.Body)
}()
return found(res.Body)
}
67 changes: 67 additions & 0 deletions cmd/csaf_aggregator/client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// This file is Free Software under the MIT License
// without warranty, see README.md and LICENSES/MIT.txt for details.
//
// SPDX-License-Identifier: MIT
//
// SPDX-FileCopyrightText: 2022 German Federal Office for Information Security (BSI) <https://www.bsi.bund.de>
// Software-Engineering: 2022 Intevation GmbH <https://intevation.de>

package main

import (
"io"
"net/http"
"net/http/httptest"
"testing"

"github.com/gocsaf/csaf/v3/util"
)

func Test_downloadJSON(t *testing.T) {
tests := []struct {
name string
statusCode int
contentType string
wantErr error
}{
{
name: "status ok, application/json",
statusCode: http.StatusOK,
contentType: "application/json",
wantErr: nil,
},
{
name: "status found, application/json",
statusCode: http.StatusFound,
contentType: "application/json",
wantErr: errNotFound,
},
{
name: "status ok, application/xml",
statusCode: http.StatusOK,
contentType: "application/xml",
wantErr: errNotFound,
},
}

t.Parallel()
for _, testToRun := range tests {
test := testToRun
t.Run(test.name, func(tt *testing.T) {
tt.Parallel()
found := func(r io.Reader) error {
return nil
}
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Content-Type", test.contentType)
w.WriteHeader(test.statusCode)
}))
defer server.Close()
hClient := http.Client{}
client := util.Client(&hClient)
if gotErr := downloadJSON(client, server.URL, found); gotErr != test.wantErr {
t.Errorf("downloadJSON: Expected %q but got %q.", test.wantErr, gotErr)
}
})
}
}
13 changes: 7 additions & 6 deletions cmd/csaf_aggregator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import (
"time"

"github.com/ProtonMail/gopenpgp/v2/crypto"
"github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v3/internal/certs"
"github.com/csaf-poc/csaf_distribution/v3/internal/filter"
"github.com/csaf-poc/csaf_distribution/v3/pkg/models"
"github.com/csaf-poc/csaf_distribution/v3/pkg/options"
"github.com/csaf-poc/csaf_distribution/v3/util"
"github.com/gocsaf/csaf/v3/csaf"
"github.com/gocsaf/csaf/v3/internal/certs"
"github.com/gocsaf/csaf/v3/internal/filter"
"github.com/gocsaf/csaf/v3/pkg/models"
"github.com/gocsaf/csaf/v3/pkg/options"
"github.com/gocsaf/csaf/v3/util"
"golang.org/x/time/rate"
)

Expand Down Expand Up @@ -284,6 +284,7 @@ func (c *config) httpClient(p *provider) util.Client {

hClient.Transport = &http.Transport{
TLSClientConfig: &tlsConfig,
Proxy: http.ProxyFromEnvironment,
}

client := util.Client(&hClient)
Expand Down
4 changes: 2 additions & 2 deletions cmd/csaf_aggregator/full.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"sync"
"time"

"github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v3/util"
"github.com/gocsaf/csaf/v3/csaf"
"github.com/gocsaf/csaf/v3/util"
)

type fullJob struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/csaf_aggregator/indices.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"strings"
"time"

"github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v3/util"
"github.com/gocsaf/csaf/v3/csaf"
"github.com/gocsaf/csaf/v3/util"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions cmd/csaf_aggregator/interim.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"sync"
"time"

"github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v3/util"
"github.com/gocsaf/csaf/v3/csaf"
"github.com/gocsaf/csaf/v3/util"
)

type interimJob struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/csaf_aggregator/lazytransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"os"
"path/filepath"

"github.com/csaf-poc/csaf_distribution/v3/util"
"github.com/gocsaf/csaf/v3/util"
)

type lazyTransaction struct {
Expand Down
Loading
Loading