forked from mirrors/pkg-proxy
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 219575d854 | |||
|
|
00b032cb5b |
||
|
|
552c8ac4e5 |
||
|
|
76f41cf271 |
||
|
|
a8b6b0a417 |
||
|
|
1e6a0d1ab8 |
||
|
|
d39e312710 |
||
|
|
7586beb37b |
||
|
|
7832db2adb |
||
|
|
497e16f90b |
||
|
|
e8363e2fec |
||
|
|
ffd28ad856 |
||
|
|
17a10bda55 |
||
|
|
f2a5b704f0 |
||
|
|
5315883c3b |
||
|
|
ebc2ea9cf9 |
||
|
|
992f5c68a7 |
||
|
|
31a9ca75b2 |
||
|
|
61741123bf |
||
|
|
8d2740624f |
||
|
|
e912227e3b |
||
|
|
522c6f233e |
||
|
|
a4fd333d48 |
||
|
|
adca293269 |
||
|
|
71e8d3b9eb |
||
|
|
d6066af230 |
||
|
|
cfcf480f69 |
||
|
|
f1ea8b50a1 |
||
|
|
e2495ef0aa |
||
|
|
461a95c518 |
||
|
|
fd9b8da526 |
||
|
|
33e3a1a197 |
||
|
|
78e1e76129 |
||
|
|
96049c1f88 |
||
|
|
3a68ccef3e |
||
|
|
4c53c77092 |
||
|
|
f9f2a6ecd4 |
||
|
|
1ad182782d |
||
|
|
c73b0a35a1 |
||
|
|
9d316cf937 |
||
|
|
12f79dcca8 |
||
|
|
34be35cafa |
||
|
|
d9d6e8735a |
||
|
|
f58e3552d3 |
||
|
|
cbec55cba4 |
||
|
|
da517ad8f5 |
||
|
|
2571b0aed5 |
||
|
|
57eb063464 |
||
| c655399a07 | |||
|
|
59a510f3f5 |
||
|
|
35f26f4645 |
||
|
|
a1d028696d |
||
|
|
78325b6bf1 |
||
|
|
e3cc5516b5 |
||
|
|
50772d8947 |
||
|
|
2816ff2414 |
||
|
|
d3d11445c6 |
||
|
|
0c02455dc9 |
||
|
|
9849ac9f16 |
||
|
|
7346008aa5 |
||
|
|
c01f0a5c05 |
||
|
|
47681066b5 |
||
|
|
02738651ab |
||
|
|
d62c42b8d7 |
||
|
|
7985a28839 |
||
|
|
773fe55bd9 |
||
|
|
d919d9ce3e |
||
|
|
73d78c28fb |
||
|
|
7d0ac94c6c |
||
|
|
5c4f6f3b85 |
||
|
|
497afdf317 |
||
|
|
55db8f94fc |
||
|
|
d64fcb5b98 |
||
|
|
01b4e7210d |
||
|
|
8b762ffb39 |
||
|
|
94f4a7dfa6 |
||
| a947a7546a | |||
|
|
e1d2331ff0 |
||
|
|
e36a92433e |
||
|
|
941ed51f76 |
||
|
|
b68184cbab |
||
|
|
bcbb883d1b |
||
|
|
33d99e337b |
||
|
|
81f505757f |
||
|
|
7a758b9450 |
||
|
|
3bccc01776 |
||
|
|
43a164ed72 |
||
|
|
9708fe31a8 |
||
|
|
cb9bbbc385 |
||
|
|
75ff85f2f0 |
||
|
|
70fe686953 |
||
|
|
24d5e77443 |
||
|
|
15c133f1fa |
||
|
|
e45706d808 |
||
|
|
34009bad98 |
||
|
|
ec9c437498 |
105 changed files with 12543 additions and 1846 deletions
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
|
|
@ -25,7 +25,7 @@ jobs:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2
|
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
|
|
@ -38,7 +38,7 @@ jobs:
|
||||||
images: ghcr.io/${{ github.repository }}
|
images: ghcr.io/${{ github.repository }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
|
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
|
|
|
||||||
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
|
|
@ -7,6 +7,7 @@ on:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
|
|
@ -18,13 +19,15 @@ jobs:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
|
- uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
|
- uses: goreleaser/goreleaser-action@1a80836c5c9d9e5755a25cb59ec6f45a3b5f41a8 # v7.2.1
|
||||||
with:
|
with:
|
||||||
version: "~> v2"
|
version: "~> v2"
|
||||||
args: release --clean
|
args: release --clean
|
||||||
|
|
|
||||||
2
.github/workflows/zizmor.yml
vendored
2
.github/workflows/zizmor.yml
vendored
|
|
@ -26,4 +26,4 @@ jobs:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Run zizmor
|
- name: Run zizmor
|
||||||
uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2
|
uses: zizmorcore/zizmor-action@a16621b09c6db4281f81a93cb393b05dcd7b7165 # v0.5.5
|
||||||
|
|
|
||||||
28
.golangci.yml
Normal file
28
.golangci.yml
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
version: "2"
|
||||||
|
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
- gocritic
|
||||||
|
- gocognit
|
||||||
|
- gocyclo
|
||||||
|
- maintidx
|
||||||
|
- dupl
|
||||||
|
- mnd
|
||||||
|
- unparam
|
||||||
|
- ireturn
|
||||||
|
- goconst
|
||||||
|
- errcheck
|
||||||
|
settings:
|
||||||
|
goconst:
|
||||||
|
min-len: 4
|
||||||
|
min-occurrences: 5
|
||||||
|
ignore-tests: true
|
||||||
|
ignore-string-values:
|
||||||
|
- "^[a-z]+$"
|
||||||
|
exclusions:
|
||||||
|
rules:
|
||||||
|
- path: _test\.go
|
||||||
|
linters:
|
||||||
|
- goconst
|
||||||
|
- dupl
|
||||||
|
- mnd
|
||||||
|
|
@ -34,6 +34,17 @@ archives:
|
||||||
checksum:
|
checksum:
|
||||||
name_template: "checksums.txt"
|
name_template: "checksums.txt"
|
||||||
|
|
||||||
|
signs:
|
||||||
|
- cmd: cosign
|
||||||
|
signature: "${artifact}.cosign.bundle"
|
||||||
|
args:
|
||||||
|
- sign-blob
|
||||||
|
- "--bundle=${signature}"
|
||||||
|
- "${artifact}"
|
||||||
|
- "--yes"
|
||||||
|
artifacts: checksum
|
||||||
|
output: true
|
||||||
|
|
||||||
snapshot:
|
snapshot:
|
||||||
version_template: "{{ incpatch .Version }}-next"
|
version_template: "{{ incpatch .Version }}-next"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.25-alpine AS builder
|
FROM golang:1.26.3-alpine AS builder
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
|
|
@ -15,7 +15,7 @@ COPY . .
|
||||||
# Build the binary
|
# Build the binary
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /proxy ./cmd/proxy
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /proxy ./cmd/proxy
|
||||||
|
|
||||||
FROM alpine:3.21
|
FROM alpine:3.23.4
|
||||||
|
|
||||||
RUN apk add --no-cache ca-certificates
|
RUN apk add --no-cache ca-certificates
|
||||||
|
|
||||||
|
|
|
||||||
232
LICENSE
Normal file
232
LICENSE
Normal file
|
|
@ -0,0 +1,232 @@
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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 <https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
137
README.md
137
README.md
|
|
@ -18,9 +18,7 @@ cooldown:
|
||||||
|
|
||||||
A 3-day cooldown means that when `lodash` publishes version `4.18.0`, your builds keep using `4.17.21` until 3 days have passed. If the new release turns out to be compromised, you were never exposed.
|
A 3-day cooldown means that when `lodash` publishes version `4.18.0`, your builds keep using `4.17.21` until 3 days have passed. If the new release turns out to be compromised, you were never exposed.
|
||||||
|
|
||||||
Resolution order: package override, then ecosystem override, then global default. This lets you set a conservative default and carve out exceptions for packages where you need faster updates.
|
Resolution order: package override, then ecosystem override, then global default. This lets you set a conservative default and carve out exceptions for packages where you need faster updates. See [docs/configuration.md](docs/configuration.md) for the full config reference.
|
||||||
|
|
||||||
Currently works with npm, PyPI, pub.dev, Composer, and Cargo, which all include publish timestamps in their metadata. See [docs/configuration.md](docs/configuration.md) for the full config reference.
|
|
||||||
|
|
||||||
## Supported Registries
|
## Supported Registries
|
||||||
|
|
||||||
|
|
@ -28,17 +26,19 @@ Currently works with npm, PyPI, pub.dev, Composer, and Cargo, which all include
|
||||||
|----------|-------------------|:--------:|:---------:|
|
|----------|-------------------|:--------:|:---------:|
|
||||||
| npm | JavaScript | Yes | ✓ |
|
| npm | JavaScript | Yes | ✓ |
|
||||||
| Cargo | Rust | Yes | ✓ |
|
| Cargo | Rust | Yes | ✓ |
|
||||||
| RubyGems | Ruby | | ✓ |
|
| RubyGems | Ruby | Yes | ✓ |
|
||||||
| Go proxy | Go | | ✓ |
|
| Go proxy | Go | | ✓ |
|
||||||
| Hex | Elixir | | ✓ |
|
| Hex | Elixir | Yes* | ✓ |
|
||||||
| pub.dev | Dart | Yes | ✓ |
|
| pub.dev | Dart | Yes | ✓ |
|
||||||
| PyPI | Python | Yes | ✓ |
|
| PyPI | Python | Yes | ✓ |
|
||||||
| Maven | Java | | ✓ |
|
| Maven | Java | | ✓ |
|
||||||
| NuGet | .NET | | ✓ |
|
| Gradle Build Cache | Java/Kotlin | | ✓ |
|
||||||
|
| NuGet | .NET | Yes | ✓ |
|
||||||
| Composer | PHP | Yes | ✓ |
|
| Composer | PHP | Yes | ✓ |
|
||||||
| Conan | C/C++ | | ✓ |
|
| Conan | C/C++ | | ✓ |
|
||||||
| Conda | Python/R | | ✓ |
|
| Conda | Python/R | Yes | ✓ |
|
||||||
| CRAN | R | | ✓ |
|
| CRAN | R | | ✓ |
|
||||||
|
| Julia | Julia | | ✓ |
|
||||||
| Container | Docker/OCI | | ✓ |
|
| Container | Docker/OCI | | ✓ |
|
||||||
| Debian | Debian/Ubuntu | | ✓ |
|
| Debian | Debian/Ubuntu | | ✓ |
|
||||||
| RPM | RHEL/Fedora | | ✓ |
|
| RPM | RHEL/Fedora | | ✓ |
|
||||||
|
|
@ -52,6 +52,16 @@ Currently works with npm, PyPI, pub.dev, Composer, and Cargo, which all include
|
||||||
|
|
||||||
Cooldown requires publish timestamps in metadata. Registries without a "Yes" in the cooldown column either don't expose timestamps or haven't been wired up yet.
|
Cooldown requires publish timestamps in metadata. Registries without a "Yes" in the cooldown column either don't expose timestamps or haven't been wired up yet.
|
||||||
|
|
||||||
|
\* Hex cooldown requires disabling registry signature verification (`HEX_NO_VERIFY_REPO_ORIGIN=1`) since the proxy re-encodes the protobuf payload.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew install git-pkgs/git-pkgs/proxy
|
||||||
|
```
|
||||||
|
|
||||||
|
Or download a binary from the [releases page](https://github.com/git-pkgs/proxy/releases).
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
@ -200,6 +210,34 @@ Add to your `~/.m2/settings.xml`:
|
||||||
</settings>
|
</settings>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The `/maven/` endpoint uses Maven Central as primary upstream and falls back to the Gradle Plugin Portal for Gradle plugin marker metadata and related artifacts when the primary upstream returns not found.
|
||||||
|
|
||||||
|
For Gradle plugin resolution via the same proxy endpoint:
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
maven(url = "http://localhost:8080/maven/")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Gradle HTTP Build Cache
|
||||||
|
|
||||||
|
Configure in `settings.gradle(.kts)`:
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
buildCache {
|
||||||
|
local {
|
||||||
|
enabled = false
|
||||||
|
}
|
||||||
|
remote<HttpBuildCache> {
|
||||||
|
url = uri("http://localhost:8080/gradle/")
|
||||||
|
push = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### NuGet
|
### NuGet
|
||||||
|
|
||||||
Configure in `nuget.config`:
|
Configure in `nuget.config`:
|
||||||
|
|
@ -287,6 +325,21 @@ local({
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Julia
|
||||||
|
|
||||||
|
Set the Pkg server before starting Julia:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export JULIA_PKG_SERVER=http://localhost:8080/julia
|
||||||
|
```
|
||||||
|
|
||||||
|
Or inside a running session:
|
||||||
|
|
||||||
|
```julia
|
||||||
|
ENV["JULIA_PKG_SERVER"] = "http://localhost:8080/julia"
|
||||||
|
using Pkg; Pkg.update()
|
||||||
|
```
|
||||||
|
|
||||||
### Docker / Container Registry
|
### Docker / Container Registry
|
||||||
|
|
||||||
Configure Docker to use the proxy as a registry mirror in `/etc/docker/daemon.json`:
|
Configure Docker to use the proxy as a registry mirror in `/etc/docker/daemon.json`:
|
||||||
|
|
@ -345,6 +398,7 @@ sudo dnf update
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
The proxy can be configured via:
|
The proxy can be configured via:
|
||||||
|
|
||||||
1. Command line flags (highest priority)
|
1. Command line flags (highest priority)
|
||||||
2. Environment variables
|
2. Environment variables
|
||||||
3. Configuration file (YAML or JSON)
|
3. Configuration file (YAML or JSON)
|
||||||
|
|
@ -460,6 +514,44 @@ proxy serve [flags]
|
||||||
proxy [flags] # same as 'proxy serve'
|
proxy [flags] # same as 'proxy serve'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### mirror
|
||||||
|
|
||||||
|
Pre-populate the cache from PURLs, SBOM files, or entire registries. Useful for ensuring offline availability or warming the cache before deployments.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Mirror specific package versions
|
||||||
|
proxy mirror pkg:npm/lodash@4.17.21 pkg:cargo/serde@1.0.0
|
||||||
|
|
||||||
|
# Mirror all versions of a package
|
||||||
|
proxy mirror pkg:npm/lodash
|
||||||
|
|
||||||
|
# Mirror from a CycloneDX or SPDX SBOM
|
||||||
|
proxy mirror --sbom sbom.cdx.json
|
||||||
|
|
||||||
|
# Preview what would be mirrored
|
||||||
|
proxy mirror --dry-run pkg:npm/lodash
|
||||||
|
|
||||||
|
# Control parallelism
|
||||||
|
proxy mirror --concurrency 8 pkg:npm/lodash@4.17.21
|
||||||
|
```
|
||||||
|
|
||||||
|
The mirror command accepts the same storage and database flags as `serve`. Already-cached artifacts are skipped.
|
||||||
|
|
||||||
|
A mirror API is also available when the server is running:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Start a mirror job
|
||||||
|
curl -X POST http://localhost:8080/api/mirror \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"purls": ["pkg:npm/lodash@4.17.21"]}'
|
||||||
|
|
||||||
|
# Check job status
|
||||||
|
curl http://localhost:8080/api/mirror/mirror-1
|
||||||
|
|
||||||
|
# Cancel a running job
|
||||||
|
curl -X DELETE http://localhost:8080/api/mirror/mirror-1
|
||||||
|
```
|
||||||
|
|
||||||
### stats
|
### stats
|
||||||
|
|
||||||
Show cache statistics without running the server.
|
Show cache statistics without running the server.
|
||||||
|
|
@ -514,7 +606,7 @@ Recently cached:
|
||||||
| Endpoint | Description |
|
| Endpoint | Description |
|
||||||
|----------|-------------|
|
|----------|-------------|
|
||||||
| `GET /` | Dashboard (web UI) |
|
| `GET /` | Dashboard (web UI) |
|
||||||
| `GET /health` | Health check (returns "ok" if healthy) |
|
| `GET /health` | Health check (JSON; HTTP 200 healthy, 503 unhealthy) |
|
||||||
| `GET /stats` | Cache statistics (JSON) |
|
| `GET /stats` | Cache statistics (JSON) |
|
||||||
| `GET /metrics` | Prometheus metrics |
|
| `GET /metrics` | Prometheus metrics |
|
||||||
| `GET /npm/*` | npm registry protocol |
|
| `GET /npm/*` | npm registry protocol |
|
||||||
|
|
@ -530,10 +622,19 @@ Recently cached:
|
||||||
| `GET /conan/*` | Conan C/C++ protocol |
|
| `GET /conan/*` | Conan C/C++ protocol |
|
||||||
| `GET /conda/*` | Conda/Anaconda protocol |
|
| `GET /conda/*` | Conda/Anaconda protocol |
|
||||||
| `GET /cran/*` | CRAN (R) protocol |
|
| `GET /cran/*` | CRAN (R) protocol |
|
||||||
|
| `GET /julia/*` | Julia Pkg server protocol |
|
||||||
| `GET /v2/*` | OCI/Docker registry protocol |
|
| `GET /v2/*` | OCI/Docker registry protocol |
|
||||||
| `GET /debian/*` | Debian/APT repository protocol |
|
| `GET /debian/*` | Debian/APT repository protocol |
|
||||||
| `GET /rpm/*` | RPM/Yum repository protocol |
|
| `GET /rpm/*` | RPM/Yum repository protocol |
|
||||||
|
|
||||||
|
### Mirror API
|
||||||
|
|
||||||
|
| Endpoint | Description |
|
||||||
|
|----------|-------------|
|
||||||
|
| `POST /api/mirror` | Start a mirror job (JSON body with `purls`) |
|
||||||
|
| `GET /api/mirror/{id}` | Get job status and progress |
|
||||||
|
| `DELETE /api/mirror/{id}` | Cancel a running job |
|
||||||
|
|
||||||
### Enrichment API
|
### Enrichment API
|
||||||
|
|
||||||
The proxy provides REST endpoints for package metadata enrichment, vulnerability scanning, and outdated detection.
|
The proxy provides REST endpoints for package metadata enrichment, vulnerability scanning, and outdated detection.
|
||||||
|
|
@ -744,9 +845,28 @@ The proxy exposes Prometheus metrics at `GET /metrics`. All metric names are pre
|
||||||
| `proxy_storage_operation_duration_seconds` | histogram | `operation` | Storage read/write latency |
|
| `proxy_storage_operation_duration_seconds` | histogram | `operation` | Storage read/write latency |
|
||||||
| `proxy_storage_errors_total` | counter | `operation` | Storage read/write failures |
|
| `proxy_storage_errors_total` | counter | `operation` | Storage read/write failures |
|
||||||
| `proxy_active_requests` | gauge | | In-flight requests |
|
| `proxy_active_requests` | gauge | | In-flight requests |
|
||||||
|
| `proxy_health_probe_failures_total` | counter | `step` | Storage health probe failures by failing step (`write`, `size`, `read`, `verify`, `delete`). |
|
||||||
|
|
||||||
Cache size and artifact count are refreshed every 60 seconds. The remaining metrics update on each request.
|
Cache size and artifact count are refreshed every 60 seconds. The remaining metrics update on each request.
|
||||||
|
|
||||||
|
### Health Check
|
||||||
|
|
||||||
|
`/health` returns a structured JSON report of subsystem health. HTTP 200 if all checks pass; 503 if any fail.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"status": "ok",
|
||||||
|
"checks": {
|
||||||
|
"database": {"status": "ok"},
|
||||||
|
"storage": {"status": "ok"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Failing checks include an `"error"` field. Storage failures also include a `"step"` field identifying which probe step failed (`write`, `size`, `read`, `verify`, `delete`). When the database check fails, the storage entry reports `{"status": "skipped"}` so the response always carries the same key set.
|
||||||
|
|
||||||
|
Storage probe results are cached for `health.storage_probe_interval` (default 30s) to bound the cost of probing remote backends. A probe holds an internal mutex for up to 10 seconds (the hardcoded per-probe timeout), so `/health` is intended as a Kubernetes **readiness** probe rather than a liveness probe — a slow S3 round-trip should pull the pod from rotation, not restart it.
|
||||||
|
|
||||||
Scrape config for Prometheus:
|
Scrape config for Prometheus:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|
@ -870,6 +990,7 @@ The proxy will recreate the database on next start.
|
||||||
## Building from Source
|
## Building from Source
|
||||||
|
|
||||||
Requirements:
|
Requirements:
|
||||||
|
|
||||||
- Go 1.25 or later
|
- Go 1.25 or later
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
//
|
//
|
||||||
// serve Start the proxy server (default if no command given)
|
// serve Start the proxy server (default if no command given)
|
||||||
// stats Show cache statistics
|
// stats Show cache statistics
|
||||||
|
// mirror Pre-populate cache from PURLs, SBOMs, or registries
|
||||||
//
|
//
|
||||||
// Serve Flags:
|
// Serve Flags:
|
||||||
//
|
//
|
||||||
|
|
@ -71,6 +72,14 @@
|
||||||
// PROXY_DATABASE_URL - PostgreSQL connection URL
|
// PROXY_DATABASE_URL - PostgreSQL connection URL
|
||||||
// PROXY_LOG_LEVEL - Log level
|
// PROXY_LOG_LEVEL - Log level
|
||||||
// PROXY_LOG_FORMAT - Log format
|
// PROXY_LOG_FORMAT - Log format
|
||||||
|
// PROXY_UPSTREAM_MAVEN - Maven repository upstream URL
|
||||||
|
// PROXY_UPSTREAM_GRADLE_PLUGIN_PORTAL - Gradle Plugin Portal upstream URL
|
||||||
|
// PROXY_GRADLE_BUILD_CACHE_READ_ONLY - Disable Gradle PUT uploads
|
||||||
|
// PROXY_GRADLE_BUILD_CACHE_MAX_UPLOAD_SIZE - Max Gradle PUT request body size
|
||||||
|
// PROXY_GRADLE_BUILD_CACHE_MAX_AGE - Gradle cache max age eviction
|
||||||
|
// PROXY_GRADLE_BUILD_CACHE_MAX_SIZE - Gradle cache max total size
|
||||||
|
// PROXY_GRADLE_BUILD_CACHE_SWEEP_INTERVAL - Gradle cache eviction sweep interval
|
||||||
|
// PROXY_HEALTH_STORAGE_PROBE_INTERVAL - Storage health probe cache interval (default "30s")
|
||||||
//
|
//
|
||||||
// Example:
|
// Example:
|
||||||
//
|
//
|
||||||
|
|
@ -100,7 +109,11 @@ import (
|
||||||
|
|
||||||
"github.com/git-pkgs/proxy/internal/config"
|
"github.com/git-pkgs/proxy/internal/config"
|
||||||
"github.com/git-pkgs/proxy/internal/database"
|
"github.com/git-pkgs/proxy/internal/database"
|
||||||
|
"github.com/git-pkgs/proxy/internal/handler"
|
||||||
|
"github.com/git-pkgs/proxy/internal/mirror"
|
||||||
"github.com/git-pkgs/proxy/internal/server"
|
"github.com/git-pkgs/proxy/internal/server"
|
||||||
|
"github.com/git-pkgs/proxy/internal/storage"
|
||||||
|
"github.com/git-pkgs/registries/fetch"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTopN = 10
|
const defaultTopN = 10
|
||||||
|
|
@ -124,6 +137,10 @@ func main() {
|
||||||
os.Args = append(os.Args[:1], os.Args[2:]...)
|
os.Args = append(os.Args[:1], os.Args[2:]...)
|
||||||
runStats()
|
runStats()
|
||||||
return
|
return
|
||||||
|
case "mirror":
|
||||||
|
os.Args = append(os.Args[:1], os.Args[2:]...)
|
||||||
|
runMirror()
|
||||||
|
return
|
||||||
case "-version", "--version":
|
case "-version", "--version":
|
||||||
fmt.Printf("proxy %s (%s)\n", Version, Commit)
|
fmt.Printf("proxy %s (%s)\n", Version, Commit)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
|
@ -145,6 +162,7 @@ Usage: proxy [command] [flags]
|
||||||
Commands:
|
Commands:
|
||||||
serve Start the proxy server (default)
|
serve Start the proxy server (default)
|
||||||
stats Show cache statistics
|
stats Show cache statistics
|
||||||
|
mirror Pre-populate cache from PURLs, SBOMs, or registries
|
||||||
|
|
||||||
Run 'proxy <command> -help' for more information on a command.
|
Run 'proxy <command> -help' for more information on a command.
|
||||||
|
|
||||||
|
|
@ -183,6 +201,14 @@ func runServe() {
|
||||||
fmt.Fprintf(os.Stderr, " PROXY_DATABASE_URL PostgreSQL connection URL\n")
|
fmt.Fprintf(os.Stderr, " PROXY_DATABASE_URL PostgreSQL connection URL\n")
|
||||||
fmt.Fprintf(os.Stderr, " PROXY_LOG_LEVEL Log level\n")
|
fmt.Fprintf(os.Stderr, " PROXY_LOG_LEVEL Log level\n")
|
||||||
fmt.Fprintf(os.Stderr, " PROXY_LOG_FORMAT Log format\n")
|
fmt.Fprintf(os.Stderr, " PROXY_LOG_FORMAT Log format\n")
|
||||||
|
fmt.Fprintf(os.Stderr, " PROXY_UPSTREAM_MAVEN Maven repository upstream URL\n")
|
||||||
|
fmt.Fprintf(os.Stderr, " PROXY_UPSTREAM_GRADLE_PLUGIN_PORTAL Gradle Plugin Portal upstream URL\n")
|
||||||
|
fmt.Fprintf(os.Stderr, " PROXY_GRADLE_BUILD_CACHE_READ_ONLY Disable Gradle PUT uploads\n")
|
||||||
|
fmt.Fprintf(os.Stderr, " PROXY_GRADLE_BUILD_CACHE_MAX_UPLOAD_SIZE Max Gradle PUT request body size\n")
|
||||||
|
fmt.Fprintf(os.Stderr, " PROXY_GRADLE_BUILD_CACHE_MAX_AGE Gradle cache max age eviction\n")
|
||||||
|
fmt.Fprintf(os.Stderr, " PROXY_GRADLE_BUILD_CACHE_MAX_SIZE Gradle cache max total size\n")
|
||||||
|
fmt.Fprintf(os.Stderr, " PROXY_GRADLE_BUILD_CACHE_SWEEP_INTERVAL Gradle cache eviction sweep interval\n")
|
||||||
|
fmt.Fprintf(os.Stderr, " PROXY_HEALTH_STORAGE_PROBE_INTERVAL Storage health probe cache interval\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
_ = fs.Parse(os.Args[1:])
|
_ = fs.Parse(os.Args[1:])
|
||||||
|
|
@ -340,6 +366,151 @@ func runStats() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func runMirror() {
|
||||||
|
fs := flag.NewFlagSet("mirror", flag.ExitOnError)
|
||||||
|
configPath := fs.String("config", "", "Path to configuration file")
|
||||||
|
storageURL := fs.String("storage-url", "", "Storage URL (file:// or s3://)")
|
||||||
|
databaseDriver := fs.String("database-driver", "", "Database driver: sqlite or postgres")
|
||||||
|
databasePath := fs.String("database-path", "", "Path to SQLite database file")
|
||||||
|
databaseURL := fs.String("database-url", "", "PostgreSQL connection URL")
|
||||||
|
sbomPath := fs.String("sbom", "", "Path to CycloneDX or SPDX SBOM file")
|
||||||
|
concurrency := fs.Int("concurrency", 4, "Number of parallel downloads") //nolint:mnd // default concurrency
|
||||||
|
dryRun := fs.Bool("dry-run", false, "Show what would be mirrored without downloading")
|
||||||
|
|
||||||
|
fs.Usage = func() {
|
||||||
|
fmt.Fprintf(os.Stderr, "git-pkgs proxy - Pre-populate cache\n\n")
|
||||||
|
fmt.Fprintf(os.Stderr, "Usage: proxy mirror [flags] [purl...]\n\n")
|
||||||
|
fmt.Fprintf(os.Stderr, "Examples:\n")
|
||||||
|
fmt.Fprintf(os.Stderr, " proxy mirror pkg:npm/lodash@4.17.21\n")
|
||||||
|
fmt.Fprintf(os.Stderr, " proxy mirror --sbom sbom.cdx.json\n")
|
||||||
|
fmt.Fprintf(os.Stderr, " proxy mirror pkg:npm/lodash # all versions\n\n")
|
||||||
|
fmt.Fprintf(os.Stderr, "Flags:\n")
|
||||||
|
fs.PrintDefaults()
|
||||||
|
}
|
||||||
|
|
||||||
|
_ = fs.Parse(os.Args[1:])
|
||||||
|
purls := fs.Args()
|
||||||
|
|
||||||
|
// Determine source
|
||||||
|
var source mirror.Source
|
||||||
|
switch {
|
||||||
|
case *sbomPath != "":
|
||||||
|
source = &mirror.SBOMSource{Path: *sbomPath}
|
||||||
|
case len(purls) > 0:
|
||||||
|
source = &mirror.PURLSource{PURLs: purls}
|
||||||
|
default:
|
||||||
|
fmt.Fprintf(os.Stderr, "error: provide PURLs or --sbom\n")
|
||||||
|
fs.Usage()
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load config
|
||||||
|
cfg, err := loadConfig(*configPath)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "error loading config: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
cfg.LoadFromEnv()
|
||||||
|
|
||||||
|
if *storageURL != "" {
|
||||||
|
cfg.Storage.URL = *storageURL
|
||||||
|
}
|
||||||
|
if *databaseDriver != "" {
|
||||||
|
cfg.Database.Driver = *databaseDriver
|
||||||
|
}
|
||||||
|
if *databasePath != "" {
|
||||||
|
cfg.Database.Path = *databasePath
|
||||||
|
}
|
||||||
|
if *databaseURL != "" {
|
||||||
|
cfg.Database.URL = *databaseURL
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cfg.Validate(); err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "invalid configuration: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
logger := setupLogger("info", "text")
|
||||||
|
|
||||||
|
// Open database
|
||||||
|
var db *database.DB
|
||||||
|
switch cfg.Database.Driver {
|
||||||
|
case "postgres":
|
||||||
|
db, err = database.OpenPostgresOrCreate(cfg.Database.URL)
|
||||||
|
default:
|
||||||
|
db, err = database.OpenOrCreate(cfg.Database.Path)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "error opening database: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
defer func() { _ = db.Close() }()
|
||||||
|
|
||||||
|
if err := db.MigrateSchema(); err != nil {
|
||||||
|
_ = db.Close()
|
||||||
|
fmt.Fprintf(os.Stderr, "error migrating schema: %v\n", err)
|
||||||
|
os.Exit(1) //nolint:gocritic // db closed above
|
||||||
|
}
|
||||||
|
|
||||||
|
// Open storage
|
||||||
|
sURL := cfg.Storage.URL
|
||||||
|
if sURL == "" {
|
||||||
|
sURL = "file://" + cfg.Storage.Path //nolint:staticcheck // backwards compat
|
||||||
|
}
|
||||||
|
store, err := storage.OpenBucket(context.Background(), sURL)
|
||||||
|
if err != nil {
|
||||||
|
_ = db.Close()
|
||||||
|
fmt.Fprintf(os.Stderr, "error opening storage: %v\n", err)
|
||||||
|
os.Exit(1) //nolint:gocritic // db closed above
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build proxy (reuses same pipeline as serve)
|
||||||
|
fetcher := fetch.NewFetcher()
|
||||||
|
resolver := fetch.NewResolver()
|
||||||
|
proxy := handler.NewProxy(db, store, fetcher, resolver, logger)
|
||||||
|
proxy.CacheMetadata = true // mirror always caches metadata
|
||||||
|
proxy.MetadataTTL = cfg.ParseMetadataTTL()
|
||||||
|
|
||||||
|
m := mirror.New(proxy, db, store, logger, *concurrency)
|
||||||
|
|
||||||
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
go func() {
|
||||||
|
sigCh := make(chan os.Signal, 1)
|
||||||
|
signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM)
|
||||||
|
<-sigCh
|
||||||
|
cancel()
|
||||||
|
}()
|
||||||
|
|
||||||
|
if *dryRun {
|
||||||
|
items, err := m.RunDryRun(ctx, source)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
fmt.Printf("Would mirror %d package versions:\n", len(items))
|
||||||
|
for _, item := range items {
|
||||||
|
fmt.Printf(" %s\n", item)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
progress, err := m.Run(ctx, source)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("Mirror complete: %d downloaded, %d skipped (cached), %d failed, %s total\n",
|
||||||
|
progress.Completed, progress.Skipped, progress.Failed, formatSize(progress.Bytes))
|
||||||
|
|
||||||
|
if len(progress.Errors) > 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "\nErrors:\n")
|
||||||
|
for _, e := range progress.Errors {
|
||||||
|
fmt.Fprintf(os.Stderr, " %s/%s@%s: %s\n", e.Ecosystem, e.Name, e.Version, e.Error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func printStats(db *database.DB, popular, recent int, asJSON bool) error {
|
func printStats(db *database.DB, popular, recent int, asJSON bool) error {
|
||||||
defer func() { _ = db.Close() }()
|
defer func() { _ = db.Close() }()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,23 @@ storage:
|
||||||
# Empty or "0" means unlimited
|
# Empty or "0" means unlimited
|
||||||
max_size: ""
|
max_size: ""
|
||||||
|
|
||||||
|
# Redirect cached artifact downloads to presigned storage URLs (HTTP 302)
|
||||||
|
# instead of streaming through the proxy. Only effective for S3 and Azure.
|
||||||
|
# Leave disabled if clients reach the proxy through an authenticating gateway,
|
||||||
|
# since presigned URLs bypass it.
|
||||||
|
direct_serve: false
|
||||||
|
|
||||||
|
# How long presigned URLs remain valid (e.g. "5m", "1h"). Default: "15m".
|
||||||
|
direct_serve_ttl: "15m"
|
||||||
|
|
||||||
|
# Public base URL to substitute into presigned URLs. Set this when the
|
||||||
|
# proxy reaches storage at an internal address (127.0.0.1, a Docker
|
||||||
|
# service name) but clients must use a public hostname. Only scheme and
|
||||||
|
# host are used; the signed path and query are preserved. For S3/MinIO
|
||||||
|
# the reverse proxy at this address must forward requests with the
|
||||||
|
# internal Host header or the SigV4 signature will not validate.
|
||||||
|
# direct_serve_base_url: "https://minio.example.com"
|
||||||
|
|
||||||
# Database configuration
|
# Database configuration
|
||||||
database:
|
database:
|
||||||
# Database driver: "sqlite" (default) or "postgres"
|
# Database driver: "sqlite" (default) or "postgres"
|
||||||
|
|
@ -49,11 +66,156 @@ log:
|
||||||
# Log format: "text" or "json"
|
# Log format: "text" or "json"
|
||||||
format: "text"
|
format: "text"
|
||||||
|
|
||||||
|
# Ecosystem support - routes and upstream repositories
|
||||||
|
#
|
||||||
|
# This section is optional, since 'include_default' in each section
|
||||||
|
# defaults to 'true' and the route map will be populated with all of
|
||||||
|
# the default routes if no configuration is provided.
|
||||||
|
ecosystem:
|
||||||
|
cargo:
|
||||||
|
include_default: true
|
||||||
|
# the default route for crates.io
|
||||||
|
# route:
|
||||||
|
# - path: /cargo
|
||||||
|
# upstream:
|
||||||
|
# - name: crates.io
|
||||||
|
# index: https://index.crates.io
|
||||||
|
# crates: https://static.crates.io/crates
|
||||||
|
composer:
|
||||||
|
include_default: true
|
||||||
|
# the default route for packagist.org
|
||||||
|
# route:
|
||||||
|
# - path: /composer
|
||||||
|
# upstream:
|
||||||
|
# - name: packagist.org
|
||||||
|
# upstream: https://packagist.org
|
||||||
|
# repository: https://repo.packagist.org
|
||||||
|
conan:
|
||||||
|
include_default: true
|
||||||
|
# the default route for conan.io
|
||||||
|
# route:
|
||||||
|
# - path: /conan
|
||||||
|
# upstream:
|
||||||
|
# - name: conan.io
|
||||||
|
# upstream: https://center.conan.io
|
||||||
|
conda:
|
||||||
|
include_default: true
|
||||||
|
# the default route for anaconda.org
|
||||||
|
# route:
|
||||||
|
# - path: /conda
|
||||||
|
# upstream:
|
||||||
|
# - name: anaconda.org
|
||||||
|
# upstream: https://conda.anaconda.org
|
||||||
|
cran:
|
||||||
|
include_default: true
|
||||||
|
# the default route for r-project.org
|
||||||
|
# route:
|
||||||
|
# - path: /cran
|
||||||
|
# upstream:
|
||||||
|
# - name: r-project.org
|
||||||
|
# upstream: https://cloud.r-project.org
|
||||||
|
debian:
|
||||||
|
include_default: true
|
||||||
|
# the default route for debian.org
|
||||||
|
# route:
|
||||||
|
# - path: /debian
|
||||||
|
# upstream:
|
||||||
|
# - name: debian.org
|
||||||
|
# upstream: http://deb.debian.org/debian
|
||||||
|
gem:
|
||||||
|
include_default: true
|
||||||
|
# the default route for rubygems.org
|
||||||
|
# route:
|
||||||
|
# - path: /gem
|
||||||
|
# upstream:
|
||||||
|
# - name: rubygems.org
|
||||||
|
# upstream: https://rubygems.org
|
||||||
|
go:
|
||||||
|
include_default: true
|
||||||
|
# the default route for golang.org
|
||||||
|
# route:
|
||||||
|
# - path: /go
|
||||||
|
# upstream:
|
||||||
|
# - name: golang.org
|
||||||
|
# upstream: https://proxy.golang.org
|
||||||
|
hex:
|
||||||
|
include_default: true
|
||||||
|
# the default route for hex.pm
|
||||||
|
# route:
|
||||||
|
# - path: /hex
|
||||||
|
# upstream:
|
||||||
|
# - name: hex.pm
|
||||||
|
# upstream: https://repo.hex.pm
|
||||||
|
maven:
|
||||||
|
include_default: true
|
||||||
|
# the default route for maven.org
|
||||||
|
# route:
|
||||||
|
# - path: /maven
|
||||||
|
# upstream:
|
||||||
|
# - name: maven.org
|
||||||
|
# upstream: https://repo1.maven.org/maven2
|
||||||
|
npm:
|
||||||
|
include_default: true
|
||||||
|
# the default route for npmjs.org
|
||||||
|
# route:
|
||||||
|
# - path: /npm
|
||||||
|
# upstream:
|
||||||
|
# - name: npmjs.org
|
||||||
|
# upstream: https://registry.npmjs.org
|
||||||
|
nuget:
|
||||||
|
include_default: true
|
||||||
|
# the default route for nuget.org
|
||||||
|
# route:
|
||||||
|
# - path: /nuget
|
||||||
|
# upstream:
|
||||||
|
# - name: nuget.org
|
||||||
|
# upstream: https://api.nuget.org
|
||||||
|
oci:
|
||||||
|
include_default: true
|
||||||
|
# the default route for docker.io
|
||||||
|
# route:
|
||||||
|
# - path: /v2
|
||||||
|
# upstream:
|
||||||
|
# - name: docker.io
|
||||||
|
# registry: https://registry-1.docker.io
|
||||||
|
# auth: https://auth.docker.io
|
||||||
|
pub:
|
||||||
|
include_default: true
|
||||||
|
# the default route for pub.dev
|
||||||
|
# route:
|
||||||
|
# - path: /pub
|
||||||
|
# upstream:
|
||||||
|
# - name: pub.dev
|
||||||
|
# upstream: https://pub.dev
|
||||||
|
pypi:
|
||||||
|
include_default: true
|
||||||
|
# the default route for pypi.org
|
||||||
|
# route:
|
||||||
|
# - path: /pypi
|
||||||
|
# upstream:
|
||||||
|
# - name: pypi.org
|
||||||
|
# index: https://pypi.org
|
||||||
|
# files_host: files.pythonhosted.org
|
||||||
|
rpm:
|
||||||
|
include_default: true
|
||||||
|
# the default route for fedoraproject.org
|
||||||
|
# route:
|
||||||
|
# - path: /rpm
|
||||||
|
# upstream:
|
||||||
|
# - name: fedoraproject.org
|
||||||
|
# upstream: https://dl.fedoraproject.org/pub/fedora/linux
|
||||||
|
|
||||||
# Upstream registry URLs and authentication
|
# Upstream registry URLs and authentication
|
||||||
upstream:
|
upstream:
|
||||||
# npm registry URL
|
# npm registry URL
|
||||||
npm: "https://registry.npmjs.org"
|
npm: "https://registry.npmjs.org"
|
||||||
|
|
||||||
|
# Maven repository URL (used by /maven endpoint)
|
||||||
|
maven: "https://repo1.maven.org/maven2"
|
||||||
|
|
||||||
|
# Gradle Plugin Portal Maven URL (fallback for plugin marker artifacts)
|
||||||
|
gradle_plugin_portal: "https://plugins.gradle.org/m2"
|
||||||
|
|
||||||
# Cargo sparse index URL
|
# Cargo sparse index URL
|
||||||
cargo: "https://index.crates.io"
|
cargo: "https://index.crates.io"
|
||||||
|
|
||||||
|
|
@ -91,6 +253,35 @@ upstream:
|
||||||
# header_name: "X-Auth-Token"
|
# header_name: "X-Auth-Token"
|
||||||
# header_value: "${MAVEN_TOKEN}"
|
# header_value: "${MAVEN_TOKEN}"
|
||||||
|
|
||||||
|
# Gradle HttpBuildCache configuration
|
||||||
|
gradle:
|
||||||
|
build_cache:
|
||||||
|
# Set to true to disable PUT uploads (read-only cache mode)
|
||||||
|
read_only: false
|
||||||
|
|
||||||
|
# Maximum accepted Gradle cache upload body size
|
||||||
|
# Required and must be > 0
|
||||||
|
max_upload_size: "100MB"
|
||||||
|
|
||||||
|
# Evict entries older than this age (set to "0" to disable age-based eviction)
|
||||||
|
max_age: "168h"
|
||||||
|
|
||||||
|
# Cap total Gradle cache size; oldest entries are deleted first
|
||||||
|
# ("0" disables size-based eviction)
|
||||||
|
# max_size: "20GB"
|
||||||
|
|
||||||
|
# How often eviction runs when max_age or max_size is set
|
||||||
|
sweep_interval: "10m"
|
||||||
|
|
||||||
|
# Health endpoint configuration.
|
||||||
|
health:
|
||||||
|
# Minimum time between storage backend probes.
|
||||||
|
# The /health endpoint runs a write/read/verify/delete round-trip
|
||||||
|
# against the configured storage backend and caches the result for
|
||||||
|
# this interval. Set to "0" to probe on every request.
|
||||||
|
# Default: "30s".
|
||||||
|
storage_probe_interval: "30s"
|
||||||
|
|
||||||
# Version cooldown configuration
|
# Version cooldown configuration
|
||||||
# Hides package versions published too recently, giving the community time
|
# Hides package versions published too recently, giving the community time
|
||||||
# to spot malicious releases before they're pulled into projects.
|
# to spot malicious releases before they're pulled into projects.
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ The proxy is a caching HTTP server that sits between package manager clients and
|
||||||
│ │ /npm/* -> NPMHandler /health -> healthHandler │ │
|
│ │ /npm/* -> NPMHandler /health -> healthHandler │ │
|
||||||
│ │ /cargo/* -> CargoHandler /stats -> statsHandler │ │
|
│ │ /cargo/* -> CargoHandler /stats -> statsHandler │ │
|
||||||
│ │ /gem/* -> GemHandler /metrics -> prometheus │ │
|
│ │ /gem/* -> GemHandler /metrics -> prometheus │ │
|
||||||
│ │ ...16 ecosystems /api/* -> APIHandler │ │
|
│ │ ...17 ecosystems /api/* -> APIHandler │ │
|
||||||
│ │ / -> Web UI │ │
|
│ │ / -> Web UI │ │
|
||||||
│ └──────────────────────────────────────────────────────────┘ │
|
│ └──────────────────────────────────────────────────────────┘ │
|
||||||
│ │ │ │ │
|
│ │ │ │ │
|
||||||
|
|
@ -161,11 +161,25 @@ vulnerabilities (
|
||||||
updated_at DATETIME
|
updated_at DATETIME
|
||||||
)
|
)
|
||||||
-- indexes: (vuln_id, ecosystem, package_name) unique, (ecosystem, package_name)
|
-- indexes: (vuln_id, ecosystem, package_name) unique, (ecosystem, package_name)
|
||||||
|
|
||||||
|
metadata_cache (
|
||||||
|
id INTEGER PRIMARY KEY,
|
||||||
|
ecosystem TEXT NOT NULL,
|
||||||
|
name TEXT NOT NULL,
|
||||||
|
storage_path TEXT NOT NULL,
|
||||||
|
etag TEXT,
|
||||||
|
content_type TEXT,
|
||||||
|
size INTEGER, -- BIGINT on Postgres
|
||||||
|
fetched_at DATETIME,
|
||||||
|
created_at DATETIME,
|
||||||
|
updated_at DATETIME
|
||||||
|
)
|
||||||
|
-- indexes: (ecosystem, name) unique
|
||||||
```
|
```
|
||||||
|
|
||||||
On PostgreSQL, `INTEGER PRIMARY KEY` becomes `SERIAL`, `DATETIME` becomes `TIMESTAMP`, `INTEGER DEFAULT 0` booleans become `BOOLEAN DEFAULT FALSE`, and size/count columns use `BIGINT`.
|
On PostgreSQL, `INTEGER PRIMARY KEY` becomes `SERIAL`, `DATETIME` becomes `TIMESTAMP`, `INTEGER DEFAULT 0` booleans become `BOOLEAN DEFAULT FALSE`, and size/count columns use `BIGINT`.
|
||||||
|
|
||||||
The `MigrateSchema()` function handles backward compatibility with older git-pkgs databases by adding missing columns via `ALTER TABLE` as needed.
|
The `MigrateSchema()` function handles backward compatibility with older git-pkgs databases by running named migrations that add missing columns and tables. See [migrations.md](migrations.md) for how to add new schema changes.
|
||||||
|
|
||||||
**Key operations:**
|
**Key operations:**
|
||||||
- `GetPackageByPURL()` - Look up package by PURL
|
- `GetPackageByPURL()` - Look up package by PURL
|
||||||
|
|
@ -263,20 +277,26 @@ HTTP server setup, web UI, and API handlers.
|
||||||
- Web UI: dashboard, package browser, source browser, version comparison
|
- Web UI: dashboard, package browser, source browser, version comparison
|
||||||
- Templates are embedded in the binary via `//go:embed`
|
- Templates are embedded in the binary via `//go:embed`
|
||||||
- Enrichment API for package metadata, vulnerability scanning, and outdated detection
|
- Enrichment API for package metadata, vulnerability scanning, and outdated detection
|
||||||
- Health, stats, and Prometheus metrics endpoints
|
- Health, stats, and Prometheus metrics endpoints. `/health` runs an active write → size-check → read → verify → delete probe against the storage backend and returns a structured JSON response (`HealthResponse`) with `"ok"` / `"error"` status per subsystem. Probe results are cached (default 30 s, configurable via `health.storage_probe_interval`) to avoid overwhelming remote backends.
|
||||||
|
|
||||||
### `internal/metrics`
|
### `internal/metrics`
|
||||||
|
|
||||||
Prometheus metrics for cache performance, upstream latency, storage operations, and active requests. See the Monitoring section of the README for the full metric list.
|
Prometheus metrics for cache performance, upstream latency, storage operations, and active requests. See the Monitoring section of the README for the full metric list.
|
||||||
|
|
||||||
### `internal/cooldown`
|
### Cooldown
|
||||||
|
|
||||||
Version age filtering for supply chain attack mitigation. Configurable at global, ecosystem, and per-package levels. Supported by npm, PyPI, pub.dev, and Composer handlers.
|
Version age filtering for supply chain attack mitigation, provided by [github.com/git-pkgs/cooldown](https://github.com/git-pkgs/cooldown). Configurable at global, ecosystem, and per-package levels. Supported by npm, PyPI, pub.dev, and Composer handlers.
|
||||||
|
|
||||||
### `internal/enrichment`
|
### `internal/enrichment`
|
||||||
|
|
||||||
Package metadata enrichment. Fetches license, description, homepage, repository URL, and vulnerability data from upstream registries. Powers the `/api/` endpoints and the web UI's package detail pages.
|
Package metadata enrichment. Fetches license, description, homepage, repository URL, and vulnerability data from upstream registries. Powers the `/api/` endpoints and the web UI's package detail pages.
|
||||||
|
|
||||||
|
### `internal/mirror`
|
||||||
|
|
||||||
|
Selective package mirroring for pre-populating the proxy cache. Supports multiple input sources: individual PURLs (versioned or unversioned), CycloneDX/SPDX SBOM files, and full registry enumeration. Uses a bounded worker pool backed by `errgroup` to download artifacts in parallel, reusing `handler.Proxy.GetOrFetchArtifact()` for the actual fetch-and-cache work.
|
||||||
|
|
||||||
|
The package also provides a `MetadataCache` for storing raw upstream metadata blobs so the proxy can serve metadata responses offline. The `JobStore` manages async mirror jobs exposed via the `/api/mirror` endpoints.
|
||||||
|
|
||||||
### `internal/config`
|
### `internal/config`
|
||||||
|
|
||||||
Configuration loading.
|
Configuration loading.
|
||||||
|
|
@ -326,10 +346,11 @@ Eviction can be implemented as:
|
||||||
- Ensures clients fetch artifacts through proxy
|
- Ensures clients fetch artifacts through proxy
|
||||||
- Alternative: Let clients fetch directly, miss cache opportunity
|
- Alternative: Let clients fetch directly, miss cache opportunity
|
||||||
|
|
||||||
**Why not cache metadata?**
|
**Why not cache metadata (by default)?**
|
||||||
- Simplicity - no invalidation logic needed
|
- Simplicity - no invalidation logic needed
|
||||||
- Fresh data - new versions visible immediately
|
- Fresh data - new versions visible immediately
|
||||||
- Metadata is small, upstream fetch is fast
|
- Metadata is small, upstream fetch is fast
|
||||||
|
- Set `cache_metadata: true` or use the mirror command to enable metadata caching for offline use via the `metadata_cache` table
|
||||||
|
|
||||||
**Why stream artifacts?**
|
**Why stream artifacts?**
|
||||||
- Memory efficient - don't load large files into RAM
|
- Memory efficient - don't load large files into RAM
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,8 @@ Override default upstream registry URLs:
|
||||||
```yaml
|
```yaml
|
||||||
upstream:
|
upstream:
|
||||||
npm: "https://registry.npmjs.org"
|
npm: "https://registry.npmjs.org"
|
||||||
|
maven: "https://repo1.maven.org/maven2"
|
||||||
|
gradle_plugin_portal: "https://plugins.gradle.org/m2"
|
||||||
cargo: "https://index.crates.io"
|
cargo: "https://index.crates.io"
|
||||||
cargo_download: "https://static.crates.io/crates"
|
cargo_download: "https://static.crates.io/crates"
|
||||||
```
|
```
|
||||||
|
|
@ -184,6 +186,30 @@ upstream:
|
||||||
token: "${PRIVATE_TOKEN}"
|
token: "${PRIVATE_TOKEN}"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Gradle Build Cache
|
||||||
|
|
||||||
|
The `/gradle` endpoint supports optional safeguards for upload control and cache retention.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gradle:
|
||||||
|
build_cache:
|
||||||
|
read_only: false
|
||||||
|
max_upload_size: "100MB"
|
||||||
|
max_age: "168h"
|
||||||
|
max_size: "20GB"
|
||||||
|
sweep_interval: "10m"
|
||||||
|
```
|
||||||
|
|
||||||
|
| Config | Environment | Description |
|
||||||
|
|--------|-------------|-------------|
|
||||||
|
| `gradle.build_cache.read_only` | `PROXY_GRADLE_BUILD_CACHE_READ_ONLY` | Disable PUT uploads and keep GET/HEAD read-only |
|
||||||
|
| `gradle.build_cache.max_upload_size` | `PROXY_GRADLE_BUILD_CACHE_MAX_UPLOAD_SIZE` | Maximum accepted PUT body size (must be > 0) |
|
||||||
|
| `gradle.build_cache.max_age` | `PROXY_GRADLE_BUILD_CACHE_MAX_AGE` | Delete entries older than this duration (default `168h`, set `0` to disable) |
|
||||||
|
| `gradle.build_cache.max_size` | `PROXY_GRADLE_BUILD_CACHE_MAX_SIZE` | Total size cap for `_gradle/http-build-cache`, deleting oldest first (`0` disables) |
|
||||||
|
| `gradle.build_cache.sweep_interval` | `PROXY_GRADLE_BUILD_CACHE_SWEEP_INTERVAL` | Frequency for background eviction sweeps |
|
||||||
|
|
||||||
|
`max_age` and `max_size` are independent and can be combined. When both are set, age-based eviction runs first, then size-based eviction trims remaining entries oldest-first.
|
||||||
|
|
||||||
## Cooldown
|
## Cooldown
|
||||||
|
|
||||||
The cooldown feature hides package versions published too recently, giving the community time to spot malicious releases before they reach your projects. When a version is within its cooldown period, it's stripped from metadata responses so package managers won't install it.
|
The cooldown feature hides package versions published too recently, giving the community time to spot malicious releases before they reach your projects. When a version is within its cooldown period, it's stripped from metadata responses so package managers won't install it.
|
||||||
|
|
@ -209,7 +235,68 @@ Durations support days (`7d`), hours (`48h`), and minutes (`30m`). Set to `0` to
|
||||||
|
|
||||||
Resolution order: package override, then ecosystem override, then global default. This lets you set a conservative default while exempting trusted packages.
|
Resolution order: package override, then ecosystem override, then global default. This lets you set a conservative default while exempting trusted packages.
|
||||||
|
|
||||||
Currently supported for npm, PyPI, pub.dev, and Composer. These ecosystems include publish timestamps in their metadata. Other ecosystems (Go, Cargo, RubyGems) would require extra API calls and are not yet supported.
|
Currently supported for npm, PyPI, pub.dev, Composer, Cargo, NuGet, Conda, RubyGems, and Hex. These ecosystems include publish timestamps in their metadata.
|
||||||
|
|
||||||
|
Note: Hex cooldown requires disabling registry signature verification since the proxy re-encodes the protobuf payload without the original signature. Set `HEX_NO_VERIFY_REPO_ORIGIN=1` or configure your repo with `no_verify: true`.
|
||||||
|
|
||||||
|
## Metadata Caching
|
||||||
|
|
||||||
|
By default the proxy fetches metadata fresh from upstream on every request. Enable `cache_metadata` to store metadata responses in the database and storage backend for offline fallback. When upstream is unreachable, the proxy serves the last cached copy. ETag-based revalidation avoids re-downloading unchanged metadata.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
cache_metadata: true
|
||||||
|
```
|
||||||
|
|
||||||
|
Or via environment variable: `PROXY_CACHE_METADATA=true`.
|
||||||
|
|
||||||
|
The `proxy mirror` command always enables metadata caching regardless of this setting.
|
||||||
|
|
||||||
|
### Metadata TTL
|
||||||
|
|
||||||
|
When metadata caching is enabled, `metadata_ttl` controls how long a cached response is considered fresh before revalidating with upstream. During the TTL window, cached metadata is served directly without contacting upstream, reducing latency and upstream load.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
metadata_ttl: "5m" # default
|
||||||
|
```
|
||||||
|
|
||||||
|
Or via environment variable: `PROXY_METADATA_TTL=10m`.
|
||||||
|
|
||||||
|
Set to `"0"` to always revalidate with upstream (ETag-based conditional requests still avoid re-downloading unchanged content).
|
||||||
|
|
||||||
|
When upstream is unreachable and the cached entry is past its TTL, the proxy serves the stale cached copy with a `Warning: 110 - "Response is Stale"` header so clients can tell the data may be outdated.
|
||||||
|
|
||||||
|
## Mirror API
|
||||||
|
|
||||||
|
The `/api/mirror` endpoints are disabled by default. Enable them to allow starting mirror jobs via HTTP:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
mirror_api: true
|
||||||
|
```
|
||||||
|
|
||||||
|
Or via environment variable: `PROXY_MIRROR_API=true`.
|
||||||
|
|
||||||
|
When disabled, the endpoints are not registered and return 404.
|
||||||
|
|
||||||
|
## Mirror Command
|
||||||
|
|
||||||
|
The `proxy mirror` command pre-populates the cache from various sources. It accepts the same storage and database flags as `serve`.
|
||||||
|
|
||||||
|
| Flag | Default | Description |
|
||||||
|
|------|---------|-------------|
|
||||||
|
| `--sbom` | | Path to CycloneDX or SPDX SBOM file |
|
||||||
|
| `--concurrency` | `4` | Number of parallel downloads |
|
||||||
|
| `--dry-run` | `false` | Show what would be mirrored without downloading |
|
||||||
|
| `--config` | | Path to configuration file |
|
||||||
|
| `--storage-url` | | Storage URL |
|
||||||
|
| `--database-driver` | | Database driver |
|
||||||
|
| `--database-path` | | SQLite database file |
|
||||||
|
| `--database-url` | | PostgreSQL connection URL |
|
||||||
|
|
||||||
|
Positional arguments are treated as PURLs:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
proxy mirror pkg:npm/lodash@4.17.21 pkg:cargo/serde@1.0.0
|
||||||
|
```
|
||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
|
|
||||||
|
|
|
||||||
51
docs/migrations.md
Normal file
51
docs/migrations.md
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
# Database Migrations
|
||||||
|
|
||||||
|
Schema changes are tracked in a `migrations` table. Each migration has a name and a function. On startup, `MigrateSchema()` loads the set of already-applied names in one query and runs anything new.
|
||||||
|
|
||||||
|
Fresh databases created via `Create()` get the full schema and all migrations are recorded as already applied.
|
||||||
|
|
||||||
|
## Adding a migration
|
||||||
|
|
||||||
|
In `internal/database/schema.go`:
|
||||||
|
|
||||||
|
1. Write a migration function:
|
||||||
|
|
||||||
|
```go
|
||||||
|
func migrateAddWidgetColumn(db *DB) error {
|
||||||
|
hasCol, err := db.HasColumn("packages", "widget")
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("checking column widget: %w", err)
|
||||||
|
}
|
||||||
|
if !hasCol {
|
||||||
|
colType := "TEXT"
|
||||||
|
if db.dialect == DialectPostgres {
|
||||||
|
colType = "TEXT" // adjust if types differ
|
||||||
|
}
|
||||||
|
if _, err := db.Exec(fmt.Sprintf("ALTER TABLE packages ADD COLUMN widget %s", colType)); err != nil {
|
||||||
|
return fmt.Errorf("adding column widget: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Append it to the `migrations` slice with the next sequential prefix:
|
||||||
|
|
||||||
|
```go
|
||||||
|
var migrations = []migration{
|
||||||
|
{"001_add_packages_enrichment_columns", migrateAddPackagesEnrichmentColumns},
|
||||||
|
{"002_add_versions_enrichment_columns", migrateAddVersionsEnrichmentColumns},
|
||||||
|
{"003_ensure_artifacts_table", migrateEnsureArtifactsTable},
|
||||||
|
{"004_ensure_vulnerabilities_table", migrateEnsureVulnerabilitiesTable},
|
||||||
|
{"005_add_widget_column", migrateAddWidgetColumn}, // new
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Add the same column to both `schemaSQLite` and `schemaPostgres` at the top of the file so fresh databases start with the full schema.
|
||||||
|
|
||||||
|
## Rules
|
||||||
|
|
||||||
|
- Migration functions must be idempotent. Use `HasColumn`/`HasTable` checks or `IF NOT EXISTS` clauses so they're safe to run against a database that already has the change.
|
||||||
|
- Handle both SQLite and Postgres dialects. Common differences: `DATETIME` vs `TIMESTAMP`, `INTEGER DEFAULT 0` vs `BOOLEAN DEFAULT FALSE`, `INTEGER PRIMARY KEY` vs `SERIAL PRIMARY KEY`.
|
||||||
|
- Never reorder or rename existing entries. The name string is the migration's identity in the database.
|
||||||
|
- Never remove old migrations from the list. They won't run on already-migrated databases, but they need to exist for older databases upgrading for the first time.
|
||||||
|
|
@ -64,13 +64,13 @@ const docTemplate = `{
|
||||||
"404": {
|
"404": {
|
||||||
"description": "Not Found",
|
"description": "Not Found",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -126,19 +126,19 @@ const docTemplate = `{
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"description": "Not Found",
|
"description": "Not Found",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -177,13 +177,13 @@ const docTemplate = `{
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -240,13 +240,13 @@ const docTemplate = `{
|
||||||
"404": {
|
"404": {
|
||||||
"description": "Not Found",
|
"description": "Not Found",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -285,122 +285,13 @@ const docTemplate = `{
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/api/package/{ecosystem}/{name}": {
|
|
||||||
"get": {
|
|
||||||
"description": "Returns enriched package metadata. URL-encode scoped names (e.g. @scope/name -\u003e %40scope%2Fname).",
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"api"
|
|
||||||
],
|
|
||||||
"summary": "Get package metadata",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Ecosystem",
|
|
||||||
"name": "ecosystem",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Package name",
|
|
||||||
"name": "name",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "OK",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/server.PackageResponse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "Bad Request",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"404": {
|
|
||||||
"description": "Not Found",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "Internal Server Error",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/api/package/{ecosystem}/{name}/{version}": {
|
|
||||||
"get": {
|
|
||||||
"description": "Returns enriched package+version metadata and vulnerability data.",
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"api"
|
|
||||||
],
|
|
||||||
"summary": "Get version metadata and vulnerabilities",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Ecosystem",
|
|
||||||
"name": "ecosystem",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Package name",
|
|
||||||
"name": "name",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Version",
|
|
||||||
"name": "version",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "OK",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/server.EnrichmentResponse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "Bad Request",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "Internal Server Error",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -447,13 +338,13 @@ const docTemplate = `{
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -493,115 +384,13 @@ const docTemplate = `{
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/api/vulns/{ecosystem}/{name}": {
|
|
||||||
"get": {
|
|
||||||
"description": "Returns vulnerabilities for a package across versions, or for a specific version if provided.",
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"api"
|
|
||||||
],
|
|
||||||
"summary": "Get vulnerabilities for a package or version",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Ecosystem",
|
|
||||||
"name": "ecosystem",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Package name",
|
|
||||||
"name": "name",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "OK",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/server.VulnsResponse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "Bad Request",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "Internal Server Error",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/api/vulns/{ecosystem}/{name}/{version}": {
|
|
||||||
"get": {
|
|
||||||
"description": "Returns vulnerabilities for a package across versions, or for a specific version if provided.",
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"api"
|
|
||||||
],
|
|
||||||
"summary": "Get vulnerabilities for a package or version",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Ecosystem",
|
|
||||||
"name": "ecosystem",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Package name",
|
|
||||||
"name": "name",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Version",
|
|
||||||
"name": "version",
|
|
||||||
"in": "path"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "OK",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/server.VulnsResponse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "Bad Request",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "Internal Server Error",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -610,7 +399,7 @@ const docTemplate = `{
|
||||||
"/health": {
|
"/health": {
|
||||||
"get": {
|
"get": {
|
||||||
"produces": [
|
"produces": [
|
||||||
"text/plain"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"meta"
|
"meta"
|
||||||
|
|
@ -620,13 +409,13 @@ const docTemplate = `{
|
||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.HealthResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"503": {
|
"503": {
|
||||||
"description": "Service Unavailable",
|
"description": "Service Unavailable",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.HealthResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -651,7 +440,7 @@ const docTemplate = `{
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -715,26 +504,42 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"server.EnrichmentResponse": {
|
"server.ErrorResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"is_outdated": {
|
"code": {
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"license_category": {
|
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"package": {
|
"message": {
|
||||||
"$ref": "#/definitions/server.PackageResponse"
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"server.HealthCheck": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"error": {
|
||||||
|
"type": "string"
|
||||||
},
|
},
|
||||||
"version": {
|
"status": {
|
||||||
"$ref": "#/definitions/server.VersionResponse"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"vulnerabilities": {
|
"step": {
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": {
|
}
|
||||||
"$ref": "#/definitions/server.VulnResponse"
|
}
|
||||||
|
},
|
||||||
|
"server.HealthResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"checks": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"$ref": "#/definitions/server.HealthCheck"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -949,84 +754,6 @@ const docTemplate = `{
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"server.VersionResponse": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"ecosystem": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"integrity": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"is_outdated": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"license": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"published_at": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"version": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"yanked": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"server.VulnResponse": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"cvss_score": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"fixed_version": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"id": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"references": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"severity": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"summary": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"server.VulnsResponse": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"count": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"ecosystem": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"version": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"vulnerabilities": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/definitions/server.VulnResponse"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}`
|
}`
|
||||||
|
|
|
||||||
|
|
@ -57,13 +57,13 @@
|
||||||
"404": {
|
"404": {
|
||||||
"description": "Not Found",
|
"description": "Not Found",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -119,19 +119,19 @@
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"description": "Not Found",
|
"description": "Not Found",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -170,13 +170,13 @@
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -233,13 +233,13 @@
|
||||||
"404": {
|
"404": {
|
||||||
"description": "Not Found",
|
"description": "Not Found",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -278,122 +278,13 @@
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/api/package/{ecosystem}/{name}": {
|
|
||||||
"get": {
|
|
||||||
"description": "Returns enriched package metadata. URL-encode scoped names (e.g. @scope/name -\u003e %40scope%2Fname).",
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"api"
|
|
||||||
],
|
|
||||||
"summary": "Get package metadata",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Ecosystem",
|
|
||||||
"name": "ecosystem",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Package name",
|
|
||||||
"name": "name",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "OK",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/server.PackageResponse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "Bad Request",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"404": {
|
|
||||||
"description": "Not Found",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "Internal Server Error",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/api/package/{ecosystem}/{name}/{version}": {
|
|
||||||
"get": {
|
|
||||||
"description": "Returns enriched package+version metadata and vulnerability data.",
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"api"
|
|
||||||
],
|
|
||||||
"summary": "Get version metadata and vulnerabilities",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Ecosystem",
|
|
||||||
"name": "ecosystem",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Package name",
|
|
||||||
"name": "name",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Version",
|
|
||||||
"name": "version",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "OK",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/server.EnrichmentResponse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "Bad Request",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "Internal Server Error",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -440,13 +331,13 @@
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -486,115 +377,13 @@
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/api/vulns/{ecosystem}/{name}": {
|
|
||||||
"get": {
|
|
||||||
"description": "Returns vulnerabilities for a package across versions, or for a specific version if provided.",
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"api"
|
|
||||||
],
|
|
||||||
"summary": "Get vulnerabilities for a package or version",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Ecosystem",
|
|
||||||
"name": "ecosystem",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Package name",
|
|
||||||
"name": "name",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "OK",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/server.VulnsResponse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "Bad Request",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "Internal Server Error",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/api/vulns/{ecosystem}/{name}/{version}": {
|
|
||||||
"get": {
|
|
||||||
"description": "Returns vulnerabilities for a package across versions, or for a specific version if provided.",
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"api"
|
|
||||||
],
|
|
||||||
"summary": "Get vulnerabilities for a package or version",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Ecosystem",
|
|
||||||
"name": "ecosystem",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Package name",
|
|
||||||
"name": "name",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Version",
|
|
||||||
"name": "version",
|
|
||||||
"in": "path"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "OK",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/server.VulnsResponse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "Bad Request",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "Internal Server Error",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -603,7 +392,7 @@
|
||||||
"/health": {
|
"/health": {
|
||||||
"get": {
|
"get": {
|
||||||
"produces": [
|
"produces": [
|
||||||
"text/plain"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"meta"
|
"meta"
|
||||||
|
|
@ -613,13 +402,13 @@
|
||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.HealthResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"503": {
|
"503": {
|
||||||
"description": "Service Unavailable",
|
"description": "Service Unavailable",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.HealthResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -644,7 +433,7 @@
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/server.ErrorResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -708,26 +497,42 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"server.EnrichmentResponse": {
|
"server.ErrorResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"is_outdated": {
|
"code": {
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"license_category": {
|
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"package": {
|
"message": {
|
||||||
"$ref": "#/definitions/server.PackageResponse"
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"server.HealthCheck": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"error": {
|
||||||
|
"type": "string"
|
||||||
},
|
},
|
||||||
"version": {
|
"status": {
|
||||||
"$ref": "#/definitions/server.VersionResponse"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"vulnerabilities": {
|
"step": {
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": {
|
}
|
||||||
"$ref": "#/definitions/server.VulnResponse"
|
}
|
||||||
|
},
|
||||||
|
"server.HealthResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"checks": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"$ref": "#/definitions/server.HealthCheck"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -942,84 +747,6 @@
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"server.VersionResponse": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"ecosystem": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"integrity": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"is_outdated": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"license": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"published_at": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"version": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"yanked": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"server.VulnResponse": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"cvss_score": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"fixed_version": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"id": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"references": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"severity": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"summary": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"server.VulnsResponse": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"count": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"ecosystem": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"version": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"vulnerabilities": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/definitions/server.VulnResponse"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
52
go.mod
52
go.mod
|
|
@ -3,27 +3,35 @@ module github.com/git-pkgs/proxy
|
||||||
go 1.25.6
|
go 1.25.6
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/git-pkgs/archives v0.2.0
|
github.com/BurntSushi/toml v1.6.0
|
||||||
github.com/git-pkgs/enrichment v0.2.1
|
github.com/CycloneDX/cyclonedx-go v0.11.0
|
||||||
github.com/git-pkgs/purl v0.1.10
|
github.com/git-pkgs/archives v0.3.0
|
||||||
github.com/git-pkgs/registries v0.4.0
|
github.com/git-pkgs/cooldown v0.1.1
|
||||||
github.com/git-pkgs/spdx v0.1.2
|
github.com/git-pkgs/enrichment v0.2.3
|
||||||
github.com/git-pkgs/vers v0.2.4
|
github.com/git-pkgs/purl v0.1.12
|
||||||
github.com/git-pkgs/vulns v0.1.3
|
github.com/git-pkgs/registries v0.6.1
|
||||||
|
github.com/git-pkgs/spdx v0.1.4
|
||||||
|
github.com/git-pkgs/vers v0.2.6
|
||||||
|
github.com/git-pkgs/vulns v0.1.5
|
||||||
github.com/go-chi/chi/v5 v5.2.5
|
github.com/go-chi/chi/v5 v5.2.5
|
||||||
github.com/jmoiron/sqlx v1.4.0
|
github.com/jmoiron/sqlx v1.4.0
|
||||||
github.com/lib/pq v1.12.0
|
github.com/lib/pq v1.12.3
|
||||||
github.com/prometheus/client_golang v1.23.2
|
github.com/prometheus/client_golang v1.23.2
|
||||||
github.com/prometheus/client_model v0.6.2
|
github.com/prometheus/client_model v0.6.2
|
||||||
|
github.com/spdx/tools-golang v0.5.7
|
||||||
github.com/swaggo/swag v1.16.6
|
github.com/swaggo/swag v1.16.6
|
||||||
gocloud.dev v0.45.0
|
gocloud.dev v0.45.0
|
||||||
|
golang.org/x/sync v0.20.0
|
||||||
|
google.golang.org/protobuf v1.36.11
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
modernc.org/sqlite v1.47.0
|
modernc.org/sqlite v1.50.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
4d63.com/gocheckcompilerdirectives v1.3.0 // indirect
|
4d63.com/gocheckcompilerdirectives v1.3.0 // indirect
|
||||||
4d63.com/gochecknoglobals v0.2.2 // indirect
|
4d63.com/gochecknoglobals v0.2.2 // indirect
|
||||||
|
cloud.google.com/go/auth v0.18.2 // indirect
|
||||||
|
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
|
||||||
cloud.google.com/go/compute/metadata v0.9.0 // indirect
|
cloud.google.com/go/compute/metadata v0.9.0 // indirect
|
||||||
codeberg.org/chavacava/garif v0.2.0 // indirect
|
codeberg.org/chavacava/garif v0.2.0 // indirect
|
||||||
codeberg.org/polyfloyd/go-errorlint v1.9.0 // indirect
|
codeberg.org/polyfloyd/go-errorlint v1.9.0 // indirect
|
||||||
|
|
@ -36,7 +44,13 @@ require (
|
||||||
github.com/Antonboom/errname v1.1.1 // indirect
|
github.com/Antonboom/errname v1.1.1 // indirect
|
||||||
github.com/Antonboom/nilnil v1.1.1 // indirect
|
github.com/Antonboom/nilnil v1.1.1 // indirect
|
||||||
github.com/Antonboom/testifylint v1.6.4 // indirect
|
github.com/Antonboom/testifylint v1.6.4 // indirect
|
||||||
github.com/BurntSushi/toml v1.6.0 // indirect
|
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 // indirect
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 // indirect
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.3 // indirect
|
||||||
|
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
||||||
|
github.com/Azure/go-autorest/autorest/to v0.4.1 // indirect
|
||||||
|
github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect
|
||||||
github.com/Djarvur/go-err113 v0.1.1 // indirect
|
github.com/Djarvur/go-err113 v0.1.1 // indirect
|
||||||
github.com/KyleBanks/depth v1.2.1 // indirect
|
github.com/KyleBanks/depth v1.2.1 // indirect
|
||||||
github.com/Masterminds/semver/v3 v3.4.0 // indirect
|
github.com/Masterminds/semver/v3 v3.4.0 // indirect
|
||||||
|
|
@ -51,6 +65,7 @@ require (
|
||||||
github.com/alfatraining/structtag v1.0.0 // indirect
|
github.com/alfatraining/structtag v1.0.0 // indirect
|
||||||
github.com/alingse/asasalint v0.0.11 // indirect
|
github.com/alingse/asasalint v0.0.11 // indirect
|
||||||
github.com/alingse/nilnesserr v0.2.0 // indirect
|
github.com/alingse/nilnesserr v0.2.0 // indirect
|
||||||
|
github.com/anchore/go-struct-converter v0.1.0 // indirect
|
||||||
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
|
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
|
||||||
github.com/ashanbrown/forbidigo/v2 v2.3.0 // indirect
|
github.com/ashanbrown/forbidigo/v2 v2.3.0 // indirect
|
||||||
github.com/ashanbrown/makezero/v2 v2.1.0 // indirect
|
github.com/ashanbrown/makezero/v2 v2.1.0 // indirect
|
||||||
|
|
@ -113,7 +128,8 @@ require (
|
||||||
github.com/fzipp/gocyclo v0.6.0 // indirect
|
github.com/fzipp/gocyclo v0.6.0 // indirect
|
||||||
github.com/ghostiam/protogetter v0.3.20 // indirect
|
github.com/ghostiam/protogetter v0.3.20 // indirect
|
||||||
github.com/git-pkgs/packageurl-go v0.3.1 // indirect
|
github.com/git-pkgs/packageurl-go v0.3.1 // indirect
|
||||||
github.com/github/go-spdx/v2 v2.4.0 // indirect
|
github.com/git-pkgs/pom v0.1.4 // indirect
|
||||||
|
github.com/github/go-spdx/v2 v2.7.0 // indirect
|
||||||
github.com/go-critic/go-critic v0.14.3 // indirect
|
github.com/go-critic/go-critic v0.14.3 // indirect
|
||||||
github.com/go-logr/logr v1.4.3 // indirect
|
github.com/go-logr/logr v1.4.3 // indirect
|
||||||
github.com/go-logr/stdr v1.2.2 // indirect
|
github.com/go-logr/stdr v1.2.2 // indirect
|
||||||
|
|
@ -133,6 +149,7 @@ require (
|
||||||
github.com/gobwas/glob v0.2.3 // indirect
|
github.com/gobwas/glob v0.2.3 // indirect
|
||||||
github.com/godoc-lint/godoc-lint v0.11.2 // indirect
|
github.com/godoc-lint/godoc-lint v0.11.2 // indirect
|
||||||
github.com/gofrs/flock v0.13.0 // indirect
|
github.com/gofrs/flock v0.13.0 // indirect
|
||||||
|
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
|
||||||
github.com/golangci/asciicheck v0.5.0 // indirect
|
github.com/golangci/asciicheck v0.5.0 // indirect
|
||||||
github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect
|
github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect
|
||||||
github.com/golangci/go-printf-func-name v0.1.1 // indirect
|
github.com/golangci/go-printf-func-name v0.1.1 // indirect
|
||||||
|
|
@ -145,8 +162,10 @@ require (
|
||||||
github.com/golangci/swaggoswag v0.0.0-20250504205917-77f2aca3143e // indirect
|
github.com/golangci/swaggoswag v0.0.0-20250504205917-77f2aca3143e // indirect
|
||||||
github.com/golangci/unconvert v0.0.0-20250410112200-a129a6e6413e // indirect
|
github.com/golangci/unconvert v0.0.0-20250410112200-a129a6e6413e // indirect
|
||||||
github.com/google/go-cmp v0.7.0 // indirect
|
github.com/google/go-cmp v0.7.0 // indirect
|
||||||
|
github.com/google/s2a-go v0.1.9 // indirect
|
||||||
github.com/google/uuid v1.6.0 // indirect
|
github.com/google/uuid v1.6.0 // indirect
|
||||||
github.com/google/wire v0.7.0 // indirect
|
github.com/google/wire v0.7.0 // indirect
|
||||||
|
github.com/googleapis/enterprise-certificate-proxy v0.3.12 // indirect
|
||||||
github.com/googleapis/gax-go/v2 v2.17.0 // indirect
|
github.com/googleapis/gax-go/v2 v2.17.0 // indirect
|
||||||
github.com/gordonklaus/ineffassign v0.2.0 // indirect
|
github.com/gordonklaus/ineffassign v0.2.0 // indirect
|
||||||
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
|
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
|
||||||
|
|
@ -169,6 +188,7 @@ require (
|
||||||
github.com/kkHAIKE/contextcheck v1.1.6 // indirect
|
github.com/kkHAIKE/contextcheck v1.1.6 // indirect
|
||||||
github.com/kulti/thelper v0.7.1 // indirect
|
github.com/kulti/thelper v0.7.1 // indirect
|
||||||
github.com/kunwardeep/paralleltest v1.0.15 // indirect
|
github.com/kunwardeep/paralleltest v1.0.15 // indirect
|
||||||
|
github.com/kylelemons/godebug v1.1.0 // indirect
|
||||||
github.com/lasiar/canonicalheader v1.1.2 // indirect
|
github.com/lasiar/canonicalheader v1.1.2 // indirect
|
||||||
github.com/ldez/exptostd v0.4.5 // indirect
|
github.com/ldez/exptostd v0.4.5 // indirect
|
||||||
github.com/ldez/gomoddirectives v0.8.0 // indirect
|
github.com/ldez/gomoddirectives v0.8.0 // indirect
|
||||||
|
|
@ -201,9 +221,11 @@ require (
|
||||||
github.com/nishanths/predeclared v0.2.2 // indirect
|
github.com/nishanths/predeclared v0.2.2 // indirect
|
||||||
github.com/nunnatsa/ginkgolinter v0.23.0 // indirect
|
github.com/nunnatsa/ginkgolinter v0.23.0 // indirect
|
||||||
github.com/oapi-codegen/runtime v1.2.0 // indirect
|
github.com/oapi-codegen/runtime v1.2.0 // indirect
|
||||||
|
github.com/package-url/packageurl-go v0.1.6 // indirect
|
||||||
github.com/pandatix/go-cvss v0.6.2 // indirect
|
github.com/pandatix/go-cvss v0.6.2 // indirect
|
||||||
github.com/pelletier/go-toml v1.9.5 // indirect
|
github.com/pelletier/go-toml v1.9.5 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
||||||
|
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/prometheus/common v0.67.5 // indirect
|
github.com/prometheus/common v0.67.5 // indirect
|
||||||
github.com/prometheus/procfs v0.20.1 // indirect
|
github.com/prometheus/procfs v0.20.1 // indirect
|
||||||
|
|
@ -272,11 +294,12 @@ require (
|
||||||
go.uber.org/zap v1.27.1 // indirect
|
go.uber.org/zap v1.27.1 // indirect
|
||||||
go.yaml.in/yaml/v2 v2.4.3 // indirect
|
go.yaml.in/yaml/v2 v2.4.3 // indirect
|
||||||
go.yaml.in/yaml/v3 v3.0.4 // indirect
|
go.yaml.in/yaml/v3 v3.0.4 // indirect
|
||||||
|
golang.org/x/crypto v0.48.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa // indirect
|
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa // indirect
|
||||||
golang.org/x/exp/typeparams v0.0.0-20260209203927-2842357ff358 // indirect
|
golang.org/x/exp/typeparams v0.0.0-20260209203927-2842357ff358 // indirect
|
||||||
golang.org/x/mod v0.33.0 // indirect
|
golang.org/x/mod v0.33.0 // indirect
|
||||||
golang.org/x/net v0.51.0 // indirect
|
golang.org/x/net v0.51.0 // indirect
|
||||||
golang.org/x/sync v0.20.0 // indirect
|
golang.org/x/oauth2 v0.35.0 // indirect
|
||||||
golang.org/x/sys v0.42.0 // indirect
|
golang.org/x/sys v0.42.0 // indirect
|
||||||
golang.org/x/text v0.34.0 // indirect
|
golang.org/x/text v0.34.0 // indirect
|
||||||
golang.org/x/tools v0.42.0 // indirect
|
golang.org/x/tools v0.42.0 // indirect
|
||||||
|
|
@ -284,16 +307,15 @@ require (
|
||||||
google.golang.org/api v0.269.0 // indirect
|
google.golang.org/api v0.269.0 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect
|
||||||
google.golang.org/grpc v1.79.1 // indirect
|
google.golang.org/grpc v1.79.1 // indirect
|
||||||
google.golang.org/protobuf v1.36.11 // indirect
|
|
||||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
honnef.co/go/tools v0.7.0 // indirect
|
honnef.co/go/tools v0.7.0 // indirect
|
||||||
modernc.org/libc v1.70.0 // indirect
|
modernc.org/libc v1.72.3 // indirect
|
||||||
modernc.org/mathutil v1.7.1 // indirect
|
modernc.org/mathutil v1.7.1 // indirect
|
||||||
modernc.org/memory v1.11.0 // indirect
|
modernc.org/memory v1.11.0 // indirect
|
||||||
mvdan.cc/gofumpt v0.9.2 // indirect
|
mvdan.cc/gofumpt v0.9.2 // indirect
|
||||||
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 // indirect
|
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 // indirect
|
||||||
sigs.k8s.io/yaml v1.3.0 // indirect
|
sigs.k8s.io/yaml v1.6.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
tool github.com/golangci/golangci-lint/v2/cmd/golangci-lint
|
tool github.com/golangci/golangci-lint/v2/cmd/golangci-lint
|
||||||
|
|
|
||||||
109
go.sum
109
go.sum
|
|
@ -43,9 +43,31 @@ github.com/Antonboom/nilnil v1.1.1 h1:9Mdr6BYd8WHCDngQnNVV0b554xyisFioEKi30sksuf
|
||||||
github.com/Antonboom/nilnil v1.1.1/go.mod h1:yCyAmSw3doopbOWhJlVci+HuyNRuHJKIv6V2oYQa8II=
|
github.com/Antonboom/nilnil v1.1.1/go.mod h1:yCyAmSw3doopbOWhJlVci+HuyNRuHJKIv6V2oYQa8II=
|
||||||
github.com/Antonboom/testifylint v1.6.4 h1:gs9fUEy+egzxkEbq9P4cpcMB6/G0DYdMeiFS87UiqmQ=
|
github.com/Antonboom/testifylint v1.6.4 h1:gs9fUEy+egzxkEbq9P4cpcMB6/G0DYdMeiFS87UiqmQ=
|
||||||
github.com/Antonboom/testifylint v1.6.4/go.mod h1:YO33FROXX2OoUfwjz8g+gUxQXio5i9qpVy7nXGbxDD4=
|
github.com/Antonboom/testifylint v1.6.4/go.mod h1:YO33FROXX2OoUfwjz8g+gUxQXio5i9qpVy7nXGbxDD4=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 h1:JXg2dwJUmPB9JmtVmdEB16APJ7jurfbY5jnfXpJoRMc=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0/go.mod h1:YD5h/ldMsG0XiIw7PdyNhLxaM317eFh5yNLccNfGdyw=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 h1:9iefClla7iYpfYWdzPCRDozdmndjTm8DXdpCzPajMgA=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2/go.mod h1:XtLgD3ZD34DAaVIIAyG3objl5DynM3CQ/vMcbBNJZGI=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1 h1:/Zt+cDPnpC3OVDm/JKLOs7M2DKmLRIIp3XIx9pHHiig=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1/go.mod h1:Ng3urmn6dYe8gnbCMoHHVl5APYz2txho3koEkV2o2HA=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.3 h1:ZJJNFaQ86GVKQ9ehwqyAFE6pIfyicpuJ8IkVaPBc6/4=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.3/go.mod h1:URuDvhmATVKqHBH9/0nOiNKk0+YcwfQ3WkK5PqHKxc8=
|
||||||
|
github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
|
||||||
|
github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
|
||||||
|
github.com/Azure/go-autorest/autorest/to v0.4.1 h1:CxNHBqdzTr7rLtdrtb5CMjJcDut+WNGCVv7OmS5+lTc=
|
||||||
|
github.com/Azure/go-autorest/autorest/to v0.4.1/go.mod h1:EtaofgU4zmtvn1zT2ARsjRFdq9vXx0YWtmElwL+GZ9M=
|
||||||
|
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM=
|
||||||
|
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE=
|
||||||
|
github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 h1:XRzhVemXdgvJqCH0sFfrBUTnUJSBrBf7++ypk+twtRs=
|
||||||
|
github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
|
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
|
||||||
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||||
|
github.com/CycloneDX/cyclonedx-go v0.11.0 h1:GokP8FiRC+foiuwWhSSLpSD5H4hSWtGnR3wo7apkBFI=
|
||||||
|
github.com/CycloneDX/cyclonedx-go v0.11.0/go.mod h1:vUvbCXQsEm48OI6oOlanxstwNByXjCZ2wuleUlwGEO8=
|
||||||
github.com/Djarvur/go-err113 v0.1.1 h1:eHfopDqXRwAi+YmCUas75ZE0+hoBHJ2GQNLYRSxao4g=
|
github.com/Djarvur/go-err113 v0.1.1 h1:eHfopDqXRwAi+YmCUas75ZE0+hoBHJ2GQNLYRSxao4g=
|
||||||
github.com/Djarvur/go-err113 v0.1.1/go.mod h1:IaWJdYFLg76t2ihfflPZnM1LIQszWOsFDh2hhhAVF6k=
|
github.com/Djarvur/go-err113 v0.1.1/go.mod h1:IaWJdYFLg76t2ihfflPZnM1LIQszWOsFDh2hhhAVF6k=
|
||||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 h1:sBEjpZlNHzK1voKq9695PJSX2o5NEXl7/OL3coiIY0c=
|
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 h1:sBEjpZlNHzK1voKq9695PJSX2o5NEXl7/OL3coiIY0c=
|
||||||
|
|
@ -85,6 +107,8 @@ github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQ
|
||||||
github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I=
|
github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I=
|
||||||
github.com/alingse/nilnesserr v0.2.0 h1:raLem5KG7EFVb4UIDAXgrv3N2JIaffeKNtcEXkEWd/w=
|
github.com/alingse/nilnesserr v0.2.0 h1:raLem5KG7EFVb4UIDAXgrv3N2JIaffeKNtcEXkEWd/w=
|
||||||
github.com/alingse/nilnesserr v0.2.0/go.mod h1:1xJPrXonEtX7wyTq8Dytns5P2hNzoWymVUIaKm4HNFg=
|
github.com/alingse/nilnesserr v0.2.0/go.mod h1:1xJPrXonEtX7wyTq8Dytns5P2hNzoWymVUIaKm4HNFg=
|
||||||
|
github.com/anchore/go-struct-converter v0.1.0 h1:2rDRssAl6mgKBSLNiVCMADgZRhoqtw9dedlWa0OhD30=
|
||||||
|
github.com/anchore/go-struct-converter v0.1.0/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA=
|
||||||
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
|
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
|
||||||
github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=
|
github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=
|
||||||
github.com/ashanbrown/forbidigo/v2 v2.3.0 h1:OZZDOchCgsX5gvToVtEBoV2UWbFfI6RKQTir2UZzSxo=
|
github.com/ashanbrown/forbidigo/v2 v2.3.0 h1:OZZDOchCgsX5gvToVtEBoV2UWbFfI6RKQTir2UZzSxo=
|
||||||
|
|
@ -144,6 +168,8 @@ github.com/bombsimon/wsl/v4 v4.7.0 h1:1Ilm9JBPRczjyUs6hvOPKvd7VL1Q++PL8M0SXBDf+j
|
||||||
github.com/bombsimon/wsl/v4 v4.7.0/go.mod h1:uV/+6BkffuzSAVYD+yGyld1AChO7/EuLrCF/8xTiapg=
|
github.com/bombsimon/wsl/v4 v4.7.0/go.mod h1:uV/+6BkffuzSAVYD+yGyld1AChO7/EuLrCF/8xTiapg=
|
||||||
github.com/bombsimon/wsl/v5 v5.6.0 h1:4z+/sBqC5vUmSp1O0mS+czxwH9+LKXtCWtHH9rZGQL8=
|
github.com/bombsimon/wsl/v5 v5.6.0 h1:4z+/sBqC5vUmSp1O0mS+czxwH9+LKXtCWtHH9rZGQL8=
|
||||||
github.com/bombsimon/wsl/v5 v5.6.0/go.mod h1:Uqt2EfrMj2NV8UGoN1f1Y3m0NpUVCsUdrNCdet+8LvU=
|
github.com/bombsimon/wsl/v5 v5.6.0/go.mod h1:Uqt2EfrMj2NV8UGoN1f1Y3m0NpUVCsUdrNCdet+8LvU=
|
||||||
|
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/breml/bidichk v0.3.3 h1:WSM67ztRusf1sMoqH6/c4OBCUlRVTKq+CbSeo0R17sE=
|
github.com/breml/bidichk v0.3.3 h1:WSM67ztRusf1sMoqH6/c4OBCUlRVTKq+CbSeo0R17sE=
|
||||||
github.com/breml/bidichk v0.3.3/go.mod h1:ISbsut8OnjB367j5NseXEGGgO/th206dVa427kR8YTE=
|
github.com/breml/bidichk v0.3.3/go.mod h1:ISbsut8OnjB367j5NseXEGGgO/th206dVa427kR8YTE=
|
||||||
github.com/breml/errchkjson v0.4.1 h1:keFSS8D7A2T0haP9kzZTi7o26r7kE3vymjZNeNDRDwg=
|
github.com/breml/errchkjson v0.4.1 h1:keFSS8D7A2T0haP9kzZTi7o26r7kE3vymjZNeNDRDwg=
|
||||||
|
|
@ -224,24 +250,28 @@ github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo=
|
||||||
github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA=
|
github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA=
|
||||||
github.com/ghostiam/protogetter v0.3.20 h1:oW7OPFit2FxZOpmMRPP9FffU4uUpfeE/rEdE1f+MzD0=
|
github.com/ghostiam/protogetter v0.3.20 h1:oW7OPFit2FxZOpmMRPP9FffU4uUpfeE/rEdE1f+MzD0=
|
||||||
github.com/ghostiam/protogetter v0.3.20/go.mod h1:FjIu5Yfs6FT391m+Fjp3fbAYJ6rkL/J6ySpZBfnODuI=
|
github.com/ghostiam/protogetter v0.3.20/go.mod h1:FjIu5Yfs6FT391m+Fjp3fbAYJ6rkL/J6ySpZBfnODuI=
|
||||||
github.com/git-pkgs/archives v0.2.0 h1:8OuuGwAB+Eww8/1ayyYpZzP0wVEH0/VWBG3mQrfi9SM=
|
github.com/git-pkgs/archives v0.3.0 h1:iXKyO83jEFub1PGEDlHmk2tQ7XeV5LySTc0sEkH3x78=
|
||||||
github.com/git-pkgs/archives v0.2.0/go.mod h1:LTJ1iQVFA7otizWMOyiI82NYVmyBWAPRzwu/e30rcXU=
|
github.com/git-pkgs/archives v0.3.0/go.mod h1:LTJ1iQVFA7otizWMOyiI82NYVmyBWAPRzwu/e30rcXU=
|
||||||
github.com/git-pkgs/enrichment v0.2.1 h1:mJJt4YQBzl9aOfu4226ylnC9H6YO9YZDjGpbSPVahKc=
|
github.com/git-pkgs/cooldown v0.1.1 h1:9OqqzCB8gANz/y44SmqGD0Jp8Qtu81D1sCbKl6Ehg7w=
|
||||||
github.com/git-pkgs/enrichment v0.2.1/go.mod h1:q9eDZpRrUbYwzD4Mtg/T6LRdBMlt2DYRIvVRDULFnKg=
|
github.com/git-pkgs/cooldown v0.1.1/go.mod h1:v7APuK/UouTiu8mWQZbdDmj7DfxxkGUeuhjaRB5gv9E=
|
||||||
|
github.com/git-pkgs/enrichment v0.2.3 h1:42mqoUhQZNGhlEO671pboI/Cu6F+DoffJoFbVhb2jlw=
|
||||||
|
github.com/git-pkgs/enrichment v0.2.3/go.mod h1:MBv5nhHzjwLxeSgx2+7waCcpReUjhCD+9B0bvufpMO0=
|
||||||
github.com/git-pkgs/packageurl-go v0.3.1 h1:WM3RBABQZLaRBxgKyYughc3cVBE8KyQxbSC6Jt5ak7M=
|
github.com/git-pkgs/packageurl-go v0.3.1 h1:WM3RBABQZLaRBxgKyYughc3cVBE8KyQxbSC6Jt5ak7M=
|
||||||
github.com/git-pkgs/packageurl-go v0.3.1/go.mod h1:rcIxiG37BlQLB6FZfgdj9Fm7yjhRQd3l+5o7J0QPAk4=
|
github.com/git-pkgs/packageurl-go v0.3.1/go.mod h1:rcIxiG37BlQLB6FZfgdj9Fm7yjhRQd3l+5o7J0QPAk4=
|
||||||
github.com/git-pkgs/purl v0.1.10 h1:NMjeF10nzFn3tdQlz6rbmHB+i+YkyrFQxho3e33ePTQ=
|
github.com/git-pkgs/pom v0.1.4 h1:C6st+XSbF75eKuwfdkDZZtYHoTcaWRIEQYar5VtszUo=
|
||||||
github.com/git-pkgs/purl v0.1.10/go.mod h1:C5Vp/kyZ/wGckCLexx4wPVfUxEiToRkdsOPh5Z7ig/I=
|
github.com/git-pkgs/pom v0.1.4/go.mod h1:ufdMBe1lKzqOeP9IUb9NPZ458xKV8E8NvuyBMxOfwIk=
|
||||||
github.com/git-pkgs/registries v0.4.0 h1:GO7fQ8/jot0ulSQHBdxLSNSX/p8eB3gEXWO+98fmoEo=
|
github.com/git-pkgs/purl v0.1.12 h1:qCskrEU1LWQhCkIVZd992W5++Bsxazvx2Cx1/65qCvU=
|
||||||
github.com/git-pkgs/registries v0.4.0/go.mod h1:49UCPFWQmwNV7rBEr9TrTDWKR7vYxFcxp3VfdkeFbdE=
|
github.com/git-pkgs/purl v0.1.12/go.mod h1:ofp4mHsR0cUeVONQaf33n6Wxg2QTEvtUdRfCedI8ouA=
|
||||||
github.com/git-pkgs/spdx v0.1.2 h1:wHSK+CqFsO5N7yDTPvxDmer5LgNEa7vAsiZhi5Aci0A=
|
github.com/git-pkgs/registries v0.6.1 h1:xZfVZQmffIfdeJthn5o2EozbVJ6gBeImYwKQnfdKUfU=
|
||||||
github.com/git-pkgs/spdx v0.1.2/go.mod h1:V98MgZapNgYw54/pdGR82d7RU93qzJoybahbpZqTfw8=
|
github.com/git-pkgs/registries v0.6.1/go.mod h1:a3BP/56VW3O/CFRqiJCtSy+OqRrSH25wF1PWHP76ka0=
|
||||||
github.com/git-pkgs/vers v0.2.4 h1:Zr3jR/Xf1i/6cvBaJKPxhCwjzqz7uvYHE0Fhid/GPBk=
|
github.com/git-pkgs/spdx v0.1.4 h1:eQ0waEV3uUeItpWAOvdN1K1rL9hTgsU7fF74r1mDXMs=
|
||||||
github.com/git-pkgs/vers v0.2.4/go.mod h1:biTbSQK1qdbrsxDEKnqe3Jzclxz8vW6uDcwKjfUGcOo=
|
github.com/git-pkgs/spdx v0.1.4/go.mod h1:cqRoZcvl530s/W+oGNvwjt4ODN8T1W6D/20MUZEFdto=
|
||||||
github.com/git-pkgs/vulns v0.1.3 h1:Q9GixxhAYpP5vVDetKNMACHxGnWwB8aE5c9kbE8xxqU=
|
github.com/git-pkgs/vers v0.2.6 h1:IelZd7BP/JhzTloUTDY67nehUgoYva3g9viqAMCHJg8=
|
||||||
github.com/git-pkgs/vulns v0.1.3/go.mod h1:/PVy7S1oZNVF9X8yVOZ9SX5MFpyVWCtLnIX0kAfPjY0=
|
github.com/git-pkgs/vers v0.2.6/go.mod h1:biTbSQK1qdbrsxDEKnqe3Jzclxz8vW6uDcwKjfUGcOo=
|
||||||
github.com/github/go-spdx/v2 v2.4.0 h1:+4IwVwJJbm3rzvrQ6P1nI9BDMcy3la4RchRy5uehV/M=
|
github.com/git-pkgs/vulns v0.1.5 h1:mtX88/27toFl+B95kaH5QbAdOCQ3YIDGjJrlrrnqQTE=
|
||||||
github.com/github/go-spdx/v2 v2.4.0/go.mod h1:/5rwgS0txhGtRdUZwc02bTglzg6HK3FfuEbECKlK2Sg=
|
github.com/git-pkgs/vulns v0.1.5/go.mod h1:bZFikfrR/5gC0ZMwXh7qcEu2gpKfXMBhVsy4kF12Ae0=
|
||||||
|
github.com/github/go-spdx/v2 v2.7.0 h1:GzfXx4wFdlilARxmFRXW/mgUy3A4vSqZocCMFV6XFdQ=
|
||||||
|
github.com/github/go-spdx/v2 v2.7.0/go.mod h1:Ftc45YYG1WzpzwEPKRVm9Jv8vDqOrN4gWoCkK+bHer0=
|
||||||
github.com/go-chi/chi/v5 v5.2.5 h1:Eg4myHZBjyvJmAFjFvWgrqDTXFyOzjj7YIm3L3mu6Ug=
|
github.com/go-chi/chi/v5 v5.2.5 h1:Eg4myHZBjyvJmAFjFvWgrqDTXFyOzjj7YIm3L3mu6Ug=
|
||||||
github.com/go-chi/chi/v5 v5.2.5/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0=
|
github.com/go-chi/chi/v5 v5.2.5/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0=
|
||||||
github.com/go-critic/go-critic v0.14.3 h1:5R1qH2iFeo4I/RJU8vTezdqs08Egi4u5p6vOESA0pog=
|
github.com/go-critic/go-critic v0.14.3 h1:5R1qH2iFeo4I/RJU8vTezdqs08Egi4u5p6vOESA0pog=
|
||||||
|
|
@ -299,6 +329,8 @@ github.com/godoc-lint/godoc-lint v0.11.2 h1:Bp0FkJWoSdNsBikdNgIcgtaoo+xz6I/Y9s5W
|
||||||
github.com/godoc-lint/godoc-lint v0.11.2/go.mod h1:iVpGdL1JCikNH2gGeAn3Hh+AgN5Gx/I/cxV+91L41jo=
|
github.com/godoc-lint/godoc-lint v0.11.2/go.mod h1:iVpGdL1JCikNH2gGeAn3Hh+AgN5Gx/I/cxV+91L41jo=
|
||||||
github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw=
|
github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw=
|
||||||
github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0=
|
github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0=
|
||||||
|
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
|
||||||
|
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
|
||||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||||
github.com/golangci/asciicheck v0.5.0 h1:jczN/BorERZwK8oiFBOGvlGPknhvq0bjnysTj4nUfo0=
|
github.com/golangci/asciicheck v0.5.0 h1:jczN/BorERZwK8oiFBOGvlGPknhvq0bjnysTj4nUfo0=
|
||||||
|
|
@ -390,6 +422,8 @@ github.com/julz/importas v0.2.0 h1:y+MJN/UdL63QbFJHws9BVC5RpA2iq0kpjrFajTGivjQ=
|
||||||
github.com/julz/importas v0.2.0/go.mod h1:pThlt589EnCYtMnmhmRYY/qn9lCf/frPOK+WMx3xiJY=
|
github.com/julz/importas v0.2.0/go.mod h1:pThlt589EnCYtMnmhmRYY/qn9lCf/frPOK+WMx3xiJY=
|
||||||
github.com/karamaru-alpha/copyloopvar v1.2.2 h1:yfNQvP9YaGQR7VaWLYcfZUlRP2eo2vhExWKxD/fP6q0=
|
github.com/karamaru-alpha/copyloopvar v1.2.2 h1:yfNQvP9YaGQR7VaWLYcfZUlRP2eo2vhExWKxD/fP6q0=
|
||||||
github.com/karamaru-alpha/copyloopvar v1.2.2/go.mod h1:oY4rGZqZ879JkJMtX3RRkcXRkmUvH0x35ykgaKgsgJY=
|
github.com/karamaru-alpha/copyloopvar v1.2.2/go.mod h1:oY4rGZqZ879JkJMtX3RRkcXRkmUvH0x35ykgaKgsgJY=
|
||||||
|
github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRtuthU=
|
||||||
|
github.com/keybase/go-keychain v0.0.1/go.mod h1:PdEILRW3i9D8JcdM+FmY6RwkHGnhHxXwkPPMeUgOK1k=
|
||||||
github.com/kisielk/errcheck v1.9.0 h1:9xt1zI9EBfcYBvdU1nVrzMzzUPUtPKs9bVSIM3TAb3M=
|
github.com/kisielk/errcheck v1.9.0 h1:9xt1zI9EBfcYBvdU1nVrzMzzUPUtPKs9bVSIM3TAb3M=
|
||||||
github.com/kisielk/errcheck v1.9.0/go.mod h1:kQxWMMVZgIkDq7U8xtG/n2juOjbLgZtedi0D+/VL/i8=
|
github.com/kisielk/errcheck v1.9.0/go.mod h1:kQxWMMVZgIkDq7U8xtG/n2juOjbLgZtedi0D+/VL/i8=
|
||||||
github.com/kkHAIKE/contextcheck v1.1.6 h1:7HIyRcnyzxL9Lz06NGhiKvenXq7Zw6Q0UQu/ttjfJCE=
|
github.com/kkHAIKE/contextcheck v1.1.6 h1:7HIyRcnyzxL9Lz06NGhiKvenXq7Zw6Q0UQu/ttjfJCE=
|
||||||
|
|
@ -426,8 +460,8 @@ github.com/ldez/usetesting v0.5.0/go.mod h1:Spnb4Qppf8JTuRgblLrEWb7IE6rDmUpGvxY3
|
||||||
github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY=
|
github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY=
|
||||||
github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA=
|
github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA=
|
||||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
github.com/lib/pq v1.12.0 h1:mC1zeiNamwKBecjHarAr26c/+d8V5w/u4J0I/yASbJo=
|
github.com/lib/pq v1.12.3 h1:tTWxr2YLKwIvK90ZXEw8GP7UFHtcbTtty8zsI+YjrfQ=
|
||||||
github.com/lib/pq v1.12.0/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA=
|
github.com/lib/pq v1.12.3/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA=
|
||||||
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
|
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
|
||||||
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
|
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
|
||||||
github.com/macabu/inamedparam v0.2.0 h1:VyPYpOc10nkhI2qeNUdh3Zket4fcZjEWe35poddBCpE=
|
github.com/macabu/inamedparam v0.2.0 h1:VyPYpOc10nkhI2qeNUdh3Zket4fcZjEWe35poddBCpE=
|
||||||
|
|
@ -495,6 +529,8 @@ github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJ
|
||||||
github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs=
|
github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs=
|
||||||
github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo=
|
github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo=
|
||||||
github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc=
|
github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc=
|
||||||
|
github.com/package-url/packageurl-go v0.1.6 h1:YO3p6u1XmCUliivUg/qWphaY8vI6hxSnnPv7Bfg3m5M=
|
||||||
|
github.com/package-url/packageurl-go v0.1.6/go.mod h1:nKAWB8E6uk1MHqiS/lQb9pYBGH2+mdJ2PJc2s50dQY0=
|
||||||
github.com/pandatix/go-cvss v0.6.2 h1:TFiHlzUkT67s6UkelHmK6s1INKVUG7nlKYiWWDTITGI=
|
github.com/pandatix/go-cvss v0.6.2 h1:TFiHlzUkT67s6UkelHmK6s1INKVUG7nlKYiWWDTITGI=
|
||||||
github.com/pandatix/go-cvss v0.6.2/go.mod h1:jDXYlQBZrc8nvrMUVVvTG8PhmuShOnKrxP53nOFkt8Q=
|
github.com/pandatix/go-cvss v0.6.2/go.mod h1:jDXYlQBZrc8nvrMUVVvTG8PhmuShOnKrxP53nOFkt8Q=
|
||||||
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
|
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
|
||||||
|
|
@ -503,6 +539,8 @@ github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0
|
||||||
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
||||||
github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea h1:sKwxy1H95npauwu8vtF95vG/syrL0p8fSZo/XlDg5gk=
|
github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea h1:sKwxy1H95npauwu8vtF95vG/syrL0p8fSZo/XlDg5gk=
|
||||||
github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea/go.mod h1:1VcHEd3ro4QMoHfiNl/j7Jkln9+KQuorp0PItHMJYNg=
|
github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea/go.mod h1:1VcHEd3ro4QMoHfiNl/j7Jkln9+KQuorp0PItHMJYNg=
|
||||||
|
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
|
||||||
|
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
|
||||||
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo=
|
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo=
|
||||||
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8=
|
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
|
|
@ -568,6 +606,8 @@ github.com/sonatard/noctx v0.4.0 h1:7MC/5Gg4SQ4lhLYR6mvOP6mQVSxCrdyiExo7atBs27o=
|
||||||
github.com/sonatard/noctx v0.4.0/go.mod h1:64XdbzFb18XL4LporKXp8poqZtPKbCrqQ402CV+kJas=
|
github.com/sonatard/noctx v0.4.0/go.mod h1:64XdbzFb18XL4LporKXp8poqZtPKbCrqQ402CV+kJas=
|
||||||
github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0=
|
github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0=
|
||||||
github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs=
|
github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs=
|
||||||
|
github.com/spdx/tools-golang v0.5.7 h1:+sWcKGnhwp3vLdMqPcLdA6QK679vd86cK9hQWH3AwCg=
|
||||||
|
github.com/spdx/tools-golang v0.5.7/go.mod h1:jg7w0LOpoNAw6OxKEzCoqPC2GCTj45LyTlVmXubDsYw=
|
||||||
github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
|
github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
|
||||||
github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
|
github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
|
||||||
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
|
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
|
||||||
|
|
@ -606,6 +646,8 @@ github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA
|
||||||
github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0=
|
github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0=
|
||||||
github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag=
|
github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag=
|
||||||
github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY=
|
github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY=
|
||||||
|
github.com/terminalstatic/go-xsd-validate v0.1.6 h1:TenYeQ3eY631qNi1/cTmLH/s2slHPRKTTHT+XSHkepo=
|
||||||
|
github.com/terminalstatic/go-xsd-validate v0.1.6/go.mod h1:18lsvYFofBflqCrvo1umpABZ99+GneNTw2kEEc8UPJw=
|
||||||
github.com/tetafro/godot v1.5.4 h1:u1ww+gqpRLiIA16yF2PV1CV1n/X3zhyezbNXC3E14Sg=
|
github.com/tetafro/godot v1.5.4 h1:u1ww+gqpRLiIA16yF2PV1CV1n/X3zhyezbNXC3E14Sg=
|
||||||
github.com/tetafro/godot v1.5.4/go.mod h1:eOkMrVQurDui411nBY2FA05EYH01r14LuWY/NrVDVcU=
|
github.com/tetafro/godot v1.5.4/go.mod h1:eOkMrVQurDui411nBY2FA05EYH01r14LuWY/NrVDVcU=
|
||||||
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 h1:9LPGD+jzxMlnk5r6+hJnar67cgpDIz/iyD+rfl5r2Vk=
|
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 h1:9LPGD+jzxMlnk5r6+hJnar67cgpDIz/iyD+rfl5r2Vk=
|
||||||
|
|
@ -628,6 +670,12 @@ github.com/uudashr/gocognit v1.2.0 h1:3BU9aMr1xbhPlvJLSydKwdLN3tEUUrzPSSM8S4hDYR
|
||||||
github.com/uudashr/gocognit v1.2.0/go.mod h1:k/DdKPI6XBZO1q7HgoV2juESI2/Ofj9AcHPZhBBdrTU=
|
github.com/uudashr/gocognit v1.2.0/go.mod h1:k/DdKPI6XBZO1q7HgoV2juESI2/Ofj9AcHPZhBBdrTU=
|
||||||
github.com/uudashr/iface v1.4.1 h1:J16Xl1wyNX9ofhpHmQ9h9gk5rnv2A6lX/2+APLTo0zU=
|
github.com/uudashr/iface v1.4.1 h1:J16Xl1wyNX9ofhpHmQ9h9gk5rnv2A6lX/2+APLTo0zU=
|
||||||
github.com/uudashr/iface v1.4.1/go.mod h1:pbeBPlbuU2qkNDn0mmfrxP2X+wjPMIQAy+r1MBXSXtg=
|
github.com/uudashr/iface v1.4.1/go.mod h1:pbeBPlbuU2qkNDn0mmfrxP2X+wjPMIQAy+r1MBXSXtg=
|
||||||
|
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
|
||||||
|
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||||
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
|
||||||
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
|
||||||
|
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
|
||||||
|
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
||||||
github.com/xen0n/gosmopolitan v1.3.0 h1:zAZI1zefvo7gcpbCOrPSHJZJYA9ZgLfJqtKzZ5pHqQM=
|
github.com/xen0n/gosmopolitan v1.3.0 h1:zAZI1zefvo7gcpbCOrPSHJZJYA9ZgLfJqtKzZ5pHqQM=
|
||||||
github.com/xen0n/gosmopolitan v1.3.0/go.mod h1:rckfr5T6o4lBtM1ga7mLGKZmLxswUoH1zxHgNXOsEt4=
|
github.com/xen0n/gosmopolitan v1.3.0/go.mod h1:rckfr5T6o4lBtM1ga7mLGKZmLxswUoH1zxHgNXOsEt4=
|
||||||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
|
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
|
||||||
|
|
@ -755,6 +803,7 @@ golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||||
golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/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-20220520151302-bc2c85ada10a/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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.5.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.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
|
@ -835,10 +884,10 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
honnef.co/go/tools v0.7.0 h1:w6WUp1VbkqPEgLz4rkBzH/CSU6HkoqNLp6GstyTx3lU=
|
honnef.co/go/tools v0.7.0 h1:w6WUp1VbkqPEgLz4rkBzH/CSU6HkoqNLp6GstyTx3lU=
|
||||||
honnef.co/go/tools v0.7.0/go.mod h1:pm29oPxeP3P82ISxZDgIYeOaf9ta6Pi0EWvCFoLG2vc=
|
honnef.co/go/tools v0.7.0/go.mod h1:pm29oPxeP3P82ISxZDgIYeOaf9ta6Pi0EWvCFoLG2vc=
|
||||||
modernc.org/cc/v4 v4.27.1 h1:9W30zRlYrefrDV2JE2O8VDtJ1yPGownxciz5rrbQZis=
|
modernc.org/cc/v4 v4.28.2 h1:3tQ0lf2ADtoby2EtSP+J7IE2SHwEJdP8ioR59wx7XpY=
|
||||||
modernc.org/cc/v4 v4.27.1/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0=
|
modernc.org/cc/v4 v4.28.2/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI=
|
||||||
modernc.org/ccgo/v4 v4.32.0 h1:hjG66bI/kqIPX1b2yT6fr/jt+QedtP2fqojG2VrFuVw=
|
modernc.org/ccgo/v4 v4.34.0 h1:yRLPFZieg532OT4rp4JFNIVcquwalMX26G95WQDqwCQ=
|
||||||
modernc.org/ccgo/v4 v4.32.0/go.mod h1:6F08EBCx5uQc38kMGl+0Nm0oWczoo1c7cgpzEry7Uc0=
|
modernc.org/ccgo/v4 v4.34.0/go.mod h1:AS5WYMyBakQ+fhsHhtP8mWB82KTGPkNNJDGfGQCe0/A=
|
||||||
modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM=
|
modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM=
|
||||||
modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU=
|
modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU=
|
||||||
modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
|
modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
|
||||||
|
|
@ -847,18 +896,18 @@ modernc.org/gc/v3 v3.1.2 h1:ZtDCnhonXSZexk/AYsegNRV1lJGgaNZJuKjJSWKyEqo=
|
||||||
modernc.org/gc/v3 v3.1.2/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=
|
modernc.org/gc/v3 v3.1.2/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=
|
||||||
modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
|
modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
|
||||||
modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
|
modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
|
||||||
modernc.org/libc v1.70.0 h1:U58NawXqXbgpZ/dcdS9kMshu08aiA6b7gusEusqzNkw=
|
modernc.org/libc v1.72.3 h1:ZnDF4tXn4NBXFutMMQC4vtbTFSXhhKzR73fv0beZEAU=
|
||||||
modernc.org/libc v1.70.0/go.mod h1:OVmxFGP1CI/Z4L3E0Q3Mf1PDE0BucwMkcXjjLntvHJo=
|
modernc.org/libc v1.72.3/go.mod h1:dn0dZNnnn1clLyvRxLxYExxiKRZIRENOfqQ8XEeg4Qs=
|
||||||
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
||||||
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
||||||
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
|
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
|
||||||
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
|
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
|
||||||
modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8=
|
modernc.org/opt v0.2.0 h1:tGyef5ApycA7FSEOMraay9SaTk5zmbx7Tu+cJs4QKZg=
|
||||||
modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
|
modernc.org/opt v0.2.0/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
|
||||||
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
|
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
|
||||||
modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
|
modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
|
||||||
modernc.org/sqlite v1.47.0 h1:R1XyaNpoW4Et9yly+I2EeX7pBza/w+pmYee/0HJDyKk=
|
modernc.org/sqlite v1.50.1 h1:l+cQvn0sd0zJJtfygGHuQJ5AjlrwXmWPw4KP3ZMwr9w=
|
||||||
modernc.org/sqlite v1.47.0/go.mod h1:hWjRO6Tj/5Ik8ieqxQybiEOUXy0NJFNp2tpvVpKlvig=
|
modernc.org/sqlite v1.50.1/go.mod h1:tcNzv5p84E0skkmJn038y+hWJbLQXQqEnQfeh5r2JLM=
|
||||||
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
|
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
|
||||||
modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
|
modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
|
||||||
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
|
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
|
||||||
|
|
@ -867,5 +916,5 @@ mvdan.cc/gofumpt v0.9.2 h1:zsEMWL8SVKGHNztrx6uZrXdp7AX8r421Vvp23sz7ik4=
|
||||||
mvdan.cc/gofumpt v0.9.2/go.mod h1:iB7Hn+ai8lPvofHd9ZFGVg2GOr8sBUw1QUWjNbmIL/s=
|
mvdan.cc/gofumpt v0.9.2/go.mod h1:iB7Hn+ai8lPvofHd9ZFGVg2GOr8sBUw1QUWjNbmIL/s=
|
||||||
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 h1:ssMzja7PDPJV8FStj7hq9IKiuiKhgz9ErWw+m68e7DI=
|
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 h1:ssMzja7PDPJV8FStj7hq9IKiuiKhgz9ErWw+m68e7DI=
|
||||||
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15/go.mod h1:4M5MMXl2kW6fivUT6yRGpLLPNfuGtU2Z0cPvFquGDYU=
|
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15/go.mod h1:4M5MMXl2kW6fivUT6yRGpLLPNfuGtU2Z0cPvFquGDYU=
|
||||||
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
|
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
|
||||||
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
|
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
|
||||||
|
|
|
||||||
78
internal/config/cargo/cargo.go
Normal file
78
internal/config/cargo/cargo.go
Normal file
|
|
@ -0,0 +1,78 @@
|
||||||
|
package cargo
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"net/url"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Config configures routes
|
||||||
|
type Config struct {
|
||||||
|
IncludeDefault bool `json:"include_default" yaml:"include_default"`
|
||||||
|
Route []RouteConfig `json:"route" yaml:"route"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// RouteConfig configures a route
|
||||||
|
type RouteConfig struct {
|
||||||
|
Path string `json:"path" yaml:"path"`
|
||||||
|
Upstream []UpstreamConfig `json:"upstream" yaml:"upstream"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpstreamConfig configures an upstream (source)
|
||||||
|
type UpstreamConfig struct {
|
||||||
|
Name string `json:"name" yaml:"name"`
|
||||||
|
Index string `json:"index" yaml:"index"`
|
||||||
|
Crates string `json:"crates" yaml:"crates"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// RouteDefault is the default route
|
||||||
|
var RouteDefault = RouteConfig{
|
||||||
|
Path: "/cargo",
|
||||||
|
Upstream: []UpstreamConfig{
|
||||||
|
{
|
||||||
|
Name: "crates.io",
|
||||||
|
Index: "https://index.crates.io",
|
||||||
|
Crates: "https://static.crates.io/crates",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Config) Validate() error {
|
||||||
|
for _, route := range c.Route {
|
||||||
|
if err := route.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *RouteConfig) Validate() error {
|
||||||
|
// TODO: validate Path
|
||||||
|
|
||||||
|
if len(r.Upstream) == 0 {
|
||||||
|
return fmt.Errorf("cargo route %q does not have any upstreams", r.Path)
|
||||||
|
}
|
||||||
|
if len(r.Upstream) > 1 {
|
||||||
|
return fmt.Errorf("cargo route %q has multiple upstreams; this is not yet supported", r.Path)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, upstream := range r.Upstream {
|
||||||
|
if err := upstream.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *UpstreamConfig) Validate() error {
|
||||||
|
if _, err := url.Parse(u.Index); err != nil {
|
||||||
|
return fmt.Errorf("cargo upstream index %q is not a valid URL", u.Index)
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := url.Parse(u.Crates); err != nil {
|
||||||
|
return fmt.Errorf("cargo upstream crates %q is not a valid URL", u.Crates)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -51,11 +51,15 @@ import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/git-pkgs/proxy/internal/config/cargo"
|
||||||
|
"github.com/git-pkgs/proxy/internal/config/debian"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -81,8 +85,31 @@ type Config struct {
|
||||||
// Upstream configures upstream registry URLs (optional overrides).
|
// Upstream configures upstream registry URLs (optional overrides).
|
||||||
Upstream UpstreamConfig `json:"upstream" yaml:"upstream"`
|
Upstream UpstreamConfig `json:"upstream" yaml:"upstream"`
|
||||||
|
|
||||||
|
// Ecosystem configures ecosystem routes and upstreams
|
||||||
|
Ecosystem EcosystemConfig `json:"ecosystem" yaml:"ecosystem"`
|
||||||
|
|
||||||
// Cooldown configures version age filtering to mitigate supply chain attacks.
|
// Cooldown configures version age filtering to mitigate supply chain attacks.
|
||||||
Cooldown CooldownConfig `json:"cooldown" yaml:"cooldown"`
|
Cooldown CooldownConfig `json:"cooldown" yaml:"cooldown"`
|
||||||
|
|
||||||
|
// CacheMetadata enables caching of upstream metadata responses for offline fallback.
|
||||||
|
// When enabled, metadata is stored in the database and storage backend.
|
||||||
|
// The mirror command always enables this regardless of this setting.
|
||||||
|
CacheMetadata bool `json:"cache_metadata" yaml:"cache_metadata"`
|
||||||
|
|
||||||
|
// MetadataTTL is how long cached metadata is considered fresh before
|
||||||
|
// revalidating with upstream. Uses Go duration syntax (e.g. "5m", "1h").
|
||||||
|
// Default: "5m". Set to "0" to always revalidate.
|
||||||
|
MetadataTTL string `json:"metadata_ttl" yaml:"metadata_ttl"`
|
||||||
|
|
||||||
|
// MirrorAPI enables the /api/mirror endpoints for starting mirror jobs via HTTP.
|
||||||
|
// Disabled by default to prevent unauthenticated users from triggering downloads.
|
||||||
|
MirrorAPI bool `json:"mirror_api" yaml:"mirror_api"`
|
||||||
|
|
||||||
|
// Gradle configures Gradle HttpBuildCache behavior.
|
||||||
|
Gradle GradleConfig `json:"gradle" yaml:"gradle"`
|
||||||
|
|
||||||
|
// Health configures the /health endpoint behavior.
|
||||||
|
Health HealthConfig `json:"health" yaml:"health"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CooldownConfig configures version cooldown periods.
|
// CooldownConfig configures version cooldown periods.
|
||||||
|
|
@ -118,6 +145,57 @@ type StorageConfig struct {
|
||||||
// When exceeded, least recently used artifacts are evicted.
|
// When exceeded, least recently used artifacts are evicted.
|
||||||
// Empty or "0" means unlimited.
|
// Empty or "0" means unlimited.
|
||||||
MaxSize string `json:"max_size" yaml:"max_size"`
|
MaxSize string `json:"max_size" yaml:"max_size"`
|
||||||
|
|
||||||
|
// DirectServe enables redirecting cached artifact downloads to presigned
|
||||||
|
// storage URLs (HTTP 302) instead of streaming bytes through the proxy.
|
||||||
|
// Only effective for backends that support URL signing (S3, Azure).
|
||||||
|
DirectServe bool `json:"direct_serve" yaml:"direct_serve"`
|
||||||
|
|
||||||
|
// DirectServeTTL is how long presigned URLs remain valid.
|
||||||
|
// Uses Go duration syntax (e.g. "5m", "1h"). Default: "15m".
|
||||||
|
DirectServeTTL string `json:"direct_serve_ttl" yaml:"direct_serve_ttl"`
|
||||||
|
|
||||||
|
// DirectServeBaseURL overrides the scheme and host of presigned URLs
|
||||||
|
// before returning them to clients. Useful when the proxy reaches
|
||||||
|
// storage at an internal address (e.g. 127.0.0.1 or a Docker hostname)
|
||||||
|
// but clients must use a public one.
|
||||||
|
DirectServeBaseURL string `json:"direct_serve_base_url" yaml:"direct_serve_base_url"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GradleConfig configures Gradle-specific features.
|
||||||
|
type GradleConfig struct {
|
||||||
|
// BuildCache configures the /gradle HttpBuildCache endpoint.
|
||||||
|
BuildCache GradleBuildCacheConfig `json:"build_cache" yaml:"build_cache"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GradleBuildCacheConfig configures Gradle HttpBuildCache safeguards.
|
||||||
|
type GradleBuildCacheConfig struct {
|
||||||
|
// ReadOnly disables PUT uploads and keeps cache reads (GET/HEAD) enabled.
|
||||||
|
ReadOnly bool `json:"read_only" yaml:"read_only"`
|
||||||
|
|
||||||
|
// MaxUploadSize caps a single PUT body size (e.g., "100MB"). Must be > 0.
|
||||||
|
// Default: "100MB".
|
||||||
|
MaxUploadSize string `json:"max_upload_size" yaml:"max_upload_size"`
|
||||||
|
|
||||||
|
// MaxAge evicts entries older than this duration (e.g., "24h", "7d").
|
||||||
|
// Empty or "0" disables age-based eviction.
|
||||||
|
MaxAge string `json:"max_age" yaml:"max_age"`
|
||||||
|
|
||||||
|
// MaxSize evicts oldest entries until total Gradle cache size is <= MaxSize.
|
||||||
|
// Empty or "0" disables size-based eviction.
|
||||||
|
MaxSize string `json:"max_size" yaml:"max_size"`
|
||||||
|
|
||||||
|
// SweepInterval controls periodic eviction frequency.
|
||||||
|
// Default: "10m".
|
||||||
|
SweepInterval string `json:"sweep_interval" yaml:"sweep_interval"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// HealthConfig configures the /health endpoint.
|
||||||
|
type HealthConfig struct {
|
||||||
|
// StorageProbeInterval is the minimum time between storage backend probes.
|
||||||
|
// Uses Go duration syntax (e.g. "30s", "1m"). Default: "30s".
|
||||||
|
// Set to "0" to probe on every /health request (useful for low-traffic deployments).
|
||||||
|
StorageProbeInterval string `json:"storage_probe_interval" yaml:"storage_probe_interval"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DatabaseConfig configures the cache database.
|
// DatabaseConfig configures the cache database.
|
||||||
|
|
@ -148,6 +226,15 @@ type UpstreamConfig struct {
|
||||||
// Default: https://registry.npmjs.org
|
// Default: https://registry.npmjs.org
|
||||||
NPM string `json:"npm" yaml:"npm"`
|
NPM string `json:"npm" yaml:"npm"`
|
||||||
|
|
||||||
|
// Maven is the upstream Maven repository URL.
|
||||||
|
// Default: https://repo1.maven.org/maven2
|
||||||
|
Maven string `json:"maven" yaml:"maven"`
|
||||||
|
|
||||||
|
// GradlePluginPortal is the upstream Gradle Plugin Portal Maven URL.
|
||||||
|
// Used to resolve Gradle plugin marker artifacts.
|
||||||
|
// Default: https://plugins.gradle.org/m2
|
||||||
|
GradlePluginPortal string `json:"gradle_plugin_portal" yaml:"gradle_plugin_portal"`
|
||||||
|
|
||||||
// Cargo is the upstream cargo index URL.
|
// Cargo is the upstream cargo index URL.
|
||||||
// Default: https://index.crates.io
|
// Default: https://index.crates.io
|
||||||
Cargo string `json:"cargo" yaml:"cargo"`
|
Cargo string `json:"cargo" yaml:"cargo"`
|
||||||
|
|
@ -224,10 +311,29 @@ func Default() *Config {
|
||||||
Level: "info",
|
Level: "info",
|
||||||
Format: "text",
|
Format: "text",
|
||||||
},
|
},
|
||||||
|
Ecosystem: EcosystemConfig{
|
||||||
|
Cargo: cargo.Config{
|
||||||
|
IncludeDefault: true,
|
||||||
|
},
|
||||||
|
Debian: debian.Config{
|
||||||
|
IncludeDefault: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
Upstream: UpstreamConfig{
|
Upstream: UpstreamConfig{
|
||||||
NPM: "https://registry.npmjs.org",
|
NPM: "https://registry.npmjs.org",
|
||||||
Cargo: "https://index.crates.io",
|
Maven: "https://repo1.maven.org/maven2",
|
||||||
CargoDownload: "https://static.crates.io/crates",
|
GradlePluginPortal: "https://plugins.gradle.org/m2",
|
||||||
|
Cargo: "https://index.crates.io",
|
||||||
|
CargoDownload: "https://static.crates.io/crates",
|
||||||
|
},
|
||||||
|
Gradle: GradleConfig{
|
||||||
|
BuildCache: GradleBuildCacheConfig{
|
||||||
|
ReadOnly: false,
|
||||||
|
MaxUploadSize: defaultGradleMaxUploadSizeStr,
|
||||||
|
MaxAge: "168h",
|
||||||
|
MaxSize: "",
|
||||||
|
SweepInterval: defaultGradleSweepIntervalStr,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -272,6 +378,7 @@ func Load(path string) (*Config, error) {
|
||||||
// - PROXY_DATABASE_PATH
|
// - PROXY_DATABASE_PATH
|
||||||
// - PROXY_LOG_LEVEL
|
// - PROXY_LOG_LEVEL
|
||||||
// - PROXY_LOG_FORMAT
|
// - PROXY_LOG_FORMAT
|
||||||
|
// - PROXY_HEALTH_STORAGE_PROBE_INTERVAL
|
||||||
func (c *Config) LoadFromEnv() {
|
func (c *Config) LoadFromEnv() {
|
||||||
if v := os.Getenv("PROXY_LISTEN"); v != "" {
|
if v := os.Getenv("PROXY_LISTEN"); v != "" {
|
||||||
c.Listen = v
|
c.Listen = v
|
||||||
|
|
@ -288,6 +395,15 @@ func (c *Config) LoadFromEnv() {
|
||||||
if v := os.Getenv("PROXY_STORAGE_MAX_SIZE"); v != "" {
|
if v := os.Getenv("PROXY_STORAGE_MAX_SIZE"); v != "" {
|
||||||
c.Storage.MaxSize = v
|
c.Storage.MaxSize = v
|
||||||
}
|
}
|
||||||
|
if v := os.Getenv("PROXY_STORAGE_DIRECT_SERVE"); v != "" {
|
||||||
|
c.Storage.DirectServe = envBool(v)
|
||||||
|
}
|
||||||
|
if v := os.Getenv("PROXY_STORAGE_DIRECT_SERVE_TTL"); v != "" {
|
||||||
|
c.Storage.DirectServeTTL = v
|
||||||
|
}
|
||||||
|
if v := os.Getenv("PROXY_STORAGE_DIRECT_SERVE_BASE_URL"); v != "" {
|
||||||
|
c.Storage.DirectServeBaseURL = v
|
||||||
|
}
|
||||||
if v := os.Getenv("PROXY_DATABASE_DRIVER"); v != "" {
|
if v := os.Getenv("PROXY_DATABASE_DRIVER"); v != "" {
|
||||||
c.Database.Driver = v
|
c.Database.Driver = v
|
||||||
}
|
}
|
||||||
|
|
@ -303,13 +419,54 @@ func (c *Config) LoadFromEnv() {
|
||||||
if v := os.Getenv("PROXY_LOG_FORMAT"); v != "" {
|
if v := os.Getenv("PROXY_LOG_FORMAT"); v != "" {
|
||||||
c.Log.Format = v
|
c.Log.Format = v
|
||||||
}
|
}
|
||||||
|
if v := os.Getenv("PROXY_UPSTREAM_MAVEN"); v != "" {
|
||||||
|
c.Upstream.Maven = v
|
||||||
|
}
|
||||||
|
if v := os.Getenv("PROXY_UPSTREAM_GRADLE_PLUGIN_PORTAL"); v != "" {
|
||||||
|
c.Upstream.GradlePluginPortal = v
|
||||||
|
}
|
||||||
if v := os.Getenv("PROXY_COOLDOWN_DEFAULT"); v != "" {
|
if v := os.Getenv("PROXY_COOLDOWN_DEFAULT"); v != "" {
|
||||||
c.Cooldown.Default = v
|
c.Cooldown.Default = v
|
||||||
}
|
}
|
||||||
|
if v := os.Getenv("PROXY_CACHE_METADATA"); v != "" {
|
||||||
|
c.CacheMetadata = envBool(v)
|
||||||
|
}
|
||||||
|
if v := os.Getenv("PROXY_MIRROR_API"); v != "" {
|
||||||
|
c.MirrorAPI = envBool(v)
|
||||||
|
}
|
||||||
|
if v := os.Getenv("PROXY_METADATA_TTL"); v != "" {
|
||||||
|
c.MetadataTTL = v
|
||||||
|
}
|
||||||
|
if v := os.Getenv("PROXY_GRADLE_BUILD_CACHE_READ_ONLY"); v != "" {
|
||||||
|
c.Gradle.BuildCache.ReadOnly = v == "true" || v == "1"
|
||||||
|
}
|
||||||
|
if v := os.Getenv("PROXY_GRADLE_BUILD_CACHE_MAX_UPLOAD_SIZE"); v != "" {
|
||||||
|
c.Gradle.BuildCache.MaxUploadSize = v
|
||||||
|
}
|
||||||
|
if v := os.Getenv("PROXY_GRADLE_BUILD_CACHE_MAX_AGE"); v != "" {
|
||||||
|
c.Gradle.BuildCache.MaxAge = v
|
||||||
|
}
|
||||||
|
if v := os.Getenv("PROXY_GRADLE_BUILD_CACHE_MAX_SIZE"); v != "" {
|
||||||
|
c.Gradle.BuildCache.MaxSize = v
|
||||||
|
}
|
||||||
|
if v := os.Getenv("PROXY_GRADLE_BUILD_CACHE_SWEEP_INTERVAL"); v != "" {
|
||||||
|
c.Gradle.BuildCache.SweepInterval = v
|
||||||
|
}
|
||||||
|
if v := os.Getenv("PROXY_HEALTH_STORAGE_PROBE_INTERVAL"); v != "" {
|
||||||
|
c.Health.StorageProbeInterval = v
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate checks the configuration for errors.
|
// Validate checks the configuration for errors.
|
||||||
func (c *Config) Validate() error {
|
func (c *Config) Validate() error {
|
||||||
|
// finalize the configuration by injecting default routes if requested
|
||||||
|
if c.Ecosystem.Cargo.IncludeDefault {
|
||||||
|
c.Ecosystem.Cargo.Route = append(c.Ecosystem.Cargo.Route, cargo.RouteDefault)
|
||||||
|
}
|
||||||
|
if c.Ecosystem.Debian.IncludeDefault {
|
||||||
|
c.Ecosystem.Debian.Route = append(c.Ecosystem.Debian.Route, debian.RouteDefault)
|
||||||
|
}
|
||||||
|
|
||||||
if c.Listen == "" {
|
if c.Listen == "" {
|
||||||
return fmt.Errorf("listen address is required")
|
return fmt.Errorf("listen address is required")
|
||||||
}
|
}
|
||||||
|
|
@ -355,9 +512,141 @@ func (c *Config) Validate() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate direct serve TTL if specified
|
||||||
|
if c.Storage.DirectServeTTL != "" {
|
||||||
|
if _, err := time.ParseDuration(c.Storage.DirectServeTTL); err != nil {
|
||||||
|
return fmt.Errorf("invalid storage.direct_serve_ttl %q: %w", c.Storage.DirectServeTTL, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate direct serve base URL if specified
|
||||||
|
if c.Storage.DirectServeBaseURL != "" {
|
||||||
|
u, err := url.Parse(c.Storage.DirectServeBaseURL)
|
||||||
|
if err != nil || u.Scheme == "" || u.Host == "" {
|
||||||
|
return fmt.Errorf("invalid storage.direct_serve_base_url %q: must be an absolute URL", c.Storage.DirectServeBaseURL)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate metadata TTL if specified
|
||||||
|
if c.MetadataTTL != "" && c.MetadataTTL != "0" {
|
||||||
|
if _, err := time.ParseDuration(c.MetadataTTL); err != nil {
|
||||||
|
return fmt.Errorf("invalid metadata_ttl %q: %w", c.MetadataTTL, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := c.Ecosystem.Cargo.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := c.Ecosystem.Debian.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
defaultMetadataTTL = 5 * time.Minute //nolint:mnd // sensible default
|
||||||
|
defaultDirectServeTTL = 15 * time.Minute //nolint:mnd // sensible default
|
||||||
|
defaultGradleBuildCacheMaxUploadSize = 100 << 20
|
||||||
|
defaultGradleBuildCacheSweepInterval = 10 * time.Minute
|
||||||
|
defaultGradleMaxUploadSizeStr = "100MB"
|
||||||
|
defaultGradleSweepIntervalStr = "10m"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ParseMaxSize returns the maximum cache size in bytes.
|
||||||
|
// Returns 0 if unset or explicitly disabled (meaning unlimited).
|
||||||
|
func (c *Config) ParseMaxSize() int64 {
|
||||||
|
if c.Storage.MaxSize == "" || c.Storage.MaxSize == "0" {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
size, err := ParseSize(c.Storage.MaxSize)
|
||||||
|
if err != nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return size
|
||||||
|
}
|
||||||
|
|
||||||
|
// ParseMetadataTTL returns the metadata TTL duration.
|
||||||
|
// Returns 5 minutes if unset, 0 if explicitly disabled.
|
||||||
|
func (c *Config) ParseMetadataTTL() time.Duration {
|
||||||
|
if c.MetadataTTL == "" {
|
||||||
|
return defaultMetadataTTL
|
||||||
|
}
|
||||||
|
if c.MetadataTTL == "0" {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
d, err := time.ParseDuration(c.MetadataTTL)
|
||||||
|
if err != nil {
|
||||||
|
return defaultMetadataTTL
|
||||||
|
}
|
||||||
|
return d
|
||||||
|
}
|
||||||
|
|
||||||
|
// ParseGradleBuildCacheMaxUploadSize returns the max accepted PUT body size.
|
||||||
|
// Defaults to 100MB if unset or invalid.
|
||||||
|
func (c *Config) ParseGradleBuildCacheMaxUploadSize() int64 {
|
||||||
|
if c.Gradle.BuildCache.MaxUploadSize == "" {
|
||||||
|
return defaultGradleBuildCacheMaxUploadSize
|
||||||
|
}
|
||||||
|
size, err := ParseSize(c.Gradle.BuildCache.MaxUploadSize)
|
||||||
|
if err != nil || size <= 0 {
|
||||||
|
return defaultGradleBuildCacheMaxUploadSize
|
||||||
|
}
|
||||||
|
return size
|
||||||
|
}
|
||||||
|
|
||||||
|
// ParseGradleBuildCacheMaxAge returns age-based eviction threshold.
|
||||||
|
// Returns 0 when disabled or invalid.
|
||||||
|
func (c *Config) ParseGradleBuildCacheMaxAge() time.Duration {
|
||||||
|
if c.Gradle.BuildCache.MaxAge == "" || c.Gradle.BuildCache.MaxAge == "0" {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
d, err := time.ParseDuration(c.Gradle.BuildCache.MaxAge)
|
||||||
|
if err != nil || d <= 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return d
|
||||||
|
}
|
||||||
|
|
||||||
|
// ParseGradleBuildCacheMaxSize returns total-size cap in bytes.
|
||||||
|
// Returns 0 when disabled or invalid.
|
||||||
|
func (c *Config) ParseGradleBuildCacheMaxSize() int64 {
|
||||||
|
if c.Gradle.BuildCache.MaxSize == "" || c.Gradle.BuildCache.MaxSize == "0" {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
size, err := ParseSize(c.Gradle.BuildCache.MaxSize)
|
||||||
|
if err != nil || size <= 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return size
|
||||||
|
}
|
||||||
|
|
||||||
|
// ParseGradleBuildCacheSweepInterval returns eviction sweep cadence.
|
||||||
|
// Defaults to 10m if unset or invalid.
|
||||||
|
func (c *Config) ParseGradleBuildCacheSweepInterval() time.Duration {
|
||||||
|
if c.Gradle.BuildCache.SweepInterval == "" {
|
||||||
|
return defaultGradleBuildCacheSweepInterval
|
||||||
|
}
|
||||||
|
d, err := time.ParseDuration(c.Gradle.BuildCache.SweepInterval)
|
||||||
|
if err != nil || d <= 0 {
|
||||||
|
return defaultGradleBuildCacheSweepInterval
|
||||||
|
}
|
||||||
|
return d
|
||||||
|
}
|
||||||
|
|
||||||
|
// ParseDirectServeTTL returns the presigned URL expiry duration.
|
||||||
|
// Returns 15 minutes if unset.
|
||||||
|
func (c *Config) ParseDirectServeTTL() time.Duration {
|
||||||
|
if c.Storage.DirectServeTTL == "" {
|
||||||
|
return defaultDirectServeTTL
|
||||||
|
}
|
||||||
|
d, err := time.ParseDuration(c.Storage.DirectServeTTL)
|
||||||
|
if err != nil {
|
||||||
|
return defaultDirectServeTTL
|
||||||
|
}
|
||||||
|
return d
|
||||||
|
}
|
||||||
|
|
||||||
// ParseSize parses a human-readable size string (e.g., "10GB", "500MB").
|
// ParseSize parses a human-readable size string (e.g., "10GB", "500MB").
|
||||||
// Returns the size in bytes.
|
// Returns the size in bytes.
|
||||||
func ParseSize(s string) (int64, error) {
|
func ParseSize(s string) (int64, error) {
|
||||||
|
|
@ -438,3 +727,7 @@ func (a *AuthConfig) Header() (name, value string) {
|
||||||
func expandEnv(s string) string {
|
func expandEnv(s string) string {
|
||||||
return os.Expand(s, os.Getenv)
|
return os.Expand(s, os.Getenv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func envBool(v string) bool {
|
||||||
|
return v == "true" || v == "1"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -24,6 +25,18 @@ func TestDefault(t *testing.T) {
|
||||||
if cfg.Database.Path == "" {
|
if cfg.Database.Path == "" {
|
||||||
t.Error("Database.Path should not be empty")
|
t.Error("Database.Path should not be empty")
|
||||||
}
|
}
|
||||||
|
if cfg.Gradle.BuildCache.MaxUploadSize != "100MB" {
|
||||||
|
t.Errorf("Gradle.BuildCache.MaxUploadSize = %q, want %q", cfg.Gradle.BuildCache.MaxUploadSize, "100MB")
|
||||||
|
}
|
||||||
|
if cfg.Gradle.BuildCache.MaxAge != "168h" {
|
||||||
|
t.Errorf("Gradle.BuildCache.MaxAge = %q, want %q", cfg.Gradle.BuildCache.MaxAge, "168h")
|
||||||
|
}
|
||||||
|
if cfg.Upstream.Maven != "https://repo1.maven.org/maven2" {
|
||||||
|
t.Errorf("Upstream.Maven = %q, want %q", cfg.Upstream.Maven, "https://repo1.maven.org/maven2")
|
||||||
|
}
|
||||||
|
if cfg.Upstream.GradlePluginPortal != "https://plugins.gradle.org/m2" {
|
||||||
|
t.Errorf("Upstream.GradlePluginPortal = %q, want %q", cfg.Upstream.GradlePluginPortal, "https://plugins.gradle.org/m2")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestValidate(t *testing.T) {
|
func TestValidate(t *testing.T) {
|
||||||
|
|
@ -97,6 +110,41 @@ func TestValidate(t *testing.T) {
|
||||||
modify: func(c *Config) { c.Storage.MaxSize = "10GB" },
|
modify: func(c *Config) { c.Storage.MaxSize = "10GB" },
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "invalid gradle upload size",
|
||||||
|
modify: func(c *Config) { c.Gradle.BuildCache.MaxUploadSize = testInvalid },
|
||||||
|
wantErr: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "zero gradle upload size",
|
||||||
|
modify: func(c *Config) { c.Gradle.BuildCache.MaxUploadSize = "0" },
|
||||||
|
wantErr: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "invalid gradle max age",
|
||||||
|
modify: func(c *Config) { c.Gradle.BuildCache.MaxAge = testInvalid },
|
||||||
|
wantErr: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "valid gradle max age",
|
||||||
|
modify: func(c *Config) { c.Gradle.BuildCache.MaxAge = "24h" },
|
||||||
|
wantErr: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "invalid gradle max size",
|
||||||
|
modify: func(c *Config) { c.Gradle.BuildCache.MaxSize = testInvalid },
|
||||||
|
wantErr: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "invalid gradle sweep interval",
|
||||||
|
modify: func(c *Config) { c.Gradle.BuildCache.SweepInterval = "0" },
|
||||||
|
wantErr: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "valid gradle sweep interval",
|
||||||
|
modify: func(c *Config) { c.Gradle.BuildCache.SweepInterval = "30m" },
|
||||||
|
wantErr: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|
@ -222,6 +270,13 @@ func TestLoadFromEnv(t *testing.T) {
|
||||||
t.Setenv("PROXY_BASE_URL", "https://env.example.com")
|
t.Setenv("PROXY_BASE_URL", "https://env.example.com")
|
||||||
t.Setenv("PROXY_STORAGE_PATH", "/env/cache")
|
t.Setenv("PROXY_STORAGE_PATH", "/env/cache")
|
||||||
t.Setenv("PROXY_LOG_LEVEL", testLevelDebug)
|
t.Setenv("PROXY_LOG_LEVEL", testLevelDebug)
|
||||||
|
t.Setenv("PROXY_UPSTREAM_MAVEN", "https://maven.example.com/repository/maven-public")
|
||||||
|
t.Setenv("PROXY_UPSTREAM_GRADLE_PLUGIN_PORTAL", "https://plugins.example.com/m2")
|
||||||
|
t.Setenv("PROXY_GRADLE_BUILD_CACHE_READ_ONLY", "true")
|
||||||
|
t.Setenv("PROXY_GRADLE_BUILD_CACHE_MAX_UPLOAD_SIZE", "32MB")
|
||||||
|
t.Setenv("PROXY_GRADLE_BUILD_CACHE_MAX_AGE", "12h")
|
||||||
|
t.Setenv("PROXY_GRADLE_BUILD_CACHE_MAX_SIZE", "10GB")
|
||||||
|
t.Setenv("PROXY_GRADLE_BUILD_CACHE_SWEEP_INTERVAL", "15m")
|
||||||
|
|
||||||
cfg.LoadFromEnv()
|
cfg.LoadFromEnv()
|
||||||
|
|
||||||
|
|
@ -237,6 +292,27 @@ func TestLoadFromEnv(t *testing.T) {
|
||||||
if cfg.Log.Level != testLevelDebug {
|
if cfg.Log.Level != testLevelDebug {
|
||||||
t.Errorf("Log.Level = %q, want %q", cfg.Log.Level, testLevelDebug)
|
t.Errorf("Log.Level = %q, want %q", cfg.Log.Level, testLevelDebug)
|
||||||
}
|
}
|
||||||
|
if cfg.Upstream.Maven != "https://maven.example.com/repository/maven-public" {
|
||||||
|
t.Errorf("Upstream.Maven = %q, want %q", cfg.Upstream.Maven, "https://maven.example.com/repository/maven-public")
|
||||||
|
}
|
||||||
|
if cfg.Upstream.GradlePluginPortal != "https://plugins.example.com/m2" {
|
||||||
|
t.Errorf("Upstream.GradlePluginPortal = %q, want %q", cfg.Upstream.GradlePluginPortal, "https://plugins.example.com/m2")
|
||||||
|
}
|
||||||
|
if !cfg.Gradle.BuildCache.ReadOnly {
|
||||||
|
t.Error("Gradle.BuildCache.ReadOnly = false, want true")
|
||||||
|
}
|
||||||
|
if cfg.Gradle.BuildCache.MaxUploadSize != "32MB" {
|
||||||
|
t.Errorf("Gradle.BuildCache.MaxUploadSize = %q, want %q", cfg.Gradle.BuildCache.MaxUploadSize, "32MB")
|
||||||
|
}
|
||||||
|
if cfg.Gradle.BuildCache.MaxAge != "12h" {
|
||||||
|
t.Errorf("Gradle.BuildCache.MaxAge = %q, want %q", cfg.Gradle.BuildCache.MaxAge, "12h")
|
||||||
|
}
|
||||||
|
if cfg.Gradle.BuildCache.MaxSize != "10GB" {
|
||||||
|
t.Errorf("Gradle.BuildCache.MaxSize = %q, want %q", cfg.Gradle.BuildCache.MaxSize, "10GB")
|
||||||
|
}
|
||||||
|
if cfg.Gradle.BuildCache.SweepInterval != "15m" {
|
||||||
|
t.Errorf("Gradle.BuildCache.SweepInterval = %q, want %q", cfg.Gradle.BuildCache.SweepInterval, "15m")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLoadCooldownConfig(t *testing.T) {
|
func TestLoadCooldownConfig(t *testing.T) {
|
||||||
|
|
@ -301,3 +377,218 @@ func TestLoadFileNotFound(t *testing.T) {
|
||||||
t.Error("expected error for nonexistent file")
|
t.Error("expected error for nonexistent file")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestParseMaxSize(t *testing.T) {
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
maxSize string
|
||||||
|
want int64
|
||||||
|
}{
|
||||||
|
{"empty means unlimited", "", 0},
|
||||||
|
{"zero means unlimited", "0", 0},
|
||||||
|
{"10GB", "10GB", 10 * 1024 * 1024 * 1024},
|
||||||
|
{"500MB", "500MB", 500 * 1024 * 1024},
|
||||||
|
{"invalid returns 0", "invalid", 0},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tt := range tests {
|
||||||
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
cfg := Default()
|
||||||
|
cfg.Storage.MaxSize = tt.maxSize
|
||||||
|
got := cfg.ParseMaxSize()
|
||||||
|
if got != tt.want {
|
||||||
|
t.Errorf("ParseMaxSize() = %d, want %d", got, tt.want)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestParseMetadataTTL(t *testing.T) {
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
ttl string
|
||||||
|
want time.Duration
|
||||||
|
}{
|
||||||
|
{"empty defaults to 5m", "", 5 * time.Minute},
|
||||||
|
{"explicit zero", "0", 0},
|
||||||
|
{"10 minutes", "10m", 10 * time.Minute},
|
||||||
|
{"1 hour", "1h", 1 * time.Hour},
|
||||||
|
{"invalid defaults to 5m", "not-a-duration", 5 * time.Minute},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tt := range tests {
|
||||||
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
cfg := Default()
|
||||||
|
cfg.MetadataTTL = tt.ttl
|
||||||
|
got := cfg.ParseMetadataTTL()
|
||||||
|
if got != tt.want {
|
||||||
|
t.Errorf("ParseMetadataTTL() = %v, want %v", got, tt.want)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestValidateMetadataTTL(t *testing.T) {
|
||||||
|
cfg := Default()
|
||||||
|
cfg.MetadataTTL = "invalid"
|
||||||
|
if err := cfg.Validate(); err == nil {
|
||||||
|
t.Error("expected validation error for invalid metadata_ttl")
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg.MetadataTTL = "5m"
|
||||||
|
if err := cfg.Validate(); err != nil {
|
||||||
|
t.Errorf("unexpected error for valid metadata_ttl: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg.MetadataTTL = "0"
|
||||||
|
if err := cfg.Validate(); err != nil {
|
||||||
|
t.Errorf("unexpected error for zero metadata_ttl: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestValidateHealthStorageProbeInterval(t *testing.T) {
|
||||||
|
cfg := Default()
|
||||||
|
cfg.Health.StorageProbeInterval = "not-a-duration"
|
||||||
|
if err := cfg.Validate(); err == nil {
|
||||||
|
t.Error("expected validation error for invalid health.storage_probe_interval")
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg.Health.StorageProbeInterval = "30s"
|
||||||
|
if err := cfg.Validate(); err != nil {
|
||||||
|
t.Errorf("unexpected error for valid health.storage_probe_interval: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg.Health.StorageProbeInterval = "0"
|
||||||
|
if err := cfg.Validate(); err != nil {
|
||||||
|
t.Errorf("unexpected error for zero health.storage_probe_interval: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg.Health.StorageProbeInterval = ""
|
||||||
|
if err := cfg.Validate(); err != nil {
|
||||||
|
t.Errorf("unexpected error for empty health.storage_probe_interval: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg.Health.StorageProbeInterval = "-5s"
|
||||||
|
if err := cfg.Validate(); err == nil {
|
||||||
|
t.Error("expected validation error for negative health.storage_probe_interval")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestLoadMetadataTTLFromEnv(t *testing.T) {
|
||||||
|
cfg := Default()
|
||||||
|
t.Setenv("PROXY_METADATA_TTL", "10m")
|
||||||
|
cfg.LoadFromEnv()
|
||||||
|
|
||||||
|
if cfg.MetadataTTL != "10m" {
|
||||||
|
t.Errorf("MetadataTTL = %q, want %q", cfg.MetadataTTL, "10m")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestParseGradleBuildCacheConfig(t *testing.T) {
|
||||||
|
cfg := Default()
|
||||||
|
|
||||||
|
if got := cfg.ParseGradleBuildCacheMaxUploadSize(); got != 100*1024*1024 {
|
||||||
|
t.Errorf("ParseGradleBuildCacheMaxUploadSize() = %d, want %d", got, 100*1024*1024)
|
||||||
|
}
|
||||||
|
if got := cfg.ParseGradleBuildCacheMaxAge(); got != 168*time.Hour {
|
||||||
|
t.Errorf("ParseGradleBuildCacheMaxAge() = %v, want %v", got, 168*time.Hour)
|
||||||
|
}
|
||||||
|
if got := cfg.ParseGradleBuildCacheMaxSize(); got != 0 {
|
||||||
|
t.Errorf("ParseGradleBuildCacheMaxSize() = %d, want 0", got)
|
||||||
|
}
|
||||||
|
if got := cfg.ParseGradleBuildCacheSweepInterval(); got != 10*time.Minute {
|
||||||
|
t.Errorf("ParseGradleBuildCacheSweepInterval() = %v, want %v", got, 10*time.Minute)
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg.Gradle.BuildCache.MaxUploadSize = "64MB"
|
||||||
|
cfg.Gradle.BuildCache.MaxAge = "48h"
|
||||||
|
cfg.Gradle.BuildCache.MaxSize = "2GB"
|
||||||
|
cfg.Gradle.BuildCache.SweepInterval = "20m"
|
||||||
|
|
||||||
|
if got := cfg.ParseGradleBuildCacheMaxUploadSize(); got != 64*1024*1024 {
|
||||||
|
t.Errorf("ParseGradleBuildCacheMaxUploadSize() = %d, want %d", got, 64*1024*1024)
|
||||||
|
}
|
||||||
|
if got := cfg.ParseGradleBuildCacheMaxAge(); got != 48*time.Hour {
|
||||||
|
t.Errorf("ParseGradleBuildCacheMaxAge() = %v, want %v", got, 48*time.Hour)
|
||||||
|
}
|
||||||
|
if got := cfg.ParseGradleBuildCacheMaxSize(); got != 2*1024*1024*1024 {
|
||||||
|
t.Errorf("ParseGradleBuildCacheMaxSize() = %d, want %d", got, 2*1024*1024*1024)
|
||||||
|
}
|
||||||
|
if got := cfg.ParseGradleBuildCacheSweepInterval(); got != 20*time.Minute {
|
||||||
|
t.Errorf("ParseGradleBuildCacheSweepInterval() = %v, want %v", got, 20*time.Minute)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestParseDirectServeTTL(t *testing.T) {
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
ttl string
|
||||||
|
want time.Duration
|
||||||
|
}{
|
||||||
|
{"empty defaults to 15m", "", 15 * time.Minute},
|
||||||
|
{"5 minutes", "5m", 5 * time.Minute},
|
||||||
|
{"1 hour", "1h", 1 * time.Hour},
|
||||||
|
{"invalid defaults to 15m", "not-a-duration", 15 * time.Minute},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tt := range tests {
|
||||||
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
cfg := Default()
|
||||||
|
cfg.Storage.DirectServeTTL = tt.ttl
|
||||||
|
got := cfg.ParseDirectServeTTL()
|
||||||
|
if got != tt.want {
|
||||||
|
t.Errorf("ParseDirectServeTTL() = %v, want %v", got, tt.want)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestValidateDirectServeTTL(t *testing.T) {
|
||||||
|
cfg := Default()
|
||||||
|
cfg.Storage.DirectServeTTL = "invalid"
|
||||||
|
if err := cfg.Validate(); err == nil {
|
||||||
|
t.Error("expected validation error for invalid storage.direct_serve_ttl")
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg.Storage.DirectServeTTL = "5m"
|
||||||
|
if err := cfg.Validate(); err != nil {
|
||||||
|
t.Errorf("unexpected error for valid storage.direct_serve_ttl: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestLoadDirectServeFromEnv(t *testing.T) {
|
||||||
|
cfg := Default()
|
||||||
|
t.Setenv("PROXY_STORAGE_DIRECT_SERVE", "true")
|
||||||
|
t.Setenv("PROXY_STORAGE_DIRECT_SERVE_TTL", "30m")
|
||||||
|
t.Setenv("PROXY_STORAGE_DIRECT_SERVE_BASE_URL", "https://cdn.example.com")
|
||||||
|
cfg.LoadFromEnv()
|
||||||
|
|
||||||
|
if !cfg.Storage.DirectServe {
|
||||||
|
t.Error("Storage.DirectServe should be true")
|
||||||
|
}
|
||||||
|
if cfg.Storage.DirectServeTTL != "30m" {
|
||||||
|
t.Errorf("Storage.DirectServeTTL = %q, want %q", cfg.Storage.DirectServeTTL, "30m")
|
||||||
|
}
|
||||||
|
if cfg.Storage.DirectServeBaseURL != "https://cdn.example.com" {
|
||||||
|
t.Errorf("Storage.DirectServeBaseURL = %q, want %q", cfg.Storage.DirectServeBaseURL, "https://cdn.example.com")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestValidateDirectServeBaseURL(t *testing.T) {
|
||||||
|
cfg := Default()
|
||||||
|
|
||||||
|
cfg.Storage.DirectServeBaseURL = "not a url"
|
||||||
|
if err := cfg.Validate(); err == nil {
|
||||||
|
t.Error("expected validation error for relative direct_serve_base_url")
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg.Storage.DirectServeBaseURL = "://bad"
|
||||||
|
if err := cfg.Validate(); err == nil {
|
||||||
|
t.Error("expected validation error for unparseable direct_serve_base_url")
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg.Storage.DirectServeBaseURL = "https://cdn.example.com"
|
||||||
|
if err := cfg.Validate(); err != nil {
|
||||||
|
t.Errorf("unexpected error for valid direct_serve_base_url: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue