Skip to content

Commit

Permalink
Lift distribution from v2 to v3. (#467)
Browse files Browse the repository at this point in the history
* v2 -> v3

* Increase version within Makefile

---------

Co-authored-by: JanHoefelmeyer <[email protected]>
  • Loading branch information
s-l-teichmann and JanHoefelmeyer authored Sep 27, 2023
1 parent 703127a commit 7a8cdb6
Show file tree
Hide file tree
Showing 44 changed files with 96 additions and 72 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ testsemver:


# Set -ldflags parameter to pass the semversion.
LDFLAGS = -ldflags "-X github.com/csaf-poc/csaf_distribution/v2/util.SemVersion=$(SEMVER)"
LDFLAGS = -ldflags "-X github.com/csaf-poc/csaf_distribution/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 Down
2 changes: 1 addition & 1 deletion cmd/csaf_aggregator/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"io"
"net/http"

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

var errNotFound = errors.New("not found")
Expand Down
12 changes: 6 additions & 6 deletions cmd/csaf_aggregator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import (
"time"

"github.com/ProtonMail/gopenpgp/v2/crypto"
"github.com/csaf-poc/csaf_distribution/v2/csaf"
"github.com/csaf-poc/csaf_distribution/v2/internal/certs"
"github.com/csaf-poc/csaf_distribution/v2/internal/filter"
"github.com/csaf-poc/csaf_distribution/v2/internal/models"
"github.com/csaf-poc/csaf_distribution/v2/internal/options"
"github.com/csaf-poc/csaf_distribution/v2/util"
"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/internal/models"
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
"github.com/csaf-poc/csaf_distribution/v3/util"
"golang.org/x/time/rate"
)

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/v2/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util"
"github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/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 @@ -20,8 +20,8 @@ import (
"strings"
"time"

"github.com/csaf-poc/csaf_distribution/v2/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util"
"github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/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 @@ -25,8 +25,8 @@ import (
"sync"
"time"

"github.com/csaf-poc/csaf_distribution/v2/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util"
"github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/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/v2/util"
"github.com/csaf-poc/csaf_distribution/v3/util"
)

type lazyTransaction struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/csaf_aggregator/lister.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ package main
import (
"fmt"

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

// mirrorAllowed checks if mirroring is allowed.
Expand Down
2 changes: 1 addition & 1 deletion cmd/csaf_aggregator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"os"
"path/filepath"

"github.com/csaf-poc/csaf_distribution/v2/internal/options"
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
"github.com/gofrs/flock"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/csaf_aggregator/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
"github.com/ProtonMail/gopenpgp/v2/constants"
"github.com/ProtonMail/gopenpgp/v2/crypto"

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

// mirrorAllowed checks if mirroring is allowed.
Expand Down
5 changes: 3 additions & 2 deletions cmd/csaf_aggregator/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import (
"path/filepath"

"github.com/ProtonMail/gopenpgp/v2/crypto"
"github.com/csaf-poc/csaf_distribution/v2/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util"

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

type processor struct {
Expand Down
8 changes: 4 additions & 4 deletions cmd/csaf_checker/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
"fmt"
"net/http"

"github.com/csaf-poc/csaf_distribution/v2/internal/certs"
"github.com/csaf-poc/csaf_distribution/v2/internal/filter"
"github.com/csaf-poc/csaf_distribution/v2/internal/models"
"github.com/csaf-poc/csaf_distribution/v2/internal/options"
"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/internal/models"
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
)

type outputFormat string
Expand Down
3 changes: 2 additions & 1 deletion cmd/csaf_checker/links.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import (
"net/url"

"github.com/PuerkitoBio/goquery"
"github.com/csaf-poc/csaf_distribution/v2/util"

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

type (
Expand Down
8 changes: 8 additions & 0 deletions cmd/csaf_checker/links_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
// 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 (
Expand Down
2 changes: 1 addition & 1 deletion cmd/csaf_checker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package main
import (
"log"

"github.com/csaf-poc/csaf_distribution/v2/internal/options"
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
)

// run uses a processor to check all the given domains or direct urls
Expand Down
4 changes: 2 additions & 2 deletions cmd/csaf_checker/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
"github.com/ProtonMail/gopenpgp/v2/crypto"
"golang.org/x/time/rate"

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

// topicMessages stores the collected topicMessages for a specific topic.
Expand Down
4 changes: 2 additions & 2 deletions cmd/csaf_checker/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"os"
"time"

"github.com/csaf-poc/csaf_distribution/v2/csaf"
"github.com/csaf-poc/csaf_distribution/v2/internal/models"
"github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v3/internal/models"
)

// MessageType is the kind of the message.
Expand Down
2 changes: 1 addition & 1 deletion cmd/csaf_checker/reporters.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"sort"
"strings"

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

type (
Expand Down
4 changes: 2 additions & 2 deletions cmd/csaf_checker/roliecheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"sort"
"strings"

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

// identifier consist of document/tracking/id and document/publisher/namespace,
Expand Down
2 changes: 1 addition & 1 deletion cmd/csaf_checker/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"fmt"
"sort"

"github.com/csaf-poc/csaf_distribution/v2/csaf"
"github.com/csaf-poc/csaf_distribution/v3/csaf"
)

type ruleCondition int
Expand Down
8 changes: 4 additions & 4 deletions cmd/csaf_downloader/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"path/filepath"
"time"

"github.com/csaf-poc/csaf_distribution/v2/internal/certs"
"github.com/csaf-poc/csaf_distribution/v2/internal/filter"
"github.com/csaf-poc/csaf_distribution/v2/internal/models"
"github.com/csaf-poc/csaf_distribution/v2/internal/options"
"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/internal/models"
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions cmd/csaf_downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import (
"github.com/ProtonMail/gopenpgp/v2/crypto"
"golang.org/x/time/rate"

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

type downloader struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/csaf_downloader/forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"path/filepath"
"strings"

"github.com/csaf-poc/csaf_distribution/v2/internal/misc"
"github.com/csaf-poc/csaf_distribution/v2/util"
"github.com/csaf-poc/csaf_distribution/v3/internal/misc"
"github.com/csaf-poc/csaf_distribution/v3/util"
)

// failedForwardDir is the name of the special sub folder
Expand Down
2 changes: 1 addition & 1 deletion cmd/csaf_downloader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"os"
"os/signal"

"github.com/csaf-poc/csaf_distribution/v2/internal/options"
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
)

func run(cfg *config, domains []string) error {
Expand Down
5 changes: 3 additions & 2 deletions cmd/csaf_provider/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import (
"github.com/ProtonMail/gopenpgp/v2/armor"
"github.com/ProtonMail/gopenpgp/v2/constants"
"github.com/ProtonMail/gopenpgp/v2/crypto"
"github.com/csaf-poc/csaf_distribution/v2/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util"

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

const dateFormat = time.RFC3339
Expand Down
3 changes: 2 additions & 1 deletion cmd/csaf_provider/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import (

"github.com/BurntSushi/toml"
"github.com/ProtonMail/gopenpgp/v2/crypto"
"github.com/csaf-poc/csaf_distribution/v2/csaf"
"golang.org/x/crypto/bcrypt"

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

const (
Expand Down
5 changes: 3 additions & 2 deletions cmd/csaf_provider/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ import (
"unicode"

"github.com/ProtonMail/gopenpgp/v2/crypto"
"github.com/csaf-poc/csaf_distribution/v2/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util"

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

// ensureFolders initializes the paths and call functions to create
Expand Down
2 changes: 1 addition & 1 deletion cmd/csaf_provider/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"crypto/sha512"
"os"

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

func writeHashedFile(fname, name string, data []byte, armored string) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/csaf_provider/indices.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"sort"
"time"

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

func updateIndex(dir, fname string) error {
Expand Down
3 changes: 2 additions & 1 deletion cmd/csaf_provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import (
"net/http/cgi"
"os"

"github.com/csaf-poc/csaf_distribution/v2/util"
"github.com/jessevdk/go-flags"

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

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

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

// mergeCategories merges the given categories into the old ones.
Expand Down
4 changes: 2 additions & 2 deletions cmd/csaf_provider/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"os"
"path/filepath"

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

func doTransaction(
Expand Down
5 changes: 3 additions & 2 deletions cmd/csaf_uploader/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ import (
"os"

"github.com/ProtonMail/gopenpgp/v2/crypto"
"github.com/csaf-poc/csaf_distribution/v2/internal/certs"
"github.com/csaf-poc/csaf_distribution/v2/internal/options"
"golang.org/x/crypto/bcrypt"
"golang.org/x/term"

"github.com/csaf-poc/csaf_distribution/v3/internal/certs"
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/csaf_uploader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Implements a command line tool that uploads csaf documents to csaf_provider.
package main

import "github.com/csaf-poc/csaf_distribution/v2/internal/options"
import "github.com/csaf-poc/csaf_distribution/v3/internal/options"

func main() {
args, cfg, err := parseArgsConfig()
Expand Down
6 changes: 3 additions & 3 deletions cmd/csaf_uploader/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"github.com/ProtonMail/gopenpgp/v2/constants"
"github.com/ProtonMail/gopenpgp/v2/crypto"

"github.com/csaf-poc/csaf_distribution/v2/csaf"
"github.com/csaf-poc/csaf_distribution/v2/internal/misc"
"github.com/csaf-poc/csaf_distribution/v2/util"
"github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v3/internal/misc"
"github.com/csaf-poc/csaf_distribution/v3/util"
)

type processor struct {
Expand Down
5 changes: 3 additions & 2 deletions cmd/csaf_validator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import (
"os"
"path/filepath"

"github.com/csaf-poc/csaf_distribution/v2/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util"
"github.com/jessevdk/go-flags"

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

type options struct {
Expand Down
Loading

0 comments on commit 7a8cdb6

Please sign in to comment.