1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Lift distribution from v2 to v3. (#467)

* v2 -> v3

* Increase version within Makefile

---------

Co-authored-by: JanHoefelmeyer <hoefelmeyer.jan@gmail.com>
This commit is contained in:
Sascha L. Teichmann 2023-09-27 15:46:57 +02:00 committed by GitHub
parent 703127a6b3
commit 7a8cdb6d19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 96 additions and 72 deletions

View file

@ -59,7 +59,7 @@ testsemver:
# Set -ldflags parameter to pass the semversion. # 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) # Build binaries and place them under bin-$(GOOS)-$(GOARCH)
# Using 'Target-specific Variable Values' to specify the build target system # Using 'Target-specific Variable Values' to specify the build target system

View file

@ -13,7 +13,7 @@ import (
"io" "io"
"net/http" "net/http"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
var errNotFound = errors.New("not found") var errNotFound = errors.New("not found")

View file

@ -19,12 +19,12 @@ import (
"time" "time"
"github.com/ProtonMail/gopenpgp/v2/crypto" "github.com/ProtonMail/gopenpgp/v2/crypto"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v2/internal/certs" "github.com/csaf-poc/csaf_distribution/v3/internal/certs"
"github.com/csaf-poc/csaf_distribution/v2/internal/filter" "github.com/csaf-poc/csaf_distribution/v3/internal/filter"
"github.com/csaf-poc/csaf_distribution/v2/internal/models" "github.com/csaf-poc/csaf_distribution/v3/internal/models"
"github.com/csaf-poc/csaf_distribution/v2/internal/options" "github.com/csaf-poc/csaf_distribution/v3/internal/options"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
"golang.org/x/time/rate" "golang.org/x/time/rate"
) )

View file

@ -18,8 +18,8 @@ import (
"sync" "sync"
"time" "time"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
type fullJob struct { type fullJob struct {

View file

@ -20,8 +20,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
const ( const (

View file

@ -25,8 +25,8 @@ import (
"sync" "sync"
"time" "time"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
type interimJob struct { type interimJob struct {

View file

@ -13,7 +13,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
type lazyTransaction struct { type lazyTransaction struct {

View file

@ -11,8 +11,8 @@ package main
import ( import (
"fmt" "fmt"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
// mirrorAllowed checks if mirroring is allowed. // mirrorAllowed checks if mirroring is allowed.

View file

@ -14,7 +14,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/csaf-poc/csaf_distribution/v2/internal/options" "github.com/csaf-poc/csaf_distribution/v3/internal/options"
"github.com/gofrs/flock" "github.com/gofrs/flock"
) )

View file

@ -30,8 +30,8 @@ import (
"github.com/ProtonMail/gopenpgp/v2/constants" "github.com/ProtonMail/gopenpgp/v2/constants"
"github.com/ProtonMail/gopenpgp/v2/crypto" "github.com/ProtonMail/gopenpgp/v2/crypto"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
// mirrorAllowed checks if mirroring is allowed. // mirrorAllowed checks if mirroring is allowed.

View file

@ -15,8 +15,9 @@ import (
"path/filepath" "path/filepath"
"github.com/ProtonMail/gopenpgp/v2/crypto" "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 { type processor struct {

View file

@ -13,10 +13,10 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"github.com/csaf-poc/csaf_distribution/v2/internal/certs" "github.com/csaf-poc/csaf_distribution/v3/internal/certs"
"github.com/csaf-poc/csaf_distribution/v2/internal/filter" "github.com/csaf-poc/csaf_distribution/v3/internal/filter"
"github.com/csaf-poc/csaf_distribution/v2/internal/models" "github.com/csaf-poc/csaf_distribution/v3/internal/models"
"github.com/csaf-poc/csaf_distribution/v2/internal/options" "github.com/csaf-poc/csaf_distribution/v3/internal/options"
) )
type outputFormat string type outputFormat string

View file

@ -14,7 +14,8 @@ import (
"net/url" "net/url"
"github.com/PuerkitoBio/goquery" "github.com/PuerkitoBio/goquery"
"github.com/csaf-poc/csaf_distribution/v2/util"
"github.com/csaf-poc/csaf_distribution/v3/util"
) )
type ( type (

View file

@ -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 package main
import ( import (

View file

@ -12,7 +12,7 @@ package main
import ( import (
"log" "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 // run uses a processor to check all the given domains or direct urls

View file

@ -32,8 +32,8 @@ import (
"github.com/ProtonMail/gopenpgp/v2/crypto" "github.com/ProtonMail/gopenpgp/v2/crypto"
"golang.org/x/time/rate" "golang.org/x/time/rate"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
// topicMessages stores the collected topicMessages for a specific topic. // topicMessages stores the collected topicMessages for a specific topic.

View file

@ -18,8 +18,8 @@ import (
"os" "os"
"time" "time"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v2/internal/models" "github.com/csaf-poc/csaf_distribution/v3/internal/models"
) )
// MessageType is the kind of the message. // MessageType is the kind of the message.

View file

@ -13,7 +13,7 @@ import (
"sort" "sort"
"strings" "strings"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
type ( type (

View file

@ -15,8 +15,8 @@ import (
"sort" "sort"
"strings" "strings"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
// identifier consist of document/tracking/id and document/publisher/namespace, // identifier consist of document/tracking/id and document/publisher/namespace,

View file

@ -12,7 +12,7 @@ import (
"fmt" "fmt"
"sort" "sort"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
) )
type ruleCondition int type ruleCondition int

View file

@ -19,10 +19,10 @@ import (
"path/filepath" "path/filepath"
"time" "time"
"github.com/csaf-poc/csaf_distribution/v2/internal/certs" "github.com/csaf-poc/csaf_distribution/v3/internal/certs"
"github.com/csaf-poc/csaf_distribution/v2/internal/filter" "github.com/csaf-poc/csaf_distribution/v3/internal/filter"
"github.com/csaf-poc/csaf_distribution/v2/internal/models" "github.com/csaf-poc/csaf_distribution/v3/internal/models"
"github.com/csaf-poc/csaf_distribution/v2/internal/options" "github.com/csaf-poc/csaf_distribution/v3/internal/options"
) )
const ( const (

View file

@ -33,8 +33,8 @@ import (
"github.com/ProtonMail/gopenpgp/v2/crypto" "github.com/ProtonMail/gopenpgp/v2/crypto"
"golang.org/x/time/rate" "golang.org/x/time/rate"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
type downloader struct { type downloader struct {

View file

@ -19,8 +19,8 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/csaf-poc/csaf_distribution/v2/internal/misc" "github.com/csaf-poc/csaf_distribution/v3/internal/misc"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
// failedForwardDir is the name of the special sub folder // failedForwardDir is the name of the special sub folder

View file

@ -15,7 +15,7 @@ import (
"os" "os"
"os/signal" "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 { func run(cfg *config, domains []string) error {

View file

@ -25,8 +25,9 @@ import (
"github.com/ProtonMail/gopenpgp/v2/armor" "github.com/ProtonMail/gopenpgp/v2/armor"
"github.com/ProtonMail/gopenpgp/v2/constants" "github.com/ProtonMail/gopenpgp/v2/constants"
"github.com/ProtonMail/gopenpgp/v2/crypto" "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 const dateFormat = time.RFC3339

View file

@ -16,8 +16,9 @@ import (
"github.com/BurntSushi/toml" "github.com/BurntSushi/toml"
"github.com/ProtonMail/gopenpgp/v2/crypto" "github.com/ProtonMail/gopenpgp/v2/crypto"
"github.com/csaf-poc/csaf_distribution/v2/csaf"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
"github.com/csaf-poc/csaf_distribution/v3/csaf"
) )
const ( const (

View file

@ -21,8 +21,9 @@ import (
"unicode" "unicode"
"github.com/ProtonMail/gopenpgp/v2/crypto" "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 // ensureFolders initializes the paths and call functions to create

View file

@ -13,7 +13,7 @@ import (
"crypto/sha512" "crypto/sha512"
"os" "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 { func writeHashedFile(fname, name string, data []byte, armored string) error {

View file

@ -18,7 +18,7 @@ import (
"sort" "sort"
"time" "time"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
func updateIndex(dir, fname string) error { func updateIndex(dir, fname string) error {

View file

@ -16,8 +16,9 @@ import (
"net/http/cgi" "net/http/cgi"
"os" "os"
"github.com/csaf-poc/csaf_distribution/v2/util"
"github.com/jessevdk/go-flags" "github.com/jessevdk/go-flags"
"github.com/csaf-poc/csaf_distribution/v3/util"
) )
type options struct { type options struct {

View file

@ -15,8 +15,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
// mergeCategories merges the given categories into the old ones. // mergeCategories merges the given categories into the old ones.

View file

@ -12,8 +12,8 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
func doTransaction( func doTransaction(

View file

@ -15,10 +15,11 @@ import (
"os" "os"
"github.com/ProtonMail/gopenpgp/v2/crypto" "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/crypto/bcrypt"
"golang.org/x/term" "golang.org/x/term"
"github.com/csaf-poc/csaf_distribution/v3/internal/certs"
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
) )
const ( const (

View file

@ -9,7 +9,7 @@
// Implements a command line tool that uploads csaf documents to csaf_provider. // Implements a command line tool that uploads csaf documents to csaf_provider.
package main package main
import "github.com/csaf-poc/csaf_distribution/v2/internal/options" import "github.com/csaf-poc/csaf_distribution/v3/internal/options"
func main() { func main() {
args, cfg, err := parseArgsConfig() args, cfg, err := parseArgsConfig()

View file

@ -26,9 +26,9 @@ import (
"github.com/ProtonMail/gopenpgp/v2/constants" "github.com/ProtonMail/gopenpgp/v2/constants"
"github.com/ProtonMail/gopenpgp/v2/crypto" "github.com/ProtonMail/gopenpgp/v2/crypto"
"github.com/csaf-poc/csaf_distribution/v2/csaf" "github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v2/internal/misc" "github.com/csaf-poc/csaf_distribution/v3/internal/misc"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
type processor struct { type processor struct {

View file

@ -16,9 +16,10 @@ import (
"os" "os"
"path/filepath" "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/jessevdk/go-flags"
"github.com/csaf-poc/csaf_distribution/v3/csaf"
"github.com/csaf-poc/csaf_distribution/v3/util"
) )
type options struct { type options struct {

View file

@ -18,7 +18,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
// AdvisoryFile constructs the urls of a remote file. // AdvisoryFile constructs the urls of a remote file.

View file

@ -17,7 +17,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
// TLPLabel is the traffic light policy of the CSAF. // TLPLabel is the traffic light policy of the CSAF.

View file

@ -17,7 +17,7 @@ import (
"net/http" "net/http"
"strings" "strings"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
// ProviderMetadataLoader helps load provider-metadata.json from // ProviderMetadataLoader helps load provider-metadata.json from

View file

@ -14,7 +14,7 @@ import (
"sort" "sort"
"time" "time"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
// ROLIEServiceWorkspaceCollectionCategoriesCategory is a category in a ROLIE service collection. // ROLIEServiceWorkspaceCollectionCategoriesCategory is a category in a ROLIE service collection.

View file

@ -11,7 +11,7 @@ package csaf
import ( import (
"time" "time"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
const ( const (

2
go.mod
View file

@ -1,4 +1,4 @@
module github.com/csaf-poc/csaf_distribution/v2 module github.com/csaf-poc/csaf_distribution/v3
go 1.21 go 1.21

View file

@ -18,7 +18,7 @@ import (
"github.com/jessevdk/go-flags" "github.com/jessevdk/go-flags"
"github.com/mitchellh/go-homedir" "github.com/mitchellh/go-homedir"
"github.com/csaf-poc/csaf_distribution/v2/util" "github.com/csaf-poc/csaf_distribution/v3/util"
) )
// Parser helps parsing command line arguments and loading // Parser helps parsing command line arguments and loading

View file

@ -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 util package util
import ( import (