diff --git a/.grant.yaml b/.grant.yaml
index b75cc2e..56fe0b1 100644
--- a/.grant.yaml
+++ b/.grant.yaml
@@ -1,12 +1,14 @@
#.grant.yaml
-precedence: [deny, allow]
-deny-licenses: "*"
-allow-licenses:
- - MPL-2.0
- - BSD-2-Clause
- - BSD-3-Clause
- - GPL-2.0-Or-Later+
- - Zlib
- - MIT
- - Apache-2.0
+format: json
+import:
+ - ../local-policy.json
+ - git@githubcom:anchore/central-policy.git@main#./org/*.policy.json
+ - allowed: []
+ denied: []
+# grant -o json alpine:latest=osi.arrpoved.json enterprisesystemsengineering:latest=special.approved.json
+# grant myimage:latest ./local-policy.json
+# .gitignore vs .gitconfig distinction (don't mix the what and how)
+
+# .grantpolicy.yaml
+# .grantpolicy/*.yaml
diff --git a/Taskfile.yaml b/Taskfile.yaml
index 9d6cb5e..efa9b25 100644
--- a/Taskfile.yaml
+++ b/Taskfile.yaml
@@ -122,12 +122,12 @@ tasks:
- build
deps: [tools]
cmds:
- - silent: true
- cmd: |
- echo "dist: {{ .SNAPSHOT_DIR }}" > {{ .TMP_DIR }}/goreleaser.yaml
+ - cmd: "mkdir -p {{ .TMP_DIR }}"
+ silent: true
+ - cmd: |
cat .goreleaser.yaml >> {{ .TMP_DIR }}/goreleaser.yaml
-
- - "{{ .TOOL_DIR }}/goreleaser release --clean --skip=publish --skip=sign --snapshot --config {{ .TMP_DIR }}/goreleaser.yaml"
+ echo "dist: {{ .SNAPSHOT_DIR }}" >> {{ .TMP_DIR }}/goreleaser.yaml
+ - cmd: "{{ .TOOL_DIR }}/goreleaser release --clean --skip=publish --skip=sign --snapshot --config {{ .TMP_DIR }}/goreleaser.yaml"
## TODO Release targets #################################
diff --git a/cmd/grant/cli/command/check.go b/cmd/grant/cli/command/check.go
index 32c14ff..ba846fd 100644
--- a/cmd/grant/cli/command/check.go
+++ b/cmd/grant/cli/command/check.go
@@ -11,6 +11,7 @@ import (
"github.com/anchore/clio"
"github.com/anchore/grant/cmd/grant/cli/option"
"github.com/anchore/grant/grant"
+ "github.com/anchore/grant/grant/report"
"github.com/anchore/grant/internal/input"
)
@@ -58,7 +59,7 @@ func runCheck(cfg CheckConfig, sources []string) (errs error) {
}
// TODO: we need to support the ability to write the report to a file without redirecting stdout
- return grant.NewReport(grant.Format(cfg.Format), policy, sources...).
+ return report.NewReport(report.Format(cfg.Format), policy, sources...).
Run().
Render(os.Stdout)
}
diff --git a/cmd/grant/cli/internal/ui/ui.go b/cmd/grant/cli/internal/ui/ui.go
index 0ae3dde..17b572d 100644
--- a/cmd/grant/cli/internal/ui/ui.go
+++ b/cmd/grant/cli/internal/ui/ui.go
@@ -150,7 +150,8 @@ func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, nil
}
- for _, newModel := range m.handler.Handle(msg) {
+ handlerModels, _ := m.handler.Handle(msg)
+ for _, newModel := range handlerModels {
if newModel == nil {
continue
}
diff --git a/cmd/grant/cli/option/check.go b/cmd/grant/cli/option/check.go
index 6770e5e..ac65e40 100644
--- a/cmd/grant/cli/option/check.go
+++ b/cmd/grant/cli/option/check.go
@@ -1,6 +1,8 @@
package option
-import "github.com/anchore/grant/grant"
+import (
+ "github.com/anchore/grant/grant"
+)
type Check struct {
AllowLicenses []string `json:"allow-licenses" yaml:"allow-licenses" mapstructure:"allow-licenses"`
diff --git a/cmd/grant/cli/tui/handle_check.go b/cmd/grant/cli/tui/handle_check.go
index c8e5187..6c94794 100644
--- a/cmd/grant/cli/tui/handle_check.go
+++ b/cmd/grant/cli/tui/handle_check.go
@@ -16,14 +16,14 @@ import (
var _ tea.Model = (*checkViewModel)(nil)
-func (m *Handler) handleCLICheckCmdStarted(e partybus.Event) []tea.Model {
+func (m *Handler) handleCLICheckCmdStarted(e partybus.Event) ([]tea.Model, tea.Cmd) {
sourceNames, prog, err := event.ParseCheckCommandStarted(e)
if err != nil {
log.WithFields("error", err).Warn("unable to parse event")
- return nil
+ return nil, nil
}
- return []tea.Model{newCheckViewModel(sourceNames, prog, m.WindowSize)}
+ return []tea.Model{newCheckViewModel(sourceNames, prog, m.WindowSize)}, nil
}
type checkViewModel struct {
diff --git a/grant/fixtures/alpine.spdx b/fixtures/alpine.tagvalue.spdx
similarity index 100%
rename from grant/fixtures/alpine.spdx
rename to fixtures/alpine.tagvalue.spdx
diff --git a/fixtures/archive-builds/.gitignore b/fixtures/archive-builds/.gitignore
new file mode 100644
index 0000000..bb7c261
--- /dev/null
+++ b/fixtures/archive-builds/.gitignore
@@ -0,0 +1,5 @@
+/packages/*
+
+# maven when running in a volume may spit out directories like this
+**/\?/
+\?/
\ No newline at end of file
diff --git a/fixtures/archive-builds/Makefile b/fixtures/archive-builds/Makefile
new file mode 100644
index 0000000..6923830
--- /dev/null
+++ b/fixtures/archive-builds/Makefile
@@ -0,0 +1,19 @@
+PKGSDIR=packages
+
+ifndef PKGSDIR
+ $(error PKGSDIR is not set)
+endif
+
+clean: clean-examples
+ rm -f $(PKGSDIR)/*
+
+jars: $(PKGSDIR)/example-java-app-maven-0.1.0.jar
+
+archives: $(PKGSDIR)/example-java-app-maven-0.1.0.zip
+
+$(PKGSDIR)/example-java-app-maven-0.1.0.zip: $(PKGSDIR)/example-java-app-maven-0.1.0.jar
+ zip $(PKGSDIR)/example-java-app-maven-0.1.0.zip $(PKGSDIR)/example-java-app-maven-0.1.0.jar
+
+# Maven...
+$(PKGSDIR)/example-java-app-maven-0.1.0.jar:
+ ./build-example-java-app-maven.sh $(PKGSDIR)
\ No newline at end of file
diff --git a/fixtures/archive-builds/build-example-java-app-maven.sh b/fixtures/archive-builds/build-example-java-app-maven.sh
new file mode 100755
index 0000000..2277349
--- /dev/null
+++ b/fixtures/archive-builds/build-example-java-app-maven.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+set -uxe
+
+PKGSDIR=$1
+CTRID=$(docker create -u "$(id -u):$(id -g)" -e MAVEN_CONFIG=/tmp/.m2 -v /example-java-app -w /example-java-app maven:3.8.6-openjdk-18 mvn -Duser.home=/tmp -DskipTests package)
+
+function cleanup() {
+ docker rm "${CTRID}"
+}
+
+trap cleanup EXIT
+set +e
+
+docker cp "$(pwd)/example-java-app" "${CTRID}:/"
+docker start -a "${CTRID}"
+mkdir -p "$PKGSDIR"
+docker cp "${CTRID}:/example-java-app/target/example-java-app-maven-0.1.0.jar" "$PKGSDIR"
\ No newline at end of file
diff --git a/fixtures/archive-builds/example-java-app/.gitignore b/fixtures/archive-builds/example-java-app/.gitignore
new file mode 100644
index 0000000..a8a4d85
--- /dev/null
+++ b/fixtures/archive-builds/example-java-app/.gitignore
@@ -0,0 +1,6 @@
+# maven build creates this when in a container volume
+/?/
+/.gradle/
+/build/
+target/
+dependency-reduced-pom.xml
diff --git a/fixtures/archive-builds/example-java-app/build.gradle b/fixtures/archive-builds/example-java-app/build.gradle
new file mode 100644
index 0000000..1d700e2
--- /dev/null
+++ b/fixtures/archive-builds/example-java-app/build.gradle
@@ -0,0 +1,58 @@
+plugins {
+ id 'java'
+ id 'eclipse'
+ id 'application'
+}
+
+mainClassName = 'hello.HelloWorld'
+
+dependencyLocking {
+ lockAllConfigurations()
+}
+// tag::repositories[]
+repositories {
+ mavenCentral()
+}
+// end::repositories[]
+
+// tag::dependencies[]
+sourceCompatibility = 1.8
+targetCompatibility = 1.8
+
+dependencies {
+ implementation "joda-time:joda-time:2.2"
+ testImplementation "junit:junit:4.12"
+}
+// end::dependencies[]
+
+// tag::jar[]
+jar {
+ archivesBaseName = 'example-java-app-gradle'
+ version = '0.1.0'
+ manifest {
+ attributes(
+ 'Main-Class': 'hello.HelloWorld'
+ )
+ }
+ from {
+ configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
+ }
+}
+// end::jar[]
+
+// tag::wrapper[]
+// end::wrapper[]
+
+// to invoke: gradle resolveAndLockAll --write-locks
+tasks.register('resolveAndLockAll') {
+ notCompatibleWithConfigurationCache("Filters configurations at execution time")
+ doFirst {
+ assert gradle.startParameter.writeDependencyLocks
+ }
+ doLast {
+ configurations.findAll {
+ // Add any custom filtering on the configurations to be resolved
+ it.canBeResolved
+ }.each { it.resolve() }
+ }
+}
diff --git a/fixtures/archive-builds/example-java-app/gradle.lockfile b/fixtures/archive-builds/example-java-app/gradle.lockfile
new file mode 100644
index 0000000..b6edb43
--- /dev/null
+++ b/fixtures/archive-builds/example-java-app/gradle.lockfile
@@ -0,0 +1,7 @@
+# This is a Gradle generated file for dependency locking.
+# Manual edits can break the build and are not advised.
+# This file is expected to be part of source control.
+joda-time:joda-time:2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
+junit:junit:4.12=testCompileClasspath,testRuntimeClasspath
+org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath
+empty=annotationProcessor,testAnnotationProcessor
diff --git a/fixtures/archive-builds/example-java-app/pom.xml b/fixtures/archive-builds/example-java-app/pom.xml
new file mode 100644
index 0000000..4ab76d1
--- /dev/null
+++ b/fixtures/archive-builds/example-java-app/pom.xml
@@ -0,0 +1,59 @@
+
+
+ 4.0.0
+
+ org.anchore
+ example-java-app-maven
+ jar
+ 0.1.0
+
+
+ 1.8
+ 1.8
+
+
+
+
+
+ joda-time
+ joda-time
+ 2.9.2
+
+
+
+
+ junit
+ junit
+ 4.12
+ test
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 2.1
+
+
+ package
+
+ shade
+
+
+
+
+ hello.HelloWorld
+
+
+
+
+
+
+
+
+
+
diff --git a/fixtures/archive-builds/example-java-app/src/main/java/hello/Greeter.java b/fixtures/archive-builds/example-java-app/src/main/java/hello/Greeter.java
new file mode 100644
index 0000000..74eb8d4
--- /dev/null
+++ b/fixtures/archive-builds/example-java-app/src/main/java/hello/Greeter.java
@@ -0,0 +1,7 @@
+package hello;
+
+public class Greeter {
+ public String sayHello() {
+ return "Hello world!";
+ }
+}
diff --git a/fixtures/archive-builds/example-java-app/src/main/java/hello/HelloWorld.java b/fixtures/archive-builds/example-java-app/src/main/java/hello/HelloWorld.java
new file mode 100644
index 0000000..d9e61fe
--- /dev/null
+++ b/fixtures/archive-builds/example-java-app/src/main/java/hello/HelloWorld.java
@@ -0,0 +1,13 @@
+package hello;
+
+import org.joda.time.LocalTime;
+
+public class HelloWorld {
+ public static void main(String[] args) {
+ LocalTime currentTime = new LocalTime();
+ System.out.println("The current local time is: " + currentTime);
+
+ Greeter greeter = new Greeter();
+ System.out.println(greeter.sayHello());
+ }
+}
diff --git a/fixtures/licenses/MIT b/fixtures/licenses/MIT
new file mode 100644
index 0000000..05574e5
--- /dev/null
+++ b/fixtures/licenses/MIT
@@ -0,0 +1,7 @@
+Copyright
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/fixtures/multiple/gpl b/fixtures/multiple/gpl
new file mode 100644
index 0000000..3ab3340
--- /dev/null
+++ b/fixtures/multiple/gpl
@@ -0,0 +1,200 @@
+GNU GENERAL PUBLIC LICENSE
+Version 3, 29 June 2007
+
+Copyright © 2007 Free Software Foundation, Inc.
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+Preamble
+
+The GNU General Public License is a free, copyleft license for software and other kinds of works.
+
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
+
+To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
+
+For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
+
+Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
+
+Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS
+
+0. Definitions.
+"This License" refers to version 3 of the GNU General Public License.
+
+"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+
+"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
+
+To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
+
+A "covered work" means either the unmodified Program or a work based on the Program.
+
+To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
+
+To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
+
+An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
+
+1. Source Code.
+The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
+A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
+
+The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
+
+The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same work.
+
+2. Basic Permissions.
+All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
+
+3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
+
+4. Conveying Verbatim Copies.
+You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
+
+5. Conveying Modified Source Versions.
+You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
+a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
+b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
+c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
+d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
+A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
+
+6. Conveying Non-Source Forms.
+You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
+a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
+b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
+c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
+d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
+e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
+A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
+
+A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
+
+"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
+
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
+
+7. Additional Terms.
+"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
+
+a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
+b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
+c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
+d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
+e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
+f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
+All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
+
+8. Termination.
+You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
+
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
+
+9. Acceptance Not Required for Having Copies.
+You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
+10. Automatic Licensing of Downstream Recipients.
+Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
+An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
+
+11. Patents.
+A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
+A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+
+In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
+
+A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
+
+12. No Surrender of Others' Freedom.
+If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
+13. Use with the GNU Affero General Public License.
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
+14. Revised Versions of this License.
+The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
+
+If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
+
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
+
+15. Disclaimer of Warranty.
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+16. Limitation of Liability.
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+17. Interpretation of Sections 15 and 16.
+If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+
+Copyright (C)
+
+This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box".
+
+You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see .
+
+The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read .
\ No newline at end of file
diff --git a/go.mod b/go.mod
index ec6cad9..fc6e739 100644
--- a/go.mod
+++ b/go.mod
@@ -24,22 +24,30 @@ require (
)
require (
+ dario.cat/mergo v1.0.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect
github.com/CycloneDX/cyclonedx-go v0.7.2 // indirect
+ github.com/DataDog/zstd v1.4.5 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.11.1 // indirect
+ github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/acobaugh/osrelease v0.1.0 // indirect
+ github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/adrg/xdg v0.4.0 // indirect
github.com/anchore/fangs v0.0.0-20230818131516-2186b10924fe // indirect
+ github.com/anchore/go-macholibre v0.0.0-20220308212642-53e6d0aaf6fb // indirect
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 // indirect
github.com/anchore/packageurl-go v0.1.1-0.20230104203445-02e0a6721501 // indirect
github.com/anchore/stereoscope v0.0.0-20231117203853-3610f4ef3e83 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
+ github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46 // indirect
+ github.com/aquasecurity/go-version v0.0.0-20210121072130-637058cfe492 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/becheran/wildmatch-go v1.0.0 // indirect
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
+ github.com/cloudflare/circl v1.3.3 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/containerd/containerd v1.7.8 // indirect
@@ -49,7 +57,9 @@ require (
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/containerd/ttrpc v1.2.2 // indirect
github.com/containerd/typeurl/v2 v2.1.1 // indirect
+ github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/cli v24.0.0+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
@@ -59,19 +69,28 @@ require (
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
+ github.com/dustin/go-humanize v1.0.1 // indirect
+ github.com/edsrzf/mmap-go v1.1.0 // indirect
+ github.com/emirpasic/gods v1.18.1 // indirect
github.com/facebookincubator/nvdtools v0.1.5 // indirect
github.com/felixge/fgprof v0.9.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.0 // indirect
github.com/gkampitakis/ciinfo v0.3.0 // indirect
github.com/gkampitakis/go-diff v1.3.2 // indirect
+ github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
+ github.com/go-git/go-billy/v5 v5.5.0 // indirect
+ github.com/go-git/go-git/v5 v5.10.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-restruct/restruct v1.2.0-alpha // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-containerregistry v0.16.1 // indirect
+ github.com/google/licensecheck v0.3.1 // indirect
+ github.com/google/licenseclassifier/v2 v2.0.0 // indirect
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/gookit/color v1.5.4 // indirect
@@ -79,9 +98,13 @@ require (
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
+ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
+ github.com/kastenhq/goversion v0.0.0-20230811215019-93b2f8823953 // indirect
+ github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
+ github.com/knqyf263/go-rpmdb v0.0.0-20230301153543-ba94b245509b // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
@@ -93,6 +116,7 @@ require (
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/mholt/archiver/v3 v3.5.1 // indirect
+ github.com/microsoft/go-rustaudit v0.0.0-20220730194248-4b17361d90a5 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/locker v1.0.1 // indirect
@@ -113,12 +137,18 @@ require (
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pierrec/lz4/v4 v4.1.15 // indirect
+ github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/profile v1.7.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
+ github.com/saferwall/pe v1.4.7 // indirect
+ github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect
+ github.com/sassoftware/go-rpmutils v0.2.0 // indirect
github.com/scylladb/go-set v1.0.3-0.20200225121959-cc7b2070d91e // indirect
+ github.com/sergi/go-diff v1.3.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
+ github.com/skeema/knownhosts v1.2.0 // indirect
github.com/spdx/tools-golang v0.5.3 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
@@ -134,9 +164,13 @@ require (
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
+ github.com/vbatts/go-mtree v0.5.3 // indirect
github.com/vbatts/tar-split v0.11.3 // indirect
+ github.com/vifraa/gopom v1.0.0 // indirect
+ github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
+ go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel v1.14.0 // indirect
go.opentelemetry.io/otel/trace v1.14.0 // indirect
@@ -148,10 +182,12 @@ require (
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.16.0 // indirect
+ golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/genproto v0.0.0-20231127180814-3a041ad873d4 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
+ gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/go.sum b/go.sum
index ba47251..b94ccc5 100644
--- a/go.sum
+++ b/go.sum
@@ -48,6 +48,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
+dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
+dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
@@ -62,15 +64,22 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym
github.com/CycloneDX/cyclonedx-go v0.7.2 h1:kKQ0t1dPOlugSIYVOMiMtFqeXI2wp/f5DBIdfux8gnQ=
github.com/CycloneDX/cyclonedx-go v0.7.2/go.mod h1:K2bA+324+Og0X84fA8HhN2X066K7Bxz4rpMQ4ZhjtSk=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
+github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
+github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
+github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/Microsoft/hcsshim v0.11.1 h1:hJ3s7GbWlGK4YVV92sO88BQSyF4ZLVy7/awqOlPxFbA=
github.com/Microsoft/hcsshim v0.11.1/go.mod h1:nFJmaO4Zr5Y7eADdFOpYswDDlNVbvcIJJNJLECr5JQg=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
+github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg=
+github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
github.com/acobaugh/osrelease v0.1.0 h1:Yb59HQDGGNhCj4suHaFQQfBps5wyoKLSSX/J/+UifRE=
github.com/acobaugh/osrelease v0.1.0/go.mod h1:4bFEs0MtgHNHBrmHCt67gNisnabCRAlzdVasCEGHTWY=
+github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ=
+github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
@@ -85,6 +94,8 @@ github.com/anchore/fangs v0.0.0-20230818131516-2186b10924fe h1:pVpLCGWdNeskAw7vG
github.com/anchore/fangs v0.0.0-20230818131516-2186b10924fe/go.mod h1:82EGoxZTfBXSW0/zollEP+Qs3wkiKmip5yBT5j+eZpY=
github.com/anchore/go-logger v0.0.0-20230725134548-c21dafa1ec5a h1:nJ2G8zWKASyVClGVgG7sfM5mwoZlZ2zYpIzN2OhjWkw=
github.com/anchore/go-logger v0.0.0-20230725134548-c21dafa1ec5a/go.mod h1:ubLFmlsv8/DFUQrZwY5syT5/8Er3ugSr4rDFwHsE3hg=
+github.com/anchore/go-macholibre v0.0.0-20220308212642-53e6d0aaf6fb h1:iDMnx6LIjtjZ46C0akqveX83WFzhpTD3eqOthawb5vU=
+github.com/anchore/go-macholibre v0.0.0-20220308212642-53e6d0aaf6fb/go.mod h1:DmTY2Mfcv38hsHbG78xMiTDdxFtkHpgYNVDPsF2TgHk=
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 h1:aM1rlcoLz8y5B2r4tTLMiVTrMtpfY0O8EScKJxaSaEc=
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA=
github.com/anchore/go-testutils v0.0.0-20200925183923-d5f45b0d3c04 h1:VzprUTpc0vW0nnNKJfJieyH/TZ9UYAnTZs5/gHTdAe8=
@@ -99,12 +110,20 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo
github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
+github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
+github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
+github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46 h1:vmXNl+HDfqqXgr0uY1UgK1GAhps8nbAAtqHNBcgyf+4=
+github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46/go.mod h1:olhPNdiiAAMiSujemd1O/sc6GcyePr23f/6uGKtthNg=
+github.com/aquasecurity/go-version v0.0.0-20210121072130-637058cfe492 h1:rcEG5HI490FF0a7zuvxOxen52ddygCfNVjP0XOCMl+M=
+github.com/aquasecurity/go-version v0.0.0-20210121072130-637058cfe492/go.mod h1:9Beu8XsUNNfzml7WBf3QmyPToP1wm1Gj/Vc5UJKqTzU=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
+github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
+github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/becheran/wildmatch-go v1.0.0 h1:mE3dGGkTmpKtT4Z+88t8RStG40yN9T+kFEGj2PZFSzA=
@@ -117,6 +136,7 @@ github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwN
github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M=
github.com/bradleyjkemp/cupaloy/v2 v2.8.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0=
+github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
@@ -136,6 +156,8 @@ github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2u
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs=
+github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
@@ -173,9 +195,13 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
+github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
+github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da h1:ZOjWpVsFZ06eIhnh4mkaceTiVoktdU67+M7KDHJ268M=
+github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da/go.mod h1:B3tI9iGHi4imdLi4Asdha1Sc6feLMTfPLXh9IUYmysk=
github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4=
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
@@ -197,6 +223,14 @@ github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 h1:iFaUwBSo5Svw6L7HYpRu/0lE3e0BaElwnNO1qkNQxBY=
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s=
github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY=
+github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
+github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
+github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ=
+github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q=
+github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
+github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
+github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
+github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
@@ -235,6 +269,18 @@ github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZ
github.com/gkampitakis/go-diff v1.3.2/go.mod h1:LLgOrpqleQe26cte8s36HTWcTmMEur6OPYerdAAS9tk=
github.com/gkampitakis/go-snaps v0.4.12 h1:YeMgKOm0XW3f/Pt2rYpUlpyF8nG6lYGe9oXFJw5LdME=
github.com/gkampitakis/go-snaps v0.4.12/go.mod h1:PpnF1KPXQAHBdb/DHoi/1VmlwE+ZkVHzl+QHmgzMSz8=
+github.com/glebarez/go-sqlite v1.20.3 h1:89BkqGOXR9oRmG58ZrzgoY/Fhy5x0M+/WV48U5zVrZ4=
+github.com/glebarez/go-sqlite v1.20.3/go.mod h1:u3N6D/wftiAzIOJtZl6BmedqxmmkDfH3q+ihjqxC9u0=
+github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
+github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4=
+github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
+github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
+github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
+github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow=
+github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
+github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
+github.com/go-git/go-git/v5 v5.10.0 h1:F0x3xXrAWmhwtzoCokU4IMPcBdncG+HAAqi9FcOOjbQ=
+github.com/go-git/go-git/v5 v5.10.0/go.mod h1:1FOZ/pQnqw24ghP2n7cunVl0ON55BsjPYvhWHvZGhoo=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
@@ -247,6 +293,8 @@ github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-restruct/restruct v1.2.0-alpha h1:2Lp474S/9660+SJjpVxoKuWX09JsXHSrdV7Nv3/gkvc=
+github.com/go-restruct/restruct v1.2.0-alpha/go.mod h1:KqrpKpn4M8OLznErihXTGLlsXFGeLxHUrLRRI/1YjGk=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg=
@@ -316,6 +364,10 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
github.com/google/go-containerregistry v0.16.1 h1:rUEt426sR6nyrL3gt+18ibRcvYpKYdpsa5ZW7MA08dQ=
github.com/google/go-containerregistry v0.16.1/go.mod h1:u0qB2l7mvtWVR5kNcbFIhFY1hLbf8eeGapA+vbFDCtQ=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/licensecheck v0.3.1 h1:QoxgoDkaeC4nFrtGN1jV7IPmDCHFNIVh54e5hSt6sPs=
+github.com/google/licensecheck v0.3.1/go.mod h1:ORkR35t/JjW+emNKtfJDII0zlciG9JgbT7SmsohlHmY=
+github.com/google/licenseclassifier/v2 v2.0.0 h1:1Y57HHILNf4m0ABuMVb6xk4vAJYEUO0gDxNpog0pyeA=
+github.com/google/licenseclassifier/v2 v2.0.0/go.mod h1:cOjbdH0kyC9R22sdQbYsFkto4NGCAc+ZSwbeThazEtM=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -395,6 +447,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
+github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
+github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
@@ -404,15 +458,22 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/kastenhq/goversion v0.0.0-20230811215019-93b2f8823953 h1:WdAeg/imY2JFPc/9CST4bZ80nNJbiBFCAdSZCSgrS5Y=
+github.com/kastenhq/goversion v0.0.0-20230811215019-93b2f8823953/go.mod h1:6o+UrvuZWc4UTyBhQf0LGjW9Ld7qJxLz/OqvSOWWlEc=
+github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
+github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
+github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI=
github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE=
github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
+github.com/knqyf263/go-rpmdb v0.0.0-20230301153543-ba94b245509b h1:boYyvL3tbUuKcMN029mpCl7oYYJ7yIXujLj+fiW4Alc=
+github.com/knqyf263/go-rpmdb v0.0.0-20230301153543-ba94b245509b/go.mod h1:9LQcoMCMQ9vrF7HcDtXfvqGO4+ddxFQ8+YF/0CVGDww=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
@@ -435,6 +496,8 @@ github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0V
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/maruel/natural v1.1.0 h1:2z1NgP/Vae+gYrtC0VuvrTJ6U35OuyUqDdfluLqMWuQ=
github.com/maruel/natural v1.1.0/go.mod h1:eFVhYCcUOfZFxXoDZam8Ktya72wa79fNC3lc/leA0DQ=
+github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A=
+github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
@@ -461,6 +524,8 @@ github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQ
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/mholt/archiver/v3 v3.5.1 h1:rDjOBX9JSF5BvoJGvjqK479aL70qh9DIpZCl+k7Clwo=
github.com/mholt/archiver/v3 v3.5.1/go.mod h1:e3dqJ7H78uzsRSEACH1joayhuSyhnonssnDhppzS1L4=
+github.com/microsoft/go-rustaudit v0.0.0-20220730194248-4b17361d90a5 h1:tQRHcLQwnwrPq2j2Qra/NnyjyESBGwdeBeVdAE9kXYg=
+github.com/microsoft/go-rustaudit v0.0.0-20220730194248-4b17361d90a5/go.mod h1:vYT9HE7WCvL64iVeZylKmCsWKfE+JZ8105iuh2Trk8g=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=
@@ -505,6 +570,8 @@ github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1n
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nwaples/rardecode v1.1.0 h1:vSxaY8vQhOcVr4mm5e8XllHWTiM4JF507A0Katqw7MQ=
github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0=
+github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
+github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0-rc3 h1:fzg1mXZFj8YdPeNkRXMg+zb88BFV0Ys52cJydRwBkb8=
@@ -529,6 +596,8 @@ github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNc
github.com/pierrec/lz4/v4 v4.1.2/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0=
github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
+github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
+github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -557,6 +626,8 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
+github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
+github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
@@ -568,7 +639,15 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
+github.com/saferwall/pe v1.4.7 h1:A+G3DxX49paJ5OsxBfHKskhyDtmTjShlDmBd81IsHlQ=
+github.com/saferwall/pe v1.4.7/go.mod h1:SNzv3cdgk8SBI0UwHfyTcdjawfdnN+nbydnEL7GZ25s=
github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig=
+github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d h1:hrujxIzL1woJ7AwssoOcM/tq5JjjG2yYOc8odClEiXA=
+github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
+github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQo=
+github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U=
+github.com/sassoftware/go-rpmutils v0.2.0 h1:pKW0HDYMFWQ5b4JQPiI3WI12hGsVoW0V8+GMoZiI/JE=
+github.com/sassoftware/go-rpmutils v0.2.0/go.mod h1:TJJQYtLe/BeEmEjelI3b7xNZjzAukEkeWKmoakvaOoI=
github.com/scylladb/go-set v1.0.3-0.20200225121959-cc7b2070d91e h1:7q6NSFZDeGfvvtIRwBrU/aegEYJYmvev0cHAwo17zZQ=
github.com/scylladb/go-set v1.0.3-0.20200225121959-cc7b2070d91e/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
@@ -582,10 +661,13 @@ github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NF
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
+github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
+github.com/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM=
+github.com/skeema/knownhosts v1.2.0/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2IqpAoNkjxbMo=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb/go.mod h1:uKWaldnbMnjsSAXRurWqqrdyZen1R7kxl8TkmWk2OyM=
github.com/spdx/tools-golang v0.5.3 h1:ialnHeEYUC4+hkm5vJm4qz2x+oEJbS0mAMFrNXdQraY=
@@ -653,14 +735,21 @@ github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=
github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8=
+github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
+github.com/vbatts/go-mtree v0.5.3 h1:S/jYlfG8rZ+a0bhZd+RANXejy7M4Js8fq9U+XoWTd5w=
+github.com/vbatts/go-mtree v0.5.3/go.mod h1:eXsdoPMdL2jcJx6HweWi9lYQxBsTp4lNhqqAjgkZUg8=
github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck=
github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY=
+github.com/vifraa/gopom v1.0.0 h1:L9XlKbyvid8PAIK8nr0lihMApJQg/12OBvMA28BcWh0=
+github.com/vifraa/gopom v1.0.0/go.mod h1:oPa1dcrGrtlO37WPDBm5SqHAT+wTgF8An1Q71Z6Vv4o=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/wagoodman/go-partybus v0.0.0-20230516145632-8ccac152c651 h1:jIVmlAFIqV3d+DOxazTR9v+zgj8+VYuQBzPgBZvWBHA=
github.com/wagoodman/go-partybus v0.0.0-20230516145632-8ccac152c651/go.mod h1:b26F2tHLqaoRQf8DywqzVaV1MQ9yvjb0OMcNl7Nxu20=
github.com/wagoodman/go-progress v0.0.0-20230925121702-07e42b3cdba0 h1:0KGbf+0SMg+UFy4e1A/CPVvXn21f1qtWdeJwxZFoQG8=
github.com/wagoodman/go-progress v0.0.0-20230925121702-07e42b3cdba0/go.mod h1:jLXFoL31zFaHKAAyZUh+sxiTDFe1L1ZHrcK2T1itVKA=
+github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
+github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
@@ -676,9 +765,12 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
+github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs=
+go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 h1:CCriYyAfq1Br1aIYettdHZTy8mBTIPo7We18TuO/bak=
+go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
@@ -694,6 +786,9 @@ go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyK
go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
+go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
+go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA=
+go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
@@ -705,9 +800,14 @@ golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
+golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
+golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -746,6 +846,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
+golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
+golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -792,6 +894,10 @@ golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
+golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
+golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -822,6 +928,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -897,16 +1005,26 @@ golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220906165534-d0df966e6959/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
+golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
+golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
+golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -918,6 +1036,9 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
+golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -941,6 +1062,7 @@ golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
@@ -980,12 +1102,16 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
+golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM=
golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
+golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
@@ -1149,6 +1275,8 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
+gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
+gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -1169,6 +1297,14 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
+modernc.org/libc v1.29.0 h1:tTFRFq69YKCF2QyGNuRUQxKBm1uZZLubf6Cjh/pVHXs=
+modernc.org/libc v1.29.0/go.mod h1:DaG/4Q3LRRdqpiLyP0C2m1B8ZMGkQ+cCgOIjEtQlYhQ=
+modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
+modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo=
+modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E=
+modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E=
+modernc.org/sqlite v1.27.0 h1:MpKAHoyYB7xqcwnUwkuD+npwEa0fojF0B5QRbN+auJ8=
+modernc.org/sqlite v1.27.0/go.mod h1:Qxpazz0zH8Z1xCFyi5GSL3FzbtZ3fvbjmywNogldEW0=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
diff --git a/grant/license.go b/grant/license.go
index 0905c86..f86cd70 100644
--- a/grant/license.go
+++ b/grant/license.go
@@ -1,18 +1,15 @@
package grant
-import (
- "github.com/github/go-spdx/v2/spdxexp"
+type LicenseID string
- "github.com/anchore/grant/internal/log"
- "github.com/anchore/grant/internal/spdxlicense"
- "github.com/anchore/syft/syft/pkg"
-)
-
-// License is a grant license. Either SPDXExpression or Name will be set. If SPDXExpression is set, Name will be empty.
-// Value is the contents of the license and is optional. Locations are the paths for a package that show evidence of the license.
+// License is a grant license. Either SPDXExpression or Name will be set.
+// If SPDXExpression is set, Name will be empty.
+// Value is the contents of the license and is optional - can be fetched from the SPDX license list
+// Locations are the relative paths for a license that show evidence of its detection.
type License struct {
// SPDXExpression is the SPDX expression for the license
- SPDXExpression string `json:"spdxExpression"`
+ ID LicenseID `json:"id"`
+ SPDXExpression string `json:"spdxExpression"`
// Name is the name of the individual license if SPDXExpression is unset
Name string `json:"name"`
// Contents are the text of the license
@@ -41,86 +38,3 @@ func (l License) String() string {
func (l License) IsSPDX() bool {
return l.SPDXExpression != ""
}
-
-// ConvertSyftLicenses converts a syft LicenseSet to a grant License slice
-// note: syft licenses can sometimes have complex SPDX expressions
-// grant licenses break down these expressions into a slice of licenses
-// because license expressions could potentially contain multiple licenses
-// that are already represented in the syft license set we need to de-duplicate
-// syft licenses have a "Value" field that is the name of the license
-// given an invalid SPDX expression; grant licenses refer to this as "Name"
-func ConvertSyftLicenses(set pkg.LicenseSet) (licenses []License) {
- licenses = make([]License, 0)
- checked := make(map[string]bool)
- for _, license := range set.ToSlice() {
- locations := license.Locations.ToSlice()
- licenseLocations := make([]string, 0)
- for _, location := range locations {
- licenseLocations = append(licenseLocations, location.RealPath)
- }
-
- if license.SPDXExpression != "" {
- licenses = handleSPDXLicense(license, licenses, licenseLocations, checked)
- continue
- }
-
- licenses = addNonSPDXLicense(licenses, license, licenseLocations)
- }
- return licenses
-}
-
-func handleSPDXLicense(license pkg.License, licenses []License, licenseLocations []string, checked map[string]bool) []License {
- extractedLicenses, err := spdxexp.ExtractLicenses(license.SPDXExpression)
- if err != nil {
- log.Errorf("unable to extract licenses from SPDX expression: %s", license.SPDXExpression)
- return addNonSPDXLicense(licenses, license, licenseLocations)
- }
-
- // process each extracted license from the SPDX expression
- for _, extractedLicense := range extractedLicenses {
- // prevent duplicates from being added when using SPDX expressions
- // EG: "MIT AND MIT" is valid, but we want to de-duplicate these
- if check(checked, extractedLicense) {
- continue
- }
-
- // we have what seems to be a valid SPDX license ID, let's try and get more info about it
- spdxLicense, err := spdxlicense.GetLicenseByID(extractedLicense)
- if err != nil {
- log.Errorf("unable to get license by ID: %s; no matching spdx id found", extractedLicense)
- // if we can't find a matching SPDX license, just add the license as-is
- // TODO: best matching against the spdx list index
- addNonSPDXLicense(licenses, license, licenseLocations)
- continue
- }
-
- licenses = append(licenses, License{
- SPDXExpression: extractedLicense,
- Name: spdxLicense.Name,
- Locations: licenseLocations,
- Reference: spdxLicense.Reference,
- IsDeprecatedLicenseID: spdxLicense.IsDeprecatedLicenseID,
- DetailsURL: spdxLicense.DetailsURL,
- ReferenceNumber: spdxLicense.ReferenceNumber,
- LicenseID: spdxLicense.LicenseID,
- SeeAlso: spdxLicense.SeeAlso,
- IsOsiApproved: spdxLicense.IsOsiApproved,
- })
- }
- return licenses
-}
-
-func addNonSPDXLicense(licenses []License, license pkg.License, locations []string) []License {
- return append(licenses, License{
- Name: license.Value,
- Locations: locations,
- })
-}
-
-func check(checked map[string]bool, license string) bool {
- if _, ok := checked[license]; !ok {
- checked[license] = true
- return false
- }
- return true
-}
diff --git a/grant/license_test.go b/grant/license_test.go
deleted file mode 100644
index 5f53bde..0000000
--- a/grant/license_test.go
+++ /dev/null
@@ -1,109 +0,0 @@
-package grant
-
-import (
- "testing"
-
- "github.com/google/go-cmp/cmp"
-
- "github.com/anchore/syft/syft/file"
- "github.com/anchore/syft/syft/pkg"
-)
-
-func Test_ConvertSyftLicenses(t *testing.T) {
- singleSyftLicense := []pkg.License{
- pkg.License{
- SPDXExpression: "MIT",
- Value: "MIT",
- Locations: file.NewLocationSet(file.NewLocation("/foo/bar")),
- },
- }
-
- multipleLicensesDuplicate := []pkg.License{
- {
- SPDXExpression: "MIT",
- Value: "MIT",
- Locations: file.NewLocationSet(file.NewLocation("/foo/MIT")),
- },
- {
- SPDXExpression: "Apache-2.0 AND MIT",
- Value: "Apache-2.0 AND MIT",
- Locations: file.NewLocationSet(file.NewLocation("/foo/complex")),
- },
- {
- Value: "I Made This License Up",
- Locations: file.NewLocationSet(file.NewLocation("/foo/custom")),
- },
- }
-
- tests := []struct {
- name string
- set pkg.LicenseSet
- want []License
- }{
- {
- name: "grant converts a set with a single syft license to the expected grant license",
- set: pkg.NewLicenseSet(singleSyftLicense...),
- want: []License{
- {
- SPDXExpression: "MIT",
- Name: "MIT License",
- Locations: []string{"/foo/bar"},
- Reference: "https://spdx.org/licenses/MIT.html",
- DetailsURL: "https://spdx.org/licenses/MIT.json",
- ReferenceNumber: 246,
- LicenseID: "MIT",
- SeeAlso: []string{"https://opensource.org/licenses/MIT"},
- IsOsiApproved: true,
- },
- },
- },
- {
- name: "grant converts a set with multiple syft licenses and a duplicate expression to the expected grant licenses",
- set: pkg.NewLicenseSet(multipleLicensesDuplicate...),
- want: []License{
- {
- SPDXExpression: "Apache-2.0",
- Name: "Apache License 2.0",
- Locations: []string{"/foo/complex"},
- Reference: "https://spdx.org/licenses/Apache-2.0.html",
- DetailsURL: "https://spdx.org/licenses/Apache-2.0.json",
- ReferenceNumber: 138,
- LicenseID: "Apache-2.0",
- SeeAlso: []string{
- "https://www.apache.org/licenses/LICENSE-2.0",
- "https://opensource.org/licenses/Apache-2.0",
- },
- IsOsiApproved: true,
- },
- {
- SPDXExpression: "MIT",
- Name: "MIT License",
- Locations: []string{"/foo/complex"},
- Reference: "https://spdx.org/licenses/MIT.html",
- DetailsURL: "https://spdx.org/licenses/MIT.json",
- ReferenceNumber: 246,
- LicenseID: "MIT",
- SeeAlso: []string{"https://opensource.org/licenses/MIT"},
- IsOsiApproved: true,
- },
- {
- Name: "I Made This License Up",
- Locations: []string{"/foo/custom"},
- },
- },
- },
- }
-
- for _, tc := range tests {
- t.Run(tc.name, func(t *testing.T) {
- got := ConvertSyftLicenses(tc.set)
- if len(got) != len(tc.want) {
- t.Errorf("unexpected number of licenses: %d != %d", len(got), len(tc.want))
- }
-
- if diff := cmp.Diff(tc.want, got); diff != "" {
- t.Errorf("unexpected licenses on convert (-want +got):\n%s", diff)
- }
- })
- }
-}
diff --git a/grant/package.go b/grant/package.go
index 0ae2f4a..14db4a1 100644
--- a/grant/package.go
+++ b/grant/package.go
@@ -1,28 +1,14 @@
package grant
-import syftpkg "github.com/anchore/syft/syft/pkg"
+// PackageID is a unique identifier for a package that is tracked by grant
+// It's usually provided by the SBOM; It's calculated if an SBOM is generated
+type PackageID string
// Package is a single package that is tracked by grant
type Package struct {
+ ID PackageID `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Version string `json:"version" yaml:"version"`
- Source string `json:"source" yaml:"source"`
Licenses []License `json:"licenses" yaml:"licenses"`
Locations []string `json:"locations" yaml:"locations"`
}
-
-func ConvertSyftPackage(p syftpkg.Package, source string) Package {
- locations := p.Locations.ToSlice()
- packageLocations := make([]string, 0)
- for _, location := range locations {
- packageLocations = append(packageLocations, location.RealPath)
- }
-
- return Package{
- Name: p.Name,
- Version: p.Version,
- Source: source,
- Licenses: ConvertSyftLicenses(p.Licenses),
- Locations: packageLocations,
- }
-}
diff --git a/grant/package_test.go b/grant/package_test.go
deleted file mode 100644
index eb2d4fa..0000000
--- a/grant/package_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package grant
diff --git a/grant/policy.go b/grant/policy.go
index 3a6fd99..5f5ee5b 100644
--- a/grant/policy.go
+++ b/grant/policy.go
@@ -8,27 +8,28 @@ import (
// Policy is a structure of glob patterns that represent either allowed or denied licenses
type Policy struct {
- AllowLicenses []glob.Glob `json:"allowLicenses" yaml:"allowLicenses" mapstructure:"allowLicenses"`
- DenyLicenses []glob.Glob `json:"denyLicenses" yaml:"denyLicenses" mapstructure:"denyLicenses"`
- denyAll bool
- allowAll bool
+ AllowLicenses []glob.Glob `json:"allowLicenses" yaml:"allowLicenses" mapstructure:"allowLicenses"`
+ DenyLicenses []glob.Glob `json:"denyLicenses" yaml:"denyLicenses" mapstructure:"denyLicenses"`
+ IgnoreLicenses []glob.Glob `json:"ignoreLicenses" yaml:"ignoreLicenses" mapstructure:"ignoreLicenses"`
+ denyAll bool
+ allowAll bool
}
// DefaultPolicy returns a policy that denies all licenses
-func DefaultPolicy() *Policy {
- return &Policy{
+func DefaultPolicy() Policy {
+ return Policy{
AllowLicenses: make([]glob.Glob, 0),
DenyLicenses: []glob.Glob{
glob.MustCompile("*"),
},
- denyAll: true,
+ IgnoreLicenses: make([]glob.Glob, 0),
+ denyAll: true,
}
}
// NewPolicy builds a policy from lists of allow and deny glob patterns
// It lower cases all patterns to make matching against the spdx license set case-insensitive
-// The grant.Result.Evaluate() function found under grant/result.go will lower case all licenses for matching
-func NewPolicy(allowLicenses []string, denyLicenses []string) (*Policy, error) {
+func NewPolicy(allowLicenses, denyLicenses, ignoreLicenses []string) (Policy, error) {
if len(allowLicenses) == 0 && len(denyLicenses) == 0 {
return DefaultPolicy(), nil
}
@@ -43,7 +44,7 @@ func NewPolicy(allowLicenses []string, denyLicenses []string) (*Policy, error) {
deny = strings.ToLower(deny)
denyGlob, err := glob.Compile(deny)
if err != nil {
- return nil, err
+ return Policy{}, err
}
denyGlobs = append(denyGlobs, denyGlob)
if deny == "*" {
@@ -56,7 +57,7 @@ func NewPolicy(allowLicenses []string, denyLicenses []string) (*Policy, error) {
allow = strings.ToLower(allow)
allowGlob, err := glob.Compile(allow)
if err != nil {
- return nil, err
+ return Policy{}, err
}
allowGlobs = append(allowGlobs, allowGlob)
if allow == "*" {
@@ -64,11 +65,22 @@ func NewPolicy(allowLicenses []string, denyLicenses []string) (*Policy, error) {
}
}
- return &Policy{
- AllowLicenses: allowGlobs,
- DenyLicenses: denyGlobs,
- denyAll: denyAll,
- allowAll: allowAll,
+ ignoreGlobs := make([]glob.Glob, 0)
+ for _, ignore := range ignoreLicenses {
+ ignore = strings.ToLower(ignore)
+ ignoreGlob, err := glob.Compile(ignore)
+ if err != nil {
+ return Policy{}, err
+ }
+ ignoreGlobs = append(ignoreGlobs, ignoreGlob)
+ }
+
+ return Policy{
+ AllowLicenses: allowGlobs,
+ DenyLicenses: denyGlobs,
+ IgnoreLicenses: ignoreGlobs,
+ denyAll: denyAll,
+ allowAll: allowAll,
}, nil
}
@@ -77,11 +89,12 @@ func (p Policy) IsEmpty() bool {
return len(p.AllowLicenses) == 0 && len(p.DenyLicenses) == 0
}
-// Deny returns true if the given license is denied by the policy
+// IsDenied returns true if the given license is denied by the policy
// If the policy has a "*" deny all, then the allow list is checked first
// If the policy has no "*" deny all, then the deny list is checked first
// If the license is not denied by the policy, but deny all is not set, then the allow list is checked
-func (p Policy) Deny(license License) bool {
+// TODO: how does this work with ignore?
+func (p Policy) IsDenied(license License) bool {
// deny is superior to allow
if p.denyAll && p.allowAll {
return true
@@ -125,7 +138,7 @@ func (p Policy) Deny(license License) bool {
return false
}
-// Allow is a convenience function for library consumers
-func (p Policy) Allow(license License) bool {
- return !p.Deny(license)
+// IsAllowed is a convenience function for library consumers
+func (p Policy) IsAllowed(license License) bool {
+ return !p.IsDenied(license)
}
diff --git a/grant/policy_test.go b/grant/policy_test.go
index 7bbc39b..d19e82a 100644
--- a/grant/policy_test.go
+++ b/grant/policy_test.go
@@ -5,20 +5,27 @@ import (
"github.com/gobwas/glob"
"github.com/google/go-cmp/cmp"
+ "github.com/google/go-cmp/cmp/cmpopts"
)
func Test_DefaultPolicy(t *testing.T) {
tests := []struct {
- name string
- want *Policy
+ name string
+ want Policy
+ compareOptions []cmp.Option
}{
{
name: "DefaultPolicy() returns the expected default policy",
- want: &Policy{
+ want: Policy{
AllowLicenses: make([]glob.Glob, 0),
DenyLicenses: []glob.Glob{
glob.MustCompile("*"),
},
+ IgnoreLicenses: make([]glob.Glob, 0),
+ denyAll: true,
+ },
+ compareOptions: []cmp.Option{
+ cmpopts.IgnoreFields(Policy{}, "denyAll", "allowAll"),
},
},
}
@@ -26,26 +33,32 @@ func Test_DefaultPolicy(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
got := DefaultPolicy()
- if diff := cmp.Diff(tc.want, got); diff != "" {
+ if diff := cmp.Diff(tc.want, got, tc.compareOptions...); diff != "" {
t.Errorf("DefaultPolicy() mismatch (-want +got):\n%s", diff)
}
+ if got.denyAll != true {
+ t.Errorf("DefaultPolicy() denyAll = %v, want %v", got.denyAll, true)
+ }
})
}
}
func Test_NewPolicy(t *testing.T) {
tests := []struct {
- name string
- allowLicenses []string
- denyLicenses []string
- want *Policy
- wantErr bool
+ name string
+ allowLicenses []string
+ denyLicenses []string
+ ignoreLicenses []string
+ want Policy
+ compareOptions []cmp.Option
+ wantErr bool
}{
{
- name: "NewPolicy() returns the expected policy",
- allowLicenses: []string{"MIT", "Apache-2.0"},
- denyLicenses: []string{"GPL-3.0"},
- want: &Policy{
+ name: "NewPolicy() returns the expected policy",
+ allowLicenses: []string{"MIT", "Apache-2.0"},
+ denyLicenses: []string{"GPL-3.0"},
+ ignoreLicenses: make([]string, 0),
+ want: Policy{
AllowLicenses: []glob.Glob{
glob.MustCompile("mit"),
glob.MustCompile("apache-2.0"),
@@ -53,18 +66,27 @@ func Test_NewPolicy(t *testing.T) {
DenyLicenses: []glob.Glob{
glob.MustCompile("gpl-3.0"),
},
+ IgnoreLicenses: make([]glob.Glob, 0),
+ },
+ compareOptions: []cmp.Option{
+ cmpopts.IgnoreFields(Policy{}, "denyAll", "allowAll"),
},
wantErr: false,
},
{
- name: "NewPolicy() returns the expected policy when allow and deny licenses are empty",
- allowLicenses: []string{},
- denyLicenses: []string{},
- want: &Policy{
+ name: "NewPolicy() returns the expected policy when allow and deny licenses are empty",
+ allowLicenses: []string{},
+ denyLicenses: []string{},
+ ignoreLicenses: []string{},
+ want: Policy{
AllowLicenses: make([]glob.Glob, 0),
DenyLicenses: []glob.Glob{
glob.MustCompile("*"),
},
+ IgnoreLicenses: make([]glob.Glob, 0),
+ },
+ compareOptions: []cmp.Option{
+ cmpopts.IgnoreFields(Policy{}, "denyAll", "allowAll"),
},
wantErr: false,
},
@@ -72,12 +94,12 @@ func Test_NewPolicy(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
- got, err := NewPolicy(tc.allowLicenses, tc.denyLicenses)
+ got, err := NewPolicy(tc.allowLicenses, tc.denyLicenses, tc.ignoreLicenses)
if (err != nil) != tc.wantErr {
t.Errorf("NewPolicy() error = %v, wantErr %v", err, tc.wantErr)
return
}
- if diff := cmp.Diff(tc.want, got); diff != "" {
+ if diff := cmp.Diff(tc.want, got, tc.compareOptions...); diff != "" {
t.Errorf("NewPolicy() mismatch (-want +got):\n%s", diff)
}
})
diff --git a/grant/report.go b/grant/report.go
deleted file mode 100644
index b985a28..0000000
--- a/grant/report.go
+++ /dev/null
@@ -1,153 +0,0 @@
-package grant
-
-import (
- "errors"
- "fmt"
- "io"
- "time"
-
- "github.com/anchore/grant/internal/input"
- syftFormat "github.com/anchore/syft/syft/format"
-)
-
-// Report tracks the results of a license check.
-// For each source a report will generate a Result. A report can have multiple results.
-// The report will track the policy used to generate the report and apply it to all results.
-//
-// Multiple sources can be configured for a report. A source can be one of the following
-// Single Sources Provider:
-// - a path to a sbom file (uses the given SBOM (spdx, cyclonedx, etc))
-// TODO: - a path to a directory (generates an SBOM for the given directory)
-// TODO: - a path to some archive (generates an SBOM for the given archive)
-// TODO: - a path to a container image (generates an SBOM for the given image)
-//
-// Multiple Source Provider:
-// - multiple paths to sbom files
-// TODO: - a path to a directory containing sbom files
-// TODO: - a path to a container image with sbom files
-// TODO: - a path to a directory containing container images
-// TODO: - a path to a directory containing container images and sbom files
-type Report struct {
- // Results of the report for each source
- Results []Result `json:"results" yaml:"results"`
- // Sources included in the report
- Sources []string `json:"sources" yaml:"sources"`
- // Policy used to generate the report. Applies to all results
- Policy *Policy `json:"policy" yaml:"policy"`
- Format Format `json:"format" yaml:"format"`
- Timestamp string `json:"timestamp" yaml:"timestamp"`
- errors []error
-}
-
-type Format string
-
-const (
- JSON Format = "json"
- Table Format = "table"
-)
-
-// NewReport will generate a new report for the given format, policy and sources
-// If no policy is provided, the default policy will be used
-// If no sources are provided, an empty report will be generated
-// If a source is provided, but the sbom cannot be generated, the source will be ignored
-// If a source is provided, but the sbom cannot be decoded, the source will be ignored
-// Results will be generated and evaluated for each source that is successfully processed
-func NewReport(f Format, policy *Policy, srcs ...string) *Report {
- if policy == nil || policy.IsEmpty() {
- policy = DefaultPolicy()
- }
-
- format := validateFormat(f)
- results := make([]Result, 0)
- errs := make([]error, 0)
- for _, src := range srcs {
- reader, err := input.GetReader(src)
- if err != nil {
- errs = append(errs, fmt.Errorf("%w; could not check licenses; could not get reader for source: %s ", err, src))
- continue
- }
-
- sbomDecoders := syftFormat.NewDecoderCollection(syftFormat.Decoders()...)
- sbom, formatID, version, err := sbomDecoders.Decode(reader)
- if err != nil {
- errs = append(errs, fmt.Errorf("%w; could not build result; could not decode sbom: %s ", err, src))
- continue
- }
- results = append(results, NewResult(policy, src, sbom, formatID.String(), version))
- }
-
- return &Report{
- Results: results,
- Sources: srcs,
- Policy: policy,
- Format: format,
- Timestamp: time.Now().Format(time.RFC3339),
- errors: errs,
- }
-}
-
-// Run will call Generate on each result in the report and return the report
-func (r *Report) Run() *Report {
- for _, result := range r.Results {
- err := result.Generate()
- if err != nil {
- r.errors = append(r.errors, fmt.Errorf("%w; failed to generate result for source: %s", err, result.Source))
- }
- }
- return r
-}
-
-// Render will call Render on each result in the report and return the report
-func (r *Report) Render(out io.Writer) error {
- return errors.Join(r.errors...)
-}
-
-//func presentReports(reports []*grant.Report) error {
-// l := list.NewWriter() // TODO: style me
-// customStyle := list.Style{
-// Format: text.FormatTitle,
-// CharItemSingle: "",
-// CharItemTop: "",
-// CharItemFirst: "",
-// CharItemMiddle: "",
-// CharItemVertical: " ",
-// CharItemBottom: "",
-// CharNewline: "\n",
-// LinePrefix: "",
-// Name: "customStyle",
-// }
-// l.SetStyle(customStyle)
-// for _, report := range reports {
-// if len(report.PackageViolations) == 0 {
-// l.AppendItem("No License Violations: ✅")
-// continue
-// }
-//
-// l.AppendItem("License Violations:")
-// for license, pkg := range report.LicenseViolations {
-// l.AppendItem(fmt.Sprintf("%s %s", fmt.Sprint("-"), license))
-// // TODO: we probably want a flag that can turn this on
-// for _, p := range pkg {
-// l.Indent()
-// l.AppendItem(fmt.Sprintf("%s %s", fmt.Sprint("-"), p))
-// l.UnIndent()
-// }
-// l.UnIndent()
-// }
-// }
-//
-// bus.Report(l.Render())
-// return nil
-//}
-
-// validFormat returns a valid format or the default format if the given format is invalid
-func validateFormat(f Format) Format {
- switch f {
- case "json":
- return JSON
- case "table":
- return Table
- default:
- return Table
- }
-}
diff --git a/grant/report/eval_license.go b/grant/report/eval_license.go
new file mode 100644
index 0000000..56777d9
--- /dev/null
+++ b/grant/report/eval_license.go
@@ -0,0 +1,39 @@
+package report
+
+import (
+ "github.com/anchore/grant/grant"
+)
+
+type licenseEval struct {
+ // license is the license that was evaluated
+ license grant.License
+ // policy is the policy used to evaluate the license
+ policy grant.Policy
+}
+
+func (e *licenseEval) IsFailed() bool {
+ return true
+}
+
+func (e *licenseEval) GetPackages() []grant.Package {
+ return []grant.Package{}
+}
+
+func (e *licenseEval) GetLicenses() []grant.License {
+ return []grant.License{e.license}
+}
+
+func (e *licenseEval) GetViolations() []Violation {
+ return []Violation{}
+}
+
+func (e *licenseEval) GetPolicy() grant.Policy {
+ return e.policy
+}
+
+func evalFromLicense(ec EvaluationConfig, l grant.License) Evaluation {
+ return &licenseEval{
+ license: l,
+ policy: ec.Policy,
+ }
+}
diff --git a/grant/report/eval_sbom.go b/grant/report/eval_sbom.go
new file mode 100644
index 0000000..ded2699
--- /dev/null
+++ b/grant/report/eval_sbom.go
@@ -0,0 +1,250 @@
+package report
+
+import (
+ "github.com/github/go-spdx/v2/spdxexp"
+
+ "github.com/anchore/grant/grant"
+ "github.com/anchore/grant/internal/log"
+ "github.com/anchore/grant/internal/spdxlicense"
+ syftPkg "github.com/anchore/syft/syft/pkg"
+ "github.com/anchore/syft/syft/sbom"
+)
+
+// sboms map packages and licenses together
+// evalIndex is a more complex Evaluation that tracks packages and licenses
+type evalIndex struct {
+ packages map[grant.PackageID]grant.Package
+
+ // packageViolations and their licenses that violated the policy
+ packageViolations map[grant.PackageID][]grant.License
+ // compliantPackages and their licenses that were compliant to the policy
+ compliantPackages map[grant.PackageID][]grant.License
+ // ignoredPackages tracks packages with licenses that were not SPDX compliant
+ ignoredPackages map[grant.PackageID][]grant.License
+
+ licenses map[grant.LicenseID]grant.License
+
+ // licenseViolations not allowed by the policy and the packages that contained them
+ // The key for these is the all lowercase SPDX license ID found in internal/spdxlicense/license.go
+ licenseViolations map[grant.LicenseID][]grant.Package
+ // compliantLicenses that were allowed by the policy and the packages that contained them
+ compliantLicenses map[grant.LicenseID][]grant.Package
+ // ignoredLicenses that were not SPDX compliant and the packages that contained them
+ ignoredLicenses map[grant.LicenseID][]grant.Package
+
+ // policy is the policy used to generate this evaluation
+ policy grant.Policy
+}
+
+func (i *evalIndex) GetPackages() []grant.Package {
+ packages := make([]grant.Package, 0)
+ for _, pkg := range i.packages {
+ packages = append(packages, pkg)
+ }
+ return packages
+}
+
+func (i *evalIndex) GetLicenses() []grant.License {
+ licenses := make([]grant.License, 0)
+ for _, license := range i.licenses {
+ licenses = append(licenses, license)
+ }
+ return licenses
+}
+
+// GetViolations is oriented by licenseID
+func (i *evalIndex) GetViolations() []Violation {
+ violations := make([]Violation, 0)
+ for licenseID, packages := range i.licenseViolations {
+ license := i.licenses[licenseID]
+ for _, pkg := range packages {
+ violations = append(violations, Violation{
+ License: license,
+ Package: pkg,
+ })
+ }
+ }
+ return violations
+}
+
+func (i *evalIndex) GetPolicy() grant.Policy {
+ return i.policy
+}
+
+func (i *evalIndex) IsFailed() bool {
+ return len(i.licenseViolations) > 0
+}
+
+func newEvalIndex(p grant.Policy) *evalIndex {
+ return &evalIndex{
+ packages: make(map[grant.PackageID]grant.Package),
+ packageViolations: make(map[grant.PackageID][]grant.License),
+ compliantPackages: make(map[grant.PackageID][]grant.License),
+ ignoredPackages: make(map[grant.PackageID][]grant.License),
+
+ licenses: make(map[grant.LicenseID]grant.License),
+ licenseViolations: make(map[grant.LicenseID][]grant.Package),
+ compliantLicenses: make(map[grant.LicenseID][]grant.Package),
+ ignoredLicenses: make(map[grant.LicenseID][]grant.Package),
+ policy: p,
+ }
+}
+
+func (i *evalIndex) addViolation(grantPkg grant.Package, license grant.License) {
+ if _, ok := i.packages[grantPkg.ID]; !ok {
+ i.packages[grantPkg.ID] = grantPkg
+ }
+ if _, ok := i.licenses[license.ID]; !ok {
+ i.licenses[license.ID] = license
+ }
+
+ i.packageViolations[grantPkg.ID] = append(i.packageViolations[grantPkg.ID], license)
+ i.licenseViolations[license.ID] = append(i.licenseViolations[license.ID], grantPkg)
+}
+
+func (i *evalIndex) addCompliant(grantPkg grant.Package, license *grant.License) {
+ i.packages[grantPkg.ID] = grantPkg
+ if license != nil {
+ i.licenses[license.ID] = *license
+ i.compliantPackages[grantPkg.ID] = append(i.compliantPackages[grantPkg.ID], *license)
+ i.compliantLicenses[license.ID] = append(i.compliantLicenses[license.ID], grantPkg)
+ return
+ }
+
+ // no license was provided, so we'll just add the package
+ if _, ok := i.compliantPackages[grantPkg.ID]; !ok {
+ i.compliantPackages[grantPkg.ID] = make([]grant.License, 0)
+ }
+}
+
+// Note: if a license has been ignored, it means the SPDX expression was invalid
+// or the user config specified to ignore the specific license
+func (i *evalIndex) addIgnored(grantPkg grant.Package, license grant.License) {
+}
+
+func evalFromSBOM(ec EvaluationConfig, s sbom.SBOM) *evalIndex {
+ index := newEvalIndex(ec.Policy)
+ for pkg := range s.Artifacts.Packages.Enumerate() {
+ // since we use syft to generate the sbom we need to convert packages/licenses to grant types
+ grantPkg := convertSyftPackage(pkg)
+ if len(grantPkg.Licenses) == 0 {
+ // no licenses found for this package
+ index.addCompliant(grantPkg, nil)
+ }
+ for _, license := range grantPkg.Licenses {
+ // TODO: check if the license is in the config ignore list
+ // TODO: check if the config wants us to check for non-SPDX licenses
+ if !license.IsSPDX() {
+ index.addIgnored(grantPkg, license)
+ continue
+ }
+
+ if ec.Policy.IsDenied(license) {
+ index.addViolation(grantPkg, license)
+ continue
+ }
+ // otherwise, the license is allowed
+ index.addCompliant(grantPkg, &license)
+ }
+ }
+
+ return index
+}
+
+func convertSyftPackage(p syftPkg.Package) grant.Package {
+ locations := p.Locations.ToSlice()
+ packageLocations := make([]string, 0)
+ for _, location := range locations {
+ packageLocations = append(packageLocations, location.RealPath)
+ }
+
+ return grant.Package{
+ Name: p.Name,
+ Version: p.Version,
+ Licenses: convertSyftLicenses(p.Licenses),
+ Locations: packageLocations,
+ }
+}
+
+// convertSyftLicenses converts a syft LicenseSet to a grant License slice
+// note: syft licenses can sometimes have complex SPDX expressions.
+// Grant licenses break down these expressions into individual licenses.
+// Because license expressions could potentially contain multiple licenses
+// that are already represented in the syft license set we need to de-duplicate
+// syft licenses have a "Value" field which is the name of the license
+// given to an invalid SPDX expression; grant licenses store this field as "Name"
+func convertSyftLicenses(set syftPkg.LicenseSet) (licenses []grant.License) {
+ licenses = make([]grant.License, 0)
+ checked := make(map[string]bool)
+ for _, license := range set.ToSlice() {
+ locations := license.Locations.ToSlice()
+ licenseLocations := make([]string, 0)
+ for _, location := range locations {
+ licenseLocations = append(licenseLocations, location.RealPath)
+ }
+
+ if license.SPDXExpression != "" {
+ licenses = handleSPDXLicense(license, licenses, licenseLocations, checked)
+ continue
+ }
+
+ licenses = addNonSPDXLicense(licenses, license, licenseLocations)
+ }
+ return licenses
+}
+
+func handleSPDXLicense(license syftPkg.License, licenses []grant.License, licenseLocations []string, checked map[string]bool) []grant.License {
+ extractedLicenses, err := spdxexp.ExtractLicenses(license.SPDXExpression)
+ if err != nil {
+ log.Errorf("unable to extract licenses from SPDX expression: %s", license.SPDXExpression)
+ return addNonSPDXLicense(licenses, license, licenseLocations)
+ }
+
+ // process each extracted license from the SPDX expression
+ for _, extractedLicense := range extractedLicenses {
+ // prevent duplicates from being added when using SPDX expressions
+ // EG: "MIT AND MIT" is valid, but we want to de-duplicate these
+ if check(checked, extractedLicense) {
+ continue
+ }
+
+ // we have what seems to be a valid SPDX license ID, let's try and get more info about it
+ spdxLicense, err := spdxlicense.GetLicenseByID(extractedLicense)
+ if err != nil {
+ log.Errorf("unable to get license by ID: %s; no matching spdx id found", extractedLicense)
+ // if we can't find a matching SPDX license, just add the license as-is
+ // TODO: best matching against the spdx list index
+ addNonSPDXLicense(licenses, license, licenseLocations)
+ continue
+ }
+
+ licenses = append(licenses, grant.License{
+ SPDXExpression: extractedLicense,
+ Name: spdxLicense.Name,
+ Locations: licenseLocations,
+ Reference: spdxLicense.Reference,
+ IsDeprecatedLicenseID: spdxLicense.IsDeprecatedLicenseID,
+ DetailsURL: spdxLicense.DetailsURL,
+ ReferenceNumber: spdxLicense.ReferenceNumber,
+ LicenseID: spdxLicense.LicenseID,
+ SeeAlso: spdxLicense.SeeAlso,
+ IsOsiApproved: spdxLicense.IsOsiApproved,
+ })
+ }
+ return licenses
+}
+
+func addNonSPDXLicense(licenses []grant.License, license syftPkg.License, locations []string) []grant.License {
+ return append(licenses, grant.License{
+ Name: license.Value,
+ Locations: locations,
+ })
+}
+
+func check(checked map[string]bool, license string) bool {
+ if _, ok := checked[license]; !ok {
+ checked[license] = true
+ return false
+ }
+ return true
+}
diff --git a/grant/report/evaluation.go b/grant/report/evaluation.go
new file mode 100644
index 0000000..5c5d106
--- /dev/null
+++ b/grant/report/evaluation.go
@@ -0,0 +1,40 @@
+package report
+
+import (
+ "github.com/anchore/grant/grant"
+ "github.com/anchore/syft/syft/sbom"
+)
+
+// Evaluation is the result of a policy evaluation
+// Grant can evaluate either an SBOM(generated on demand) or an individual license
+type Evaluation interface {
+ GetPackages() []grant.Package
+ GetLicenses() []grant.License
+ GetViolations() []Violation
+ GetPolicy() grant.Policy
+ IsFailed() bool
+}
+
+type EvaluationConfig struct {
+ // Policy is the policy to evaluate against
+ Policy grant.Policy
+ // CheckNonSPDX is true if non-SPDX licenses should be checked
+ CheckNonSPDX bool
+}
+
+// Violation is a single license violation for a given evaluation
+// Package is optional as not all discovered licenses are associated with a package
+type Violation struct {
+ RequestID string
+ License grant.License
+ Package grant.Package
+ Reason string
+}
+
+func NewEvaluationFromSBOM(ec EvaluationConfig, s sbom.SBOM) Evaluation {
+ return evalFromSBOM(ec, s)
+}
+
+func NewEvaluationFromLicense(ec EvaluationConfig, l grant.License) Evaluation {
+ return evalFromLicense(ec, l)
+}
diff --git a/grant/report/evaluation_test.go b/grant/report/evaluation_test.go
new file mode 100644
index 0000000..80c499f
--- /dev/null
+++ b/grant/report/evaluation_test.go
@@ -0,0 +1 @@
+package report
diff --git a/grant/report/format.go b/grant/report/format.go
new file mode 100644
index 0000000..3fac189
--- /dev/null
+++ b/grant/report/format.go
@@ -0,0 +1,20 @@
+package report
+
+type Format string
+
+const (
+ JSON Format = "json"
+ Table Format = "table"
+)
+
+// validFormat returns a valid format or the default format if the given format is invalid
+func validateFormat(f Format) Format {
+ switch f {
+ case "json":
+ return JSON
+ case "table":
+ return Table
+ default:
+ return Table
+ }
+}
diff --git a/grant/report/input.go b/grant/report/input.go
new file mode 100644
index 0000000..7bf13f9
--- /dev/null
+++ b/grant/report/input.go
@@ -0,0 +1,200 @@
+package report
+
+import (
+ "context"
+ "fmt"
+ "io"
+ "io/fs"
+ golog "log"
+ "os"
+ "path/filepath"
+ "strings"
+
+ "github.com/google/licenseclassifier/v2/tools/identify_license/backend"
+
+ "github.com/anchore/grant/grant"
+ "github.com/anchore/grant/internal"
+ "github.com/anchore/grant/internal/log"
+ "github.com/anchore/syft/syft"
+ "github.com/anchore/syft/syft/format"
+ "github.com/anchore/syft/syft/pkg/cataloger"
+ "github.com/anchore/syft/syft/sbom"
+ "github.com/anchore/syft/syft/source"
+)
+
+func handleFile(path string) (r *requestBreakdown, err error) {
+ // let's see if it's an archive (isArchive)
+ if isArchive(path) {
+ sb, err := generateSyftSBOM(path)
+ if err != nil {
+ // We bail here since we can't generate an SBOM for the archive
+ return nil, err
+ }
+
+ // if there are licenses in the archive, syft should be enhanced to include them in the SBOM
+ // this overlap is a little weird, but grant should be able to take license files as input
+ return &requestBreakdown{
+ sboms: []sbom.SBOM{sb},
+ licenses: make([]grant.License, 0),
+ }, nil
+ }
+
+ // let's see if it's an SBOM
+ bytes, err := getReadSeeker(path)
+ if err != nil {
+ // We bail here since we can't get a reader for the file
+ return nil, err
+ }
+
+ sb, _, _, err := format.NewDecoderCollection(format.Decoders()...).Decode(bytes)
+ if sb != nil {
+ return &requestBreakdown{
+ sboms: []sbom.SBOM{*sb},
+ licenses: make([]grant.License, 0),
+ }, nil
+ }
+ // TODO: some log for the error here?
+
+ // alright we couldn't get an SBOM, let's see if the bytes are just a LICENSE (google license classifier)
+ be, err := backend.New()
+ if err != nil {
+ return nil, err
+ }
+ defer be.Close()
+
+ // google license classifier is noisy, so we'll silence it for now
+ golog.SetOutput(io.Discard)
+ if errs := be.ClassifyLicensesWithContext(
+ context.Background(),
+ 1000,
+ []string{path},
+ false,
+ ); errs != nil {
+ be.Close()
+ for _, err := range errs {
+ log.Errorf("unable to classify license: %+v", err)
+ }
+ return nil, fmt.Errorf("unable to classify license: %+v", err)
+ }
+ // re-enable logging for the rest of the application
+ golog.SetOutput(os.Stdout)
+
+ results := be.GetResults()
+ if len(results) == 0 {
+ return nil, fmt.Errorf("unable to determine SBOM or licenses for %s", path)
+ }
+
+ licenses := grantLicenseFromClassifierResults(results)
+
+ return &requestBreakdown{
+ sboms: make([]sbom.SBOM, 0),
+ licenses: licenses,
+ }, nil
+}
+
+func handleDir(root string) (r *requestBreakdown, err error) {
+ totalBreakdown := &requestBreakdown{
+ sboms: make([]sbom.SBOM, 0),
+ licenses: make([]grant.License, 0),
+ }
+
+ // Define the closure that will be used as the visit function
+ visit := func(s string, d fs.DirEntry, err error) error {
+ if err != nil {
+ return err
+ }
+ if !d.IsDir() {
+ // This isn't broken, the license classifier just returned two licenses
+ r, err := handleFile(s)
+ if err != nil {
+ // TODO: some log for the error here?
+ return nil
+ }
+ totalBreakdown.sboms = append(totalBreakdown.sboms, r.sboms...)
+ totalBreakdown.licenses = append(totalBreakdown.licenses, r.licenses...)
+ }
+ return nil
+ }
+
+ err = filepath.WalkDir(root, visit)
+ if err != nil {
+ return nil, err
+ }
+ return totalBreakdown, nil
+}
+
+func handleContainer(image string) (r *requestBreakdown, err error) {
+ sb, err := generateSyftSBOM(image)
+ if err != nil {
+ // We bail here since we can't generate an SBOM for the image
+ return nil, err
+ }
+
+ return &requestBreakdown{
+ sboms: []sbom.SBOM{sb},
+ licenses: make([]grant.License, 0),
+ }, nil
+}
+
+// TODO: is the default syft config good enough here?
+// we definitely need at least all the non default license magic turned on
+func generateSyftSBOM(path string) (sb sbom.SBOM, err error) {
+ detection, err := source.Detect("alpine:latest", source.DefaultDetectConfig())
+ if err != nil {
+ return sb, err
+ }
+
+ src, err := detection.NewSource(source.DefaultDetectionSourceConfig())
+ if err != nil {
+ return sb, err
+ }
+ collection, relationships, release, err := syft.CatalogPackages(src, cataloger.DefaultConfig())
+ if err != nil {
+ return sb, err
+ }
+
+ sb = sbom.SBOM{
+ Artifacts: sbom.Artifacts{
+ Packages: collection,
+ LinuxDistribution: release,
+ },
+ Relationships: relationships,
+ Source: src.Describe(),
+ Descriptor: sbom.Descriptor{
+ Name: internal.ApplicationName,
+ Version: internal.ApplicationVersion,
+ },
+ }
+ return sb, nil
+}
+
+func isDirectory(path string) bool {
+ fileInfo, err := os.Stat(path)
+ if err != nil {
+ log.Errorf("unable to stat directory %s: %+v", path, err)
+ return false
+ }
+ return fileInfo.IsDir()
+}
+
+func isArchive(path string) bool {
+ extension := filepath.Ext(path)
+ archiveExtensions := []string{".zip", ".tar", ".gz", ".rar", ".7z"}
+
+ for _, archiveExtension := range archiveExtensions {
+ if strings.EqualFold(extension, archiveExtension) {
+ return true
+ }
+ }
+
+ return false
+}
+
+func isFile(path string) bool {
+ fileInfo, err := os.Stat(path)
+ if err != nil {
+ log.Errorf("unable to stat file %s: %+v", path, err)
+ return false
+ }
+ return !fileInfo.IsDir()
+}
diff --git a/grant/report/report.go b/grant/report/report.go
new file mode 100644
index 0000000..9cd9441
--- /dev/null
+++ b/grant/report/report.go
@@ -0,0 +1,150 @@
+package report
+
+import (
+ "encoding/json"
+ "errors"
+ "io"
+ "time"
+
+ "github.com/anchore/grant/grant"
+)
+
+// Report tracks the requests/results of a license check.
+// `grant alpine:latest ./foo` is a single report with two requests
+// The first request is easy. Generate an SBOM for alpine:latest and run the policy against it.
+// The second request is a little more complicated. Generate an SBOM for ./foo and run the policy against it.
+// This is complex because the directory could contain multiple SBOMs, so we need to run the policy against each one.
+// Requests have the string that generated the request along with a list of results for that request.
+//
+// Here is the summary of what multiple source inputs can be configured for a report.
+// A source can be one of the following...
+// Single Sources Provider:
+// - a path to an sbom file (uses the given SBOM (spdx, cyclonedx, etc))
+// - a path to a directory (generates an SBOM for the given directory) (no other sbom files in the directory)
+// TODO: - a path to some archive (generates an SBOM for the given archive)
+// TODO: - a path to a container image (generates an SBOM for the given image)
+//
+// Multiple Source Provider:
+// - multiple paths to sbom files
+// TODO: - a path to a directory containing sbom files
+// TODO: - a path to a container image with sbom files
+// TODO: - a path to a directory containing container images (1.tar.gz 2.tar.gz 3.tar.gz)
+// TODO: - a path to a directory containing container images and sbom files
+type Report struct {
+ ReportID string
+ Requests []Request `json:"results" yaml:"results"`
+
+ // Evaluation is a pass/fail for the entire report;
+ // It rolls up violations from all the requests
+ Evaluation Evaluation `json:"evaluation" yaml:"evaluation"`
+ Format Format `json:"format" yaml:"format"`
+ Timestamp string `json:"timestamp" yaml:"timestamp"`
+ errors []error
+}
+
+// NewReport will generate a new report for the given format.
+// The supplied policy is applied to all user requests.
+// If no policy is provided, the default policy will be used
+// If no requests are provided, an empty report will be generated
+// If a request is provided, but the sbom cannot be generated, the source will be ignored
+// Results will be generated and evaluated for each user request that is successfully processed
+func NewReport(f Format, p grant.Policy, userRequests ...string) *Report {
+ if p.IsEmpty() {
+ p = grant.DefaultPolicy()
+ }
+ format := validateFormat(f)
+
+ requests := make([]Request, 0)
+ errs := make([]error, 0)
+ for _, r := range userRequests {
+ request, err := NewRequest(r, p)
+ if err != nil {
+ errs = append(errs, err)
+ continue
+ }
+ requests = append(requests, request)
+ }
+
+ return &Report{
+ Requests: requests,
+ Format: format,
+ Timestamp: time.Now().Format(time.RFC3339),
+ errors: errs,
+ }
+}
+
+// Render will call Render on each result in the report and return the report
+func (r *Report) Render(out io.Writer) error {
+ switch r.Format {
+ case JSON:
+ return r.renderJSON(out)
+ case Table:
+ return r.renderTable(out)
+ }
+ return errors.Join(r.errors...)
+}
+
+func (r *Report) renderJSON(out io.Writer) error {
+ return json.NewEncoder(out).Encode(r)
+}
+
+func (r *Report) renderTable(out io.Writer) error {
+ return nil
+}
+
+// l := list.NewWriter() // TODO: style me
+// customStyle := list.Style{
+// Format: text.FormatTitle,
+// CharItemSingle: "",
+// CharItemTop: "",
+// CharItemFirst: "",
+// CharItemMiddle: "",
+// CharItemVertical: " ",
+// CharItemBottom: "",
+// CharNewline: "\n",
+// LinePrefix: "",
+// Name: "customStyle",
+// }
+// l.SetStyle(customStyle)
+// for _, report := range reports {
+// if len(report.PackageViolations) == 0 {
+// l.AppendItem("No License Violations: ✅")
+// continue
+// }
+//
+// l.AppendItem("License Violations:")
+// for license, pkg := range report.LicenseViolations {
+// l.AppendItem(fmt.Sprintf("%s %s", fmt.Sprint("-"), license))
+// // TODO: we probably want a flag that can turn this on
+// for _, p := range pkg {
+// l.Indent()
+// l.AppendItem(fmt.Sprintf("%s %s", fmt.Sprint("-"), p))
+// l.UnIndent()
+// }
+// l.UnIndent()
+// }
+// }
+//
+// bus.Report(l.Render())
+// return nil
+//}
+
+//type ResultSummary struct {
+// CompliantPackages int `json:"compliant_packages" yaml:"compliant_packages"`
+// PackageViolations int `json:"package_violations" yaml:"package_violations"`
+// IgnoredPackages int `json:"ignored_packages" yaml:"ignored_packages"`
+// LicenseViolations int `json:"license_violations" yaml:"license_violations"`
+// CompliantLicenses int `json:"compliant_licenses" yaml:"compliant_licenses"`
+// IgnoredLicenses int `json:"ignored_licenses" yaml:"ignored_licenses"`
+//}
+//
+//func (r *Result) Summary() ResultSummary {
+// return ResultSummary{
+// CompliantPackages: len(r.CompliantPackages),
+// PackageViolations: len(r.PackageViolations),
+// IgnoredPackages: len(r.IgnoredPackages),
+// LicenseViolations: len(r.LicenseViolations),
+// CompliantLicenses: len(r.CompliantLicenses),
+// IgnoredLicenses: len(r.IgnoredLicenses),
+// }
+//}
diff --git a/grant/report/report_test.go b/grant/report/report_test.go
new file mode 100644
index 0000000..ecd7c5f
--- /dev/null
+++ b/grant/report/report_test.go
@@ -0,0 +1,62 @@
+package report
+
+import (
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/google/go-cmp/cmp/cmpopts"
+
+ "github.com/anchore/grant/grant"
+)
+
+func Test_NewReport(t *testing.T) {
+ tests := []struct {
+ name string
+ srcs []string
+ policy grant.Policy
+ format Format
+ want *Report
+ wantErr bool
+ compareOptions []cmp.Option
+ }{
+ {
+ name: "grant report constructor builds a new report, with the default policy, for a single source",
+ srcs: []string{"fixtures/test.spdx.json"},
+ policy: grant.DefaultPolicy(),
+ format: Table,
+ want: &Report{},
+ wantErr: false,
+ compareOptions: []cmp.Option{
+ cmpopts.IgnoreFields(grant.Policy{}, "denyAll", "allowAll"),
+ cmpopts.IgnoreFields(Report{}, "Timestamp", "errors"),
+ },
+ },
+ {
+ name: "grant report constructor builds a new report, with the default policy, for multiple sources",
+ srcs: []string{"fixtures/test.spdx.json", "fixtures/alpine.spdx"},
+ policy: grant.DefaultPolicy(),
+ format: Table,
+ want: &Report{},
+ wantErr: false,
+ compareOptions: []cmp.Option{
+ cmpopts.IgnoreFields(grant.Policy{}, "denyAll", "allowAll"),
+ cmpopts.IgnoreFields(Report{}, "Timestamp", "errors"),
+ },
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ got := NewReport(tt.format, tt.policy, tt.srcs...)
+ if got == nil {
+ t.Errorf("NewReport() = %v, want %v", got, tt.want)
+ }
+ if diff := cmp.Diff(tt.want, got, tt.compareOptions...); diff != "" {
+ t.Errorf("NewReport() mismatch (-want +got):\n%s", diff)
+ }
+ if len(got.errors) > 0 && !tt.wantErr {
+ t.Errorf("NewReport() errors = %v, want %v", got.errors, nil)
+ }
+ })
+ }
+}
diff --git a/grant/report/request.go b/grant/report/request.go
new file mode 100644
index 0000000..42bf42e
--- /dev/null
+++ b/grant/report/request.go
@@ -0,0 +1,118 @@
+package report
+
+import (
+ "fmt"
+ "io"
+ "os"
+
+ "github.com/google/licenseclassifier/v2/tools/identify_license/results"
+
+ "github.com/anchore/grant/grant"
+ "github.com/anchore/grant/internal/log"
+ "github.com/anchore/syft/syft/sbom"
+)
+
+type RequestID string
+
+type Request struct {
+ RequestID RequestID
+
+ // UserInput is the user input that was broken down into different Evaluations
+ // can be something like ./; so it can contain multiple Evaluations
+ // Consider: ./foo.spdx ./MIT ./image.tar.gz
+ // The UserInput in the above case would be "./" and the Evaluations would be:
+ // - ./foo.spdx SBOM
+ // - ./MIT LICENSE
+ // - ./image.tar.gz Generated SBOM
+ UserInput string
+
+ // Evaluation is a pass/fail for the entire request;
+ Evaluations []Evaluation
+}
+
+// NewRequest will generate a new request for the given userInput
+// The policy is applied to each determined Evaluation
+// A valid userRequest can be:
+// - a path to an SBOM file
+// - a path to a license
+// - a path to an archive
+// - a path to a directory (with any of the above)
+// - or some container image
+func NewRequest(userInput string, p grant.Policy) (r Request, err error) {
+ evaluations := make([]Evaluation, 0)
+
+ // TODO: we need to inject the user config here and convert it into a evaluation config
+ ec := EvaluationConfig{Policy: p}
+
+ requestBreakdown, err := determineRequest(userInput)
+ if err != nil {
+ log.Errorf("unable to determine SBOM or licenses for %s: %+v", userInput, err)
+ return r, err
+ }
+
+ // results are broken down into SBOMs (pkg -> license)
+ // or raw licenses that were detected with no package association
+ for _, sb := range requestBreakdown.sboms {
+ evaluations = append(evaluations, NewEvaluationFromSBOM(ec, sb))
+ }
+
+ for _, license := range requestBreakdown.licenses {
+ evaluations = append(evaluations, NewEvaluationFromLicense(ec, license))
+ }
+
+ // TODO: generate stable request ID
+ return Request{
+ RequestID: "",
+ UserInput: userInput,
+ Evaluations: evaluations,
+ }, nil
+}
+
+// easy way to break down a user request into SBOMs (generated or passed) and discovered licenses
+type requestBreakdown struct {
+ sboms []sbom.SBOM // All SBOMs found for the user request
+ licenses []grant.License // All licenses found for the user request (can be a directory of licenses or if the user request is a license)
+}
+
+// A valid userRequest can be:
+// - a path to an SBOM file
+// - a path to a license
+// - a path to a directory
+// - a path to an archive
+// - a path to a directory (with any of the above)
+// - a container image (ubuntu:latest)
+func determineRequest(userRequest string) (r *requestBreakdown, err error) {
+ switch {
+ case isFile(userRequest):
+ return handleFile(userRequest)
+ case isDirectory(userRequest):
+ return handleDir(userRequest)
+ default:
+ return handleContainer(userRequest)
+ }
+
+ // alright you got us here, we don't know what to do with this
+ return nil, fmt.Errorf("unable to determine SBOM or licenses for %s", userRequest)
+}
+
+func getReadSeeker(path string) (io.ReadSeeker, error) {
+ file, err := os.Open(path)
+ if err != nil {
+ return nil, fmt.Errorf("unable to open file: %w", err)
+ }
+ return file, nil
+}
+
+func grantLicenseFromClassifierResults(r results.LicenseTypes) []grant.License {
+ licenses := make([]grant.License, 0)
+ for _, license := range r {
+ // TODO: sometimes the license classifier gives us more information than just the name.
+ // How do we want to handle this or include it in the grant.License?
+ if license.MatchType == "License" {
+ licenses = append(licenses, grant.License{
+ Name: license.Name,
+ })
+ }
+ }
+ return licenses
+}
diff --git a/grant/report/request_test.go b/grant/report/request_test.go
new file mode 100644
index 0000000..3e1413f
--- /dev/null
+++ b/grant/report/request_test.go
@@ -0,0 +1,64 @@
+package report
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+func Test_determineRequest(t *testing.T) {
+ tests := []struct {
+ name string
+ userRequest string
+ expectedSBOM int
+ expectedLicense int
+ }{
+ {
+ name: "grant can determine a request for a single SBOM file",
+ userRequest: "../../fixtures/multiple/alpine.spdx.json",
+ expectedSBOM: 1,
+ expectedLicense: 0,
+ },
+ {
+ name: "grant can determine a request for a single license file",
+ userRequest: "../../fixtures/licenses/MIT",
+ expectedSBOM: 0,
+ expectedLicense: 1,
+ },
+ {
+ name: "grant can determine a request for a directory (multiple evaluation results)",
+ userRequest: "../../fixtures/multiple",
+ expectedSBOM: 1,
+ expectedLicense: 1,
+ },
+ {
+ name: "grant can determine a request for an archive (single sbom)",
+ userRequest: "../../fixtures/archive-builds/packages/example-java-app-maven-0.1.0.zip",
+ expectedSBOM: 1,
+ expectedLicense: 0,
+ },
+ {
+ name: "grant can determine a request for a container image (single sbom)",
+ userRequest: "alpine:latest",
+ expectedSBOM: 1,
+ expectedLicense: 0,
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ requestBreakdown, err := determineRequest(tt.userRequest)
+ if !assert.NoError(t, err) {
+ t.Fatalf("unexpected error: %+v", err)
+ }
+
+ if !assert.Equal(t, tt.expectedSBOM, len(requestBreakdown.sboms)) {
+ t.Fatalf("unexpected number of SBOMs: %d", len(requestBreakdown.sboms))
+ }
+
+ if !assert.Equal(t, tt.expectedLicense, len(requestBreakdown.licenses)) {
+ t.Fatalf("unexpected number of licenses: %d", len(requestBreakdown.licenses))
+ }
+ })
+ }
+}
diff --git a/grant/report/result_test.go b/grant/report/result_test.go
new file mode 100644
index 0000000..64d9156
--- /dev/null
+++ b/grant/report/result_test.go
@@ -0,0 +1,112 @@
+package report
+
+//import (
+// "testing"
+//
+// "github.com/google/go-cmp/cmp"
+// "github.com/google/go-cmp/cmp/cmpopts"
+//
+// "github.com/anchore/grant/grant"
+// "github.com/anchore/grant/grant/report/result"
+// "github.com/anchore/grant/internal/input"
+// syftFormat "github.com/anchore/syft/syft/format"
+// "github.com/anchore/syft/syft/sbom"
+//)
+//
+//func Test_NewResult(t *testing.T) {
+// tests := []struct {
+// name string
+// policy *grant.Policy
+// src string
+// want result.Result
+// cmpignore []cmp.Option
+// }{
+// {
+// name: "happy path",
+// policy: grant.DefaultPolicy(),
+// src: "fixtures/test.spdx.json",
+// want: result.Result{
+// Source: "fixtures/test.spdx.json",
+// Policy: grant.DefaultPolicy(),
+// PackageViolations: make(map[string][]grant.License),
+// CompliantPackages: make(map[string][]grant.License),
+// IgnoredPackages: make(map[string][]grant.License),
+// LicenseViolations: make(map[string][]grant.Package),
+// CompliantLicenses: make(map[string][]grant.Package),
+// IgnoredLicenses: make(map[string][]grant.Package),
+// },
+// cmpignore: []cmp.Option{
+// cmpopts.IgnoreFields(result.Result{}, "sbom", "sbomFormat", "sbomFormatVersion"),
+// cmpopts.IgnoreFields(grant.Policy{}, "denyAll", "allowAll"),
+// },
+// },
+// }
+//
+// for _, tt := range tests {
+// t.Run(tt.name, func(t *testing.T) {
+// sb, formatID, version, err := generateSBOMFromFixture(tt.src)
+// if err != nil {
+// t.Fatalf("unable to generate sbom from fixture: %+v", err)
+// }
+// result := result.NewResult(tt.policy, tt.src, sb, formatID, version)
+// if diff := cmp.Diff(tt.want, result, tt.cmpignore...); diff != "" {
+// t.Errorf("NewResult() mismatch (-want +got):\n%s", diff)
+// }
+// })
+// }
+//}
+//
+//func Test_Result_Generate(t *testing.T) {
+// tests := []struct {
+// name string
+// policy *grant.Policy
+// src string
+// expectedResultSummary ResultSummary
+// }{
+// {
+// name: "Result.Generate() denies all packages with licenses for the default policy",
+// policy: grant.DefaultPolicy(),
+// src: "fixtures/test.spdx.json",
+// // cat grant/fixtures/test.spdx.json | jq '.packages | length'
+// // 16 packages - 1 package with no licenses (alpine as the source is registered as a package) = 15 violations
+// // TODO: currently the source container package is being dropped by the decoder, so we are not seeing it in the result
+// expectedResultSummary: ResultSummary{
+// CompliantPackages: 0,
+// PackageViolations: 15,
+// IgnoredPackages: 0,
+// LicenseViolations: 7,
+// CompliantLicenses: 0,
+// IgnoredLicenses: 0,
+// },
+// },
+// }
+//
+// for _, tt := range tests {
+// t.Run(tt.name, func(t *testing.T) {
+// sb, formatID, version, err := generateSBOMFromFixture(tt.src)
+// if err != nil {
+// t.Fatalf("unable to generate sbom from fixture: %+v", err)
+// }
+//
+// result := result.NewResult(tt.policy, tt.src, sb, formatID, version)
+// err = result.Generate()
+// if err != nil {
+// t.Fatalf("unable to generate result: %+v", err)
+// }
+// gotResultSummary := result.Summary()
+// if diff := cmp.Diff(tt.expectedResultSummary, gotResultSummary); diff != "" {
+// t.Errorf("Result.Generate() mismatch (-want +got):\n%s", diff)
+// }
+// })
+// }
+//}
+//
+//func generateSBOMFromFixture(fixture string) (sb *sbom.SBOM, formatID, version string, err error) {
+// reader, err := input.GetReader(fixture)
+// if err != nil {
+// return nil, "", "", err
+// }
+// sbomDecoders := syftFormat.NewDecoderCollection(syftFormat.Decoders()...)
+// sb, fID, version, err := sbomDecoders.Decode(reader)
+// return sb, fID.String(), version, err
+//}
diff --git a/grant/report_test.go b/grant/report_test.go
deleted file mode 100644
index 14c1d2e..0000000
--- a/grant/report_test.go
+++ /dev/null
@@ -1,102 +0,0 @@
-package grant
-
-import (
- "testing"
-
- "github.com/google/go-cmp/cmp"
- "github.com/google/go-cmp/cmp/cmpopts"
-)
-
-func Test_NewReport(t *testing.T) {
- tests := []struct {
- name string
- srcs []string
- policy *Policy
- format Format
- want *Report
- wantErr bool
- compareOptions []cmp.Option
- }{
- {
- name: "grant report constructor builds a new report, with the default policy, for a single source",
- srcs: []string{"fixtures/test.spdx.json"},
- policy: DefaultPolicy(),
- format: Table,
- want: &Report{
- Sources: []string{"fixtures/test.spdx.json"},
- Policy: DefaultPolicy(),
- Results: []Result{
- {
- Source: "fixtures/test.spdx.json",
- Policy: DefaultPolicy(),
- PackageViolations: make(map[string][]License),
- CompliantPackages: make(map[string][]License),
- IgnoredPackages: make(map[string][]License),
- LicenseViolations: make(map[string][]Package),
- CompliantLicenses: make(map[string][]Package),
- IgnoredLicenses: make(map[string][]Package),
- },
- },
- },
- wantErr: false,
- compareOptions: []cmp.Option{
- cmpopts.IgnoreFields(Policy{}, "denyAll", "allowAll"),
- cmpopts.IgnoreFields(Report{}, "Timestamp", "errors"),
- cmpopts.IgnoreFields(Result{}, "sbom", "sbomFormat", "sbomFormatVersion"),
- },
- },
- {
- name: "grant report constructor builds a new report, with the default policy, for multiple sources",
- srcs: []string{"fixtures/test.spdx.json", "fixtures/alpine.spdx"},
- policy: DefaultPolicy(),
- format: Table,
- want: &Report{
- Sources: []string{"fixtures/test.spdx.json", "fixtures/alpine.spdx"},
- Policy: DefaultPolicy(),
- Results: []Result{
- {
- Source: "fixtures/test.spdx.json",
- Policy: DefaultPolicy(),
- PackageViolations: make(map[string][]License),
- CompliantPackages: make(map[string][]License),
- IgnoredPackages: make(map[string][]License),
- LicenseViolations: make(map[string][]Package),
- CompliantLicenses: make(map[string][]Package),
- IgnoredLicenses: make(map[string][]Package),
- },
- {
- Source: "fixtures/alpine.spdx",
- Policy: DefaultPolicy(),
- PackageViolations: make(map[string][]License),
- CompliantPackages: make(map[string][]License),
- IgnoredPackages: make(map[string][]License),
- LicenseViolations: make(map[string][]Package),
- CompliantLicenses: make(map[string][]Package),
- IgnoredLicenses: make(map[string][]Package),
- },
- },
- },
- wantErr: false,
- compareOptions: []cmp.Option{
- cmpopts.IgnoreFields(Policy{}, "denyAll", "allowAll"),
- cmpopts.IgnoreFields(Report{}, "Timestamp", "errors"),
- cmpopts.IgnoreFields(Result{}, "sbom", "sbomFormat", "sbomFormatVersion"),
- },
- },
- }
-
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- got := NewReport(tt.format, tt.policy, tt.srcs...)
- if got == nil {
- t.Errorf("NewReport() = %v, want %v", got, tt.want)
- }
- if diff := cmp.Diff(tt.want, got, tt.compareOptions...); diff != "" {
- t.Errorf("NewReport() mismatch (-want +got):\n%s", diff)
- }
- if len(got.errors) > 0 && !tt.wantErr {
- t.Errorf("NewReport() errors = %v, want %v", got.errors, nil)
- }
- })
- }
-}
diff --git a/grant/result.go b/grant/result.go
deleted file mode 100644
index 7ff344f..0000000
--- a/grant/result.go
+++ /dev/null
@@ -1,128 +0,0 @@
-package grant
-
-import (
- "github.com/anchore/syft/syft/sbom"
-)
-
-// Result is a single license policy evaluation for a single source
-type Result struct {
- // Source that was checked
- Source string `json:"source" yaml:"source"`
- // Policy used against the Result
- Policy *Policy `json:"policy" yaml:"policy"`
-
- // PackageViolations and their licenses that violated the policy
- PackageViolations map[string][]License `json:"package_violations" yaml:"violations"`
- // CompliantPackages and their licenses that were compliant to the policy
- CompliantPackages map[string][]License `json:"compliant_packages" yaml:"compliant"`
- // IgnoredPackages tracks packages with licenses that were not SPDX compliant
- IgnoredPackages map[string][]License `json:"ignored_packages" yaml:"ignored"`
-
- // LicenseViolations not allowed by the policy and the packages that contained them
- // The key for these is the all lowercase SPDX license ID found in internal/spdxlicense/license.go
- LicenseViolations map[string][]Package `json:"license_violations" yaml:"license_violations"`
- // CompliantLicenses that were allowed by the policy and the packages that contained them
- CompliantLicenses map[string][]Package `json:"compliant_licenses" yaml:"license_compliant"`
- // IgnoredLicenses that were not SPDX compliant and the packages that contained them
- IgnoredLicenses map[string][]Package `json:"ignored_licenses" yaml:"license_ignored"`
-
- // The sbom that was analyzed to generate the report
- sbom *sbom.SBOM
- sbomFormat string
- sbomFormatVersion string
-}
-
-func NewResult(policy *Policy, src string, sbom *sbom.SBOM, formatID string, version string) Result {
- if policy == nil || policy.IsEmpty() {
- policy = DefaultPolicy()
- }
-
- return Result{
- Source: src,
- Policy: policy,
- PackageViolations: make(map[string][]License),
- CompliantPackages: make(map[string][]License),
- IgnoredPackages: make(map[string][]License),
- LicenseViolations: make(map[string][]Package),
- CompliantLicenses: make(map[string][]Package),
- IgnoredLicenses: make(map[string][]Package),
-
- sbom: sbom,
- sbomFormat: formatID,
- sbomFormatVersion: version,
- }
-}
-
-// Generate will fill in the Result with the violations, compliant, and ignored packages and licenses
-func (r *Result) Generate() error {
- for pkg := range r.sbom.Artifacts.Packages.Enumerate() {
- // TODO: since we use syft to generate the sbom we need to convert packages/licenses to grant types
- // this feels like a code smell; we should consider a refactor where we use an interface so different sbom
- // providers can be plugged in where we can convert their licenses/packages to grant's types
- grantPkg := ConvertSyftPackage(pkg, r.Source)
- if len(grantPkg.Licenses) == 0 {
- // no licenses found for this package
- r.addCompliant(grantPkg, nil)
- }
- for _, license := range grantPkg.Licenses {
- // if the license is not SPDX compliant, ignore it
- // TODO: add a flag to allow non-SPDX compliant licenses to be checked against the policy
- if !license.IsSPDX() {
- r.addIgnored(grantPkg, license)
- continue
- }
- if r.Policy.Deny(license) {
- r.addViolation(grantPkg, license)
- continue
- }
- // otherwise, the license is allowed
- r.addCompliant(grantPkg, &license)
- }
- }
- return nil
-}
-
-type ResultSummary struct {
- CompliantPackages int `json:"compliant_packages" yaml:"compliant_packages"`
- PackageViolations int `json:"package_violations" yaml:"package_violations"`
- IgnoredPackages int `json:"ignored_packages" yaml:"ignored_packages"`
- LicenseViolations int `json:"license_violations" yaml:"license_violations"`
- CompliantLicenses int `json:"compliant_licenses" yaml:"compliant_licenses"`
- IgnoredLicenses int `json:"ignored_licenses" yaml:"ignored_licenses"`
-}
-
-func (r *Result) Summary() ResultSummary {
- return ResultSummary{
- CompliantPackages: len(r.CompliantPackages),
- PackageViolations: len(r.PackageViolations),
- IgnoredPackages: len(r.IgnoredPackages),
- LicenseViolations: len(r.LicenseViolations),
- CompliantLicenses: len(r.CompliantLicenses),
- IgnoredLicenses: len(r.IgnoredLicenses),
- }
-}
-
-func (r *Result) addViolation(grantPkg Package, license License) {
- r.PackageViolations[grantPkg.Name] = append(r.PackageViolations[grantPkg.Name], license)
- r.LicenseViolations[license.SPDXExpression] = append(r.LicenseViolations[license.SPDXExpression], grantPkg)
-}
-
-func (r *Result) addCompliant(grantPkg Package, license *License) {
- // a package with no licenses is compliant
- if license == nil {
- if _, ok := r.CompliantPackages[grantPkg.Name]; !ok {
- r.CompliantPackages[grantPkg.Name] = make([]License, 0)
- }
- // we already know this package is compliant and has been set from a previous call
- return
- }
- r.CompliantPackages[grantPkg.Name] = append(r.CompliantPackages[grantPkg.Name], *license)
- r.CompliantLicenses[license.SPDXExpression] = append(r.CompliantLicenses[license.SPDXExpression], grantPkg)
-}
-
-// Note: if a license has been ignored, it means the SPDX expression was invalid
-// we track these by the license name, not the SPDX expression
-func (r *Result) addIgnored(grantPkg Package, license License) {
- r.IgnoredPackages[grantPkg.Name] = append(r.IgnoredPackages[grantPkg.Name], license)
- r.IgnoredLicenses[license.Name] = append(r.IgnoredLicenses[license.Name], grantPkg)
-}
diff --git a/grant/result_test.go b/grant/result_test.go
deleted file mode 100644
index 1dedb2d..0000000
--- a/grant/result_test.go
+++ /dev/null
@@ -1,110 +0,0 @@
-package grant
-
-import (
- "testing"
-
- "github.com/google/go-cmp/cmp"
- "github.com/google/go-cmp/cmp/cmpopts"
-
- "github.com/anchore/grant/internal/input"
- syftFormat "github.com/anchore/syft/syft/format"
- "github.com/anchore/syft/syft/sbom"
-)
-
-func Test_NewResult(t *testing.T) {
- tests := []struct {
- name string
- policy *Policy
- src string
- want Result
- cmpignore []cmp.Option
- }{
- {
- name: "happy path",
- policy: DefaultPolicy(),
- src: "fixtures/test.spdx.json",
- want: Result{
- Source: "fixtures/test.spdx.json",
- Policy: DefaultPolicy(),
- PackageViolations: make(map[string][]License),
- CompliantPackages: make(map[string][]License),
- IgnoredPackages: make(map[string][]License),
- LicenseViolations: make(map[string][]Package),
- CompliantLicenses: make(map[string][]Package),
- IgnoredLicenses: make(map[string][]Package),
- },
- cmpignore: []cmp.Option{
- cmpopts.IgnoreFields(Result{}, "sbom", "sbomFormat", "sbomFormatVersion"),
- cmpopts.IgnoreFields(Policy{}, "denyAll", "allowAll"),
- },
- },
- }
-
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- sb, formatID, version, err := generateSBOMFromFixture(tt.src)
- if err != nil {
- t.Fatalf("unable to generate sbom from fixture: %+v", err)
- }
- result := NewResult(tt.policy, tt.src, sb, formatID, version)
- if diff := cmp.Diff(tt.want, result, tt.cmpignore...); diff != "" {
- t.Errorf("NewResult() mismatch (-want +got):\n%s", diff)
- }
- })
- }
-}
-
-func Test_Result_Generate(t *testing.T) {
- tests := []struct {
- name string
- policy *Policy
- src string
- expectedResultSummary ResultSummary
- }{
- {
- name: "Result.Generate() denies all packages with licenses for the default policy",
- policy: DefaultPolicy(),
- src: "fixtures/test.spdx.json",
- // cat grant/fixtures/test.spdx.json | jq '.packages | length'
- // 16 packages - 1 package with no licenses (alpine as the source is registered as a package) = 15 violations
- // TODO: currently the source container package is being dropped by the decoder, so we are not seeing it in the result
- expectedResultSummary: ResultSummary{
- CompliantPackages: 0,
- PackageViolations: 15,
- IgnoredPackages: 0,
- LicenseViolations: 7,
- CompliantLicenses: 0,
- IgnoredLicenses: 0,
- },
- },
- }
-
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- sb, formatID, version, err := generateSBOMFromFixture(tt.src)
- if err != nil {
- t.Fatalf("unable to generate sbom from fixture: %+v", err)
- }
-
- result := NewResult(tt.policy, tt.src, sb, formatID, version)
- err = result.Generate()
- if err != nil {
- t.Fatalf("unable to generate result: %+v", err)
- }
- gotResultSummary := result.Summary()
- if diff := cmp.Diff(tt.expectedResultSummary, gotResultSummary); diff != "" {
- t.Errorf("Result.Generate() mismatch (-want +got):\n%s", diff)
- }
- })
- }
-}
-
-func generateSBOMFromFixture(fixture string) (sb *sbom.SBOM, formatID, version string, err error) {
- reader, err := input.GetReader(fixture)
- if err != nil {
- return nil, "", "", err
- }
- sbomDecoders := syftFormat.NewDecoderCollection(syftFormat.Decoders()...)
- sb, fID, version, err := sbomDecoders.Decode(reader)
- return sb, fID.String(), version, err
-}
diff --git a/internal/grant.go b/internal/grant.go
new file mode 100644
index 0000000..3b2fdcb
--- /dev/null
+++ b/internal/grant.go
@@ -0,0 +1,6 @@
+package internal
+
+const (
+ ApplicationName = "grant"
+ ApplicationVersion = "0.0.1"
+)
diff --git a/test/cli/check_test.go b/test/cli/check_test.go
new file mode 100644
index 0000000..7f1e458
--- /dev/null
+++ b/test/cli/check_test.go
@@ -0,0 +1 @@
+package cli
diff --git a/test/cli/utils_test.go b/test/cli/utils_test.go
new file mode 100644
index 0000000..7f1e458
--- /dev/null
+++ b/test/cli/utils_test.go
@@ -0,0 +1 @@
+package cli
diff --git a/test/cli/version_test.go b/test/cli/version_test.go
new file mode 100644
index 0000000..44baa67
--- /dev/null
+++ b/test/cli/version_test.go
@@ -0,0 +1,29 @@
+package cli
+
+import "testing"
+
+func Test_VersionCommand(t *testing.T) {
+ tests := []struct {
+ name string
+ command string
+ }{
+ {
+ name: "text output",
+ command: "version",
+ },
+ {
+ name: "json output",
+ command: "version -o json",
+ },
+ {
+ name: "root command short version output",
+ command: "--version",
+ },
+ }
+
+ for _, test := range tests {
+ t.Run(test.name, func(t *testing.T) {
+
+ })
+ }
+}