Skip to content

Commit 062cac9

Browse files
authoredDec 2, 2023
fix: [#384] Create groups. (#386)
* fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * feat: Determine what images are running in a k8s cluster. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups. * fix: [#384] Create groups.
1 parent 03a282a commit 062cac9

File tree

19 files changed

+435
-157
lines changed

19 files changed

+435
-157
lines changed
 

‎.dive-ci

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
rules:
2+
# If the efficiency is measured below X%, mark as failed.
3+
# Expressed as a ratio between 0-1.
4+
lowestEfficiency: 0.90
5+
6+
# If the amount of wasted space is at least X or larger than X, mark as failed.
7+
# Expressed in B, KB, MB, and GB.
8+
highestWastedBytes: 20MB
9+
10+
# If the amount of wasted space makes up for X% or more of the image, mark as failed.
11+
# Note: the base image layer is NOT included in the total image size.
12+
# Expressed as a ratio between 0-1; fails if the threshold is met or crossed.
13+
highestUserWastedPercent: 0.25

‎.github/dependabot.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: 'docker'
5+
directory: '/'
6+
schedule:
7+
interval: 'weekly'
8+
- package-ecosystem: 'github-actions'
9+
directory: '/'
10+
schedule:
11+
interval: 'weekly'
12+
- package-ecosystem: 'gomod'
13+
directory: '/'
14+
schedule:
15+
interval: 'weekly'

‎.github/workflows/trivy.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,21 @@ jobs:
1212
run: |
1313
docker build -t utrecht/n3dr:${{ github.sha }} .
1414
- name: Run Trivy vulnerability scanner
15-
uses: aquasecurity/trivy-action@master
15+
uses: aquasecurity/trivy-action@0.14.0
1616
with:
1717
image-ref: 'utrecht/n3dr:${{ github.sha }}'
1818
format: 'table'
1919
exit-code: '1'
2020
ignore-unfixed: true
2121
vuln-type: 'os,library'
2222
severity: 'CRITICAL,HIGH'
23+
trivyignores: .trivyignore
24+
- name: Run Trivy vulnerability scanner in fs mode
25+
uses: aquasecurity/trivy-action@0.14.0
26+
with:
27+
scan-type: 'fs'
28+
scan-ref: '.'
29+
exit-code: '1'
30+
ignore-unfixed: true
31+
severity: 'CRITICAL,HIGH'
32+
trivyignores: .trivyignore

‎.trivyignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#CVE-2023-5363

‎Dockerfile

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ RUN adduser -D -g '' $USERNAME
55
COPY . /go/${USERNAME}/
66
WORKDIR /go/${USERNAME}/cmd/${USERNAME}
77
RUN apk add --no-cache \
8-
git=~2 && \
9-
CGO_ENABLED=0 go build -ldflags "-X main.Version=${VERSION}" -buildvcs=false && \
10-
cp n3dr /n3dr
8+
git=~2 && \
9+
CGO_ENABLED=0 go build -ldflags "-X main.Version=${VERSION}" -buildvcs=false && \
10+
cp n3dr /n3dr
1111

12-
FROM alpine:3.18.3
12+
FROM alpine:3.18.4
1313
COPY --from=builder /etc/passwd /etc/passwd
1414
COPY --from=builder /n3dr /usr/local/bin/n3dr
1515
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
16+
RUN apk add --no-cache \
17+
libcrypto3=3.1.4-r1 \
18+
libssl3=3.1.4-r1
1619
USER n3dr
17-
ENTRYPOINT ["/usr/local/bin/n3dr"]
20+
ENTRYPOINT ["n3dr"]

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![DevOps SE Questions](https://img.shields.io/stackexchange/devops/t/n3dr.svg?logo=stackexchange)](https://devops.stackexchange.com/tags/n3dr)
99
[![ServerFault SE Questions](https://img.shields.io/stackexchange/serverfault/t/n3dr.svg?logo=serverfault)](https://serverfault.com/tags/n3dr)
1010
[![Docker Pulls](https://img.shields.io/docker/pulls/utrecht/n3dr?logo=docker&logoColor=white)](https://hub.docker.com/r/utrecht/n3dr)
11-
![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/utrecht/n3dr?logo=docker&logoColor=white&sort=semver)
11+
[![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/utrecht/n3dr?logo=docker&logoColor=white&sort=semver)](https://hub.docker.com/r/utrecht/n3dr)
1212
![Issues](https://img.shields.io/github/issues-raw/030/n3dr.svg)
1313
![Pull requests](https://img.shields.io/github/issues-pr-raw/030/n3dr.svg)
1414
![Total downloads](https://img.shields.io/github/downloads/030/n3dr/total.svg)

‎build/package/snap/snapcraft.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: n3dr
33
base: core20
4-
version: 7.3.1
4+
version: 7.3.2
55
summary: Nexus3 Disaster Recovery
66
description: |
77
Download all artifacts at once or migrate automatically from Nexus to Nexus.

‎cmd/n3dr/configRepository.go

+127-58
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"fmt"
45
"os"
56

67
"github.com/030/n3dr/internal/app/n3dr/config/repository"
@@ -13,8 +14,109 @@ var (
1314
configRepoDockerPortSecure, configRepoDelete, snapshot, strictContentTypeValidation bool
1415
configRepoDockerPort int32
1516
configRepoName, configRepoRecipe, configRepoType, configRepoProxyURL string
17+
configRepoGroupMemberNames []string
1618
)
1719

20+
type repo struct {
21+
conn repository.Repository
22+
kind, name, recipe string
23+
snapshot bool
24+
}
25+
26+
var repoRecipeAndKindNotSupported = "repoRecipe: '%s' not supported in conjunction with repoKind: '%s'"
27+
28+
func (r *repo) createByType() error {
29+
switch configRepoType {
30+
case "apt":
31+
return r.Apt()
32+
case "docker":
33+
return r.Docker()
34+
case "gem":
35+
return r.Gem()
36+
case "maven2":
37+
return r.Maven2()
38+
case "npm":
39+
return r.Npm()
40+
case "raw":
41+
return r.Raw()
42+
case "yum":
43+
return r.Yum()
44+
default:
45+
return fmt.Errorf("configRepoType should not be empty, but: 'apt', 'docker', 'gem', 'maven2', 'npm' 'raw' or 'yum' and not: '%s'. Did you populate the --configRepoType parameter?", configRepoType)
46+
}
47+
}
48+
49+
func (r *repo) Apt() error {
50+
switch r.recipe {
51+
case "proxy":
52+
return r.conn.CreateAptProxied(r.name)
53+
default:
54+
return fmt.Errorf(repoRecipeAndKindNotSupported, r.recipe, r.kind)
55+
}
56+
}
57+
58+
func (r *repo) Docker() error {
59+
switch r.recipe {
60+
case "hosted":
61+
return r.conn.CreateDockerHosted(configRepoDockerPortSecure, configRepoDockerPort, r.name)
62+
default:
63+
return fmt.Errorf(repoRecipeAndKindNotSupported, r.recipe, r.kind)
64+
}
65+
}
66+
67+
func (r *repo) Gem() error {
68+
switch r.recipe {
69+
case "hosted":
70+
return r.conn.CreateGemHosted(r.name)
71+
default:
72+
return fmt.Errorf(repoRecipeAndKindNotSupported, r.recipe, r.kind)
73+
}
74+
}
75+
76+
func (r *repo) Maven2() error {
77+
switch r.recipe {
78+
case "group":
79+
return r.conn.CreateMavenGroup(configRepoGroupMemberNames, r.name)
80+
case "hosted":
81+
return r.conn.CreateMavenHosted(r.name, snapshot)
82+
case "proxy":
83+
return r.conn.CreateMavenProxied(r.name)
84+
default:
85+
return fmt.Errorf(repoRecipeAndKindNotSupported, r.recipe, r.kind)
86+
}
87+
}
88+
89+
func (r *repo) Npm() error {
90+
switch r.recipe {
91+
case "hosted":
92+
return r.conn.CreateNpmHosted(r.name, snapshot)
93+
case "proxy":
94+
return r.conn.CreateNpmProxied(r.name)
95+
default:
96+
return fmt.Errorf(repoRecipeAndKindNotSupported, r.recipe, r.kind)
97+
}
98+
}
99+
100+
func (r *repo) Raw() error {
101+
switch r.recipe {
102+
case "hosted":
103+
return r.conn.CreateRawHosted(r.name)
104+
default:
105+
return fmt.Errorf(repoRecipeAndKindNotSupported, r.recipe, r.kind)
106+
}
107+
}
108+
109+
func (r *repo) Yum() error {
110+
switch r.recipe {
111+
case "hosted":
112+
return r.conn.CreateYumHosted(r.name)
113+
case "proxy":
114+
return r.conn.CreateYumProxied(r.name)
115+
default:
116+
return fmt.Errorf(repoRecipeAndKindNotSupported, r.recipe, r.kind)
117+
}
118+
}
119+
18120
// configRepositoryCmd represents the configRepository command.
19121
var configRepositoryCmd = &cobra.Command{
20122
Use: "configRepository",
@@ -26,6 +128,9 @@ Examples:
26128
# Create a Docker repository:
27129
n3dr configRepository -u some-user -p some-pass -n localhost:9000 --https=false --configRepoName some-name --configRepoType docker
28130
131+
# Create a Maven2 repository if credentials and FQDN have been set in a '~/.n3dr/config.yml' file:
132+
n3dr configRepository --configRepoName some-name --configRepoType maven2
133+
29134
# Create a Maven2 repository:
30135
n3dr configRepository -u some-user -p some-pass -n localhost:9000 --https=false --configRepoName some-name --configRepoType maven2
31136
@@ -40,6 +145,16 @@ Examples:
40145
41146
# Create a Rubygems repository:
42147
n3dr configRepository -u admin -p some-pass -n localhost:9000 --https=false --configRepoName 3rdparty-rubygems --configRepoType gem
148+
149+
# Create Maven2 proxies:
150+
n3dr configRepository --configRepoType maven2 --configRepoName 3rdparty-maven --configRepoRecipe proxy --configRepoProxyURL https://repo.maven.apache.org/maven2/
151+
n3dr configRepository --configRepoType maven2 --configRepoName 3rdparty-maven-gradle-plugins --configRepoRecipe proxy --configRepoProxyURL https://plugins.gradle.org/m2/
152+
153+
# Create a NPM proxy:
154+
n3dr configRepository --configRepoType npm --configRepoName 3rdparty-npm --configRepoRecipe proxy --configRepoProxyURL https://registry.npmjs.org/
155+
156+
# Create a Maven2 group:
157+
n3dr configRepository --configRepoType maven2 --configRepoRecipe group --configRepoName some-group --configRepoGroupMemberNames releases,snapshots
43158
`,
44159
Run: func(cmd *cobra.Command, args []string) {
45160
n := connection.Nexus3{
@@ -49,10 +164,10 @@ Examples:
49164
StrictContentTypeValidation: strictContentTypeValidation,
50165
User: n3drUser,
51166
}
52-
r := repository.Repository{Nexus3: n}
167+
rr := repository.Repository{Nexus3: n}
53168

54169
if configRepoDelete {
55-
if err := r.Delete(configRepoName); err != nil {
170+
if err := rr.Delete(configRepoName); err != nil {
56171
log.Fatal(err)
57172
}
58173
os.Exit(0)
@@ -62,64 +177,17 @@ Examples:
62177
log.Fatal("configRepoReceipe should not be empty")
63178
}
64179

65-
if configRepoRecipe == "proxy" {
66-
if configRepoProxyURL == "" {
67-
log.Fatal("configRepoProxyURL should not be empty")
68-
}
69-
r.ProxyRemoteURL = configRepoProxyURL
180+
if configRepoRecipe == "proxy" && configRepoProxyURL == "" {
181+
log.Fatal("configRepoProxyURL should not be empty")
182+
} else {
183+
rr.ProxyRemoteURL = configRepoProxyURL
184+
log.Infof("configRepoProxyURL has been set to: '%s'", rr.ProxyRemoteURL)
70185
}
71186

72-
switch configRepoType {
73-
case "apt":
74-
if configRepoRecipe == "proxy" {
75-
if err := r.CreateAptProxied(configRepoName); err != nil {
76-
log.Fatal(err)
77-
}
78-
}
79-
case "docker":
80-
if configRepoRecipe == "hosted" {
81-
if err := r.CreateDockerHosted(configRepoDockerPortSecure, configRepoDockerPort, configRepoName); err != nil {
82-
log.Fatal(err)
83-
}
84-
}
85-
case "gem":
86-
if configRepoRecipe == "hosted" {
87-
if err := r.CreateGemHosted(configRepoName); err != nil {
88-
log.Fatal(err)
89-
}
90-
}
91-
case "maven2":
92-
if configRepoRecipe == "hosted" {
93-
if err := r.CreateMavenHosted(configRepoName, snapshot); err != nil {
94-
log.Fatal(err)
95-
}
96-
}
97-
case "npm":
98-
if configRepoRecipe == "hosted" {
99-
if err := r.CreateNpmHosted(configRepoName, snapshot); err != nil {
100-
log.Fatal(err)
101-
}
102-
}
103-
case "raw":
104-
if configRepoRecipe == "hosted" {
105-
if err := r.CreateRawHosted(configRepoName); err != nil {
106-
log.Fatal(err)
107-
}
108-
}
109-
case "yum":
110-
if configRepoRecipe == "hosted" {
111-
if err := r.CreateYumHosted(configRepoName); err != nil {
112-
log.Fatal(err)
113-
}
114-
} else if configRepoRecipe == "proxy" {
115-
if err := r.CreateYumProxied(configRepoName); err != nil {
116-
log.Fatal(err)
117-
}
118-
} else {
119-
log.Fatalf("configRepoRecipe: '%s' not supported in conjunction with configRepoType: '%s'", configRepoRecipe, configRepoType)
120-
}
121-
default:
122-
log.Fatalf("configRepoType should not be empty, but: 'apt', 'docker', 'maven2', 'raw' or 'yum' and not: '%s'. Did you populate the --configRepoType parameter?", configRepoType)
187+
log.Infof("creating repo: '%s' of type: '%s'", configRepoName, configRepoType)
188+
r := repo{conn: rr, kind: configRepoType, name: configRepoName, recipe: configRepoRecipe, snapshot: snapshot}
189+
if err := r.createByType(); err != nil {
190+
log.Fatalf("repo not created. Error: '%v'", err)
123191
}
124192
},
125193
}
@@ -140,4 +208,5 @@ func init() {
140208
configRepositoryCmd.Flags().Int32Var(&configRepoDockerPort, "configRepoDockerPort", 8082, "The docker connector port, e.g. 8082")
141209
configRepositoryCmd.Flags().BoolVar(&configRepoDockerPortSecure, "configRepoDockerPortSecure", false, "Whether the docker connector port should be secure")
142210
configRepositoryCmd.Flags().BoolVar(&strictContentTypeValidation, "strictContentTypeValidation", true, "whether strictContentTypeValidation should be enabled")
211+
configRepositoryCmd.Flags().StringSliceVar(&configRepoGroupMemberNames, "configRepoGroupMemberNames", []string{}, "The repository type, e.g.: 'apt', 'raw'")
143212
}

‎cmd/n3dr/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func parseConfig(cfgFile string) error {
219219
return err
220220
}
221221
} else {
222-
log.Warnf("Looked for config file: '%v', but found: '%v' including err: '%v'. Check whether it exists, the YAML is correct and the content is valid", cfgFile, viper.ConfigFileUsed(), err)
222+
log.Debugf("Looked for config file: '%v', but found: '%v' including err: '%v'. Check whether it exists, the YAML is correct and the content is valid", cfgFile, viper.ConfigFileUsed(), err)
223223
}
224224

225225
return nil

‎docs/CHANGELOG.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
## [Unreleased]
33

44

5+
<a name="7.3.2"></a>
6+
## [7.3.2] - 2023-12-02
7+
### Build
8+
- **deps:** bump golang.org/x/net from 0.15.0 to 0.17.0
9+
10+
### Feat
11+
- Determine what images are running in a k8s cluster.
12+
13+
### Fix
14+
- [[#384](https://github.com/030/n3dr/issues/384)] Create groups.
15+
16+
517
<a name="7.3.1"></a>
618
## [7.3.1] - 2023-10-14
719
### Fix
@@ -394,7 +406,8 @@ The `backup`, `upload` and `repositories` commands have been removed.
394406
<a name="1.0.0"></a>
395407
## 1.0.0 - 2019-05-12
396408

397-
[Unreleased]: https://github.com/030/n3dr/compare/7.3.1...HEAD
409+
[Unreleased]: https://github.com/030/n3dr/compare/7.3.2...HEAD
410+
[7.3.2]: https://github.com/030/n3dr/compare/7.3.1...7.3.2
398411
[7.3.1]: https://github.com/030/n3dr/compare/7.3.0...7.3.1
399412
[7.3.0]: https://github.com/030/n3dr/compare/7.2.5...7.3.0
400413
[7.2.5]: https://github.com/030/n3dr/compare/7.2.4...7.2.5

‎docs/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ n3dr config \
238238
### Build
239239

240240
```bash
241-
docker build -t utrecht/n3dr:7.3.1 .
241+
docker build -t utrecht/n3dr:7.3.2 .
242242
```
243243

244244
[![dockeri.co](https://dockeri.co/image/utrecht/n3dr)](https://hub.docker.com/r/utrecht/n3dr)
@@ -248,7 +248,7 @@ docker build -t utrecht/n3dr:7.3.1 .
248248
```bash
249249
docker run -it \
250250
-v /home/${USER}/.n3dr:/root/.n3dr \
251-
-v /tmp/n3dr:/tmp/n3dr utrecht/n3dr:7.3.1
251+
-v /tmp/n3dr:/tmp/n3dr utrecht/n3dr:7.3.2
252252
```
253253

254254
### Upload
@@ -257,7 +257,7 @@ docker run -it \
257257
docker run -it \
258258
--entrypoint=/bin/ash \
259259
-v /home/${USER}/.n3dr:/root/.n3dr \
260-
-v /tmp/n3dr:/tmp/n3dr utrecht/n3dr:7.3.1
260+
-v /tmp/n3dr:/tmp/n3dr utrecht/n3dr:7.3.2
261261
```
262262

263263
navigate to the repository folder, e.g. `/tmp/n3dr/download*/` and upload:

‎docs/quickstarts/snippets/n3dr/DOWNLOAD.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Download
22

3-
Download the [latest N3DR binary](https://github.com/030/n3dr/releases/tag/7.3.1):
3+
Download the [latest N3DR binary](https://github.com/030/n3dr/releases/tag/7.3.2):
44

55
```bash
66
cd /tmp && \
7-
curl -L https://github.com/030/n3dr/releases/download/7.3.1/n3dr-ubuntu-latest \
7+
curl -L https://github.com/030/n3dr/releases/download/7.3.2/n3dr-ubuntu-latest \
88
-o n3dr-ubuntu-latest && \
9-
curl -L https://github.com/030/n3dr/releases/download/7.3.1/\
9+
curl -L https://github.com/030/n3dr/releases/download/7.3.2/\
1010
n3dr-ubuntu-latest.sha512.txt \
1111
-o n3dr-ubuntu-latest.sha512.txt && \
1212
sha512sum -c n3dr-ubuntu-latest.sha512.txt && \

‎go.mod

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/030/n3dr
22

3-
go 1.19
3+
go 1.21
44

55
require (
66
github.com/030/logging v0.1.2
@@ -14,7 +14,7 @@ require (
1414
github.com/go-openapi/validate v0.22.1
1515
github.com/go-playground/validator/v10 v10.15.5
1616
github.com/hashicorp/go-retryablehttp v0.7.4
17-
github.com/mholt/archiver v3.1.1+incompatible
17+
github.com/mholt/archiver/v3 v3.5.1
1818
github.com/mitchellh/go-homedir v1.1.0
1919
github.com/samber/lo v1.38.1
2020
github.com/sirupsen/logrus v1.9.3
@@ -25,7 +25,7 @@ require (
2525
)
2626

2727
require (
28-
github.com/andybalholm/brotli v1.0.4 // indirect
28+
github.com/andybalholm/brotli v1.0.6 // indirect
2929
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
3030
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
3131
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
@@ -46,20 +46,19 @@ require (
4646
github.com/inconshreveable/mousetrap v1.1.0 // indirect
4747
github.com/jmespath/go-jmespath v0.4.0 // indirect
4848
github.com/josharian/intern v1.0.0 // indirect
49-
github.com/klauspost/compress v1.17.0 // indirect
50-
github.com/klauspost/pgzip v1.2.5 // indirect
49+
github.com/klauspost/compress v1.17.2 // indirect
50+
github.com/klauspost/pgzip v1.2.6 // indirect
5151
github.com/leodido/go-urn v1.2.4 // indirect
5252
github.com/magiconair/properties v1.8.7 // indirect
5353
github.com/mailru/easyjson v0.7.7 // indirect
5454
github.com/mholt/archiver/v4 v4.0.0-alpha.7 // indirect
5555
github.com/mitchellh/mapstructure v1.5.0 // indirect
56-
github.com/nwaples/rardecode v1.1.3 // indirect
56+
github.com/nwaples/rardecode v1.1.0 // indirect
5757
github.com/nwaples/rardecode/v2 v2.0.0-beta.2 // indirect
5858
github.com/oklog/ulid v1.3.1 // indirect
5959
github.com/opentracing/opentracing-go v1.2.0 // indirect
6060
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
61-
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
62-
github.com/pierrec/lz4/v4 v4.1.17 // indirect
61+
github.com/pierrec/lz4/v4 v4.1.18 // indirect
6362
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
6463
github.com/sagikazarmark/locafero v0.3.0 // indirect
6564
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
@@ -83,7 +82,7 @@ require (
8382
golang.org/x/crypto v0.14.0 // indirect
8483
golang.org/x/net v0.17.0 // indirect
8584
golang.org/x/sys v0.13.0 // indirect
86-
golang.org/x/text v0.13.0 // indirect
85+
golang.org/x/text v0.14.0 // indirect
8786
gopkg.in/ini.v1 v1.67.0 // indirect
8887
gopkg.in/yaml.v2 v2.4.0 // indirect
8988
gopkg.in/yaml.v3 v3.0.1 // indirect

‎go.sum

+31-15
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
4646
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
4747
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
4848
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
49-
github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
50-
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
49+
github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
50+
github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI=
51+
github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
5152
github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
5253
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
5354
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
@@ -77,7 +78,9 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y
7778
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
7879
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
7980
github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=
81+
github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
8082
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
83+
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
8184
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
8285
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
8386
github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
@@ -126,6 +129,7 @@ github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+
126129
github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU=
127130
github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg=
128131
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
132+
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
129133
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
130134
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
131135
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
@@ -183,6 +187,7 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
183187
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
184188
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
185189
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
190+
github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
186191
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
187192
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
188193
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@@ -198,6 +203,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
198203
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
199204
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
200205
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
206+
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
201207
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
202208
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
203209
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -215,13 +221,15 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4
215221
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
216222
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
217223
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
224+
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
218225
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
219226
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
220227
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
221228
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
222229
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
223230
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
224231
github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=
232+
github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
225233
github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA=
226234
github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
227235
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
@@ -246,18 +254,21 @@ github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaR
246254
github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
247255
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
248256
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
257+
github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
249258
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
250-
github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM=
251-
github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
259+
github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4=
260+
github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
252261
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
253-
github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE=
254262
github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
263+
github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU=
264+
github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
255265
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
256266
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
257267
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
258268
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
259269
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
260270
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
271+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
261272
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
262273
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
263274
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -274,9 +285,11 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
274285
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
275286
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
276287
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
288+
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
277289
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
278-
github.com/mholt/archiver v3.1.1+incompatible h1:1dCVxuqs0dJseYEhi5pl7MYPH9zDa1wBi7mF09cbNkU=
279-
github.com/mholt/archiver v3.1.1+incompatible/go.mod h1:Dh2dOXnSdiLxRiPoVfIr/fI1TwETms9B8CTWfeh7ROU=
290+
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
291+
github.com/mholt/archiver/v3 v3.5.1 h1:rDjOBX9JSF5BvoJGvjqK479aL70qh9DIpZCl+k7Clwo=
292+
github.com/mholt/archiver/v3 v3.5.1/go.mod h1:e3dqJ7H78uzsRSEACH1joayhuSyhnonssnDhppzS1L4=
280293
github.com/mholt/archiver/v4 v4.0.0-alpha.7 h1:xzByj8G8tj0Oq7ZYYU4+ixL/CVb5ruWCm0EZQ1PjOkE=
281294
github.com/mholt/archiver/v4 v4.0.0-alpha.7/go.mod h1:Fs8qUkO74HHaidabihzYephJH8qmGD/nCP6tE5xC9BM=
282295
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
@@ -287,8 +300,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
287300
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
288301
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
289302
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
290-
github.com/nwaples/rardecode v1.1.3 h1:cWCaZwfM5H7nAD6PyEdcVnczzV8i/JtotnyW/dD9lEc=
291-
github.com/nwaples/rardecode v1.1.3/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0=
303+
github.com/nwaples/rardecode v1.1.0 h1:vSxaY8vQhOcVr4mm5e8XllHWTiM4JF507A0Katqw7MQ=
304+
github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0=
292305
github.com/nwaples/rardecode/v2 v2.0.0-beta.2 h1:e3mzJFJs4k83GXBEiTaQ5HgSc/kOK8q0rDaRO0MPaOk=
293306
github.com/nwaples/rardecode/v2 v2.0.0-beta.2/go.mod h1:yntwv/HfMc/Hbvtq9I19D1n58te3h6KsqCf3GxyfBGY=
294307
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
@@ -298,10 +311,9 @@ github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYr
298311
github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
299312
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
300313
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
301-
github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=
302-
github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
303-
github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc=
304-
github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
314+
github.com/pierrec/lz4/v4 v4.1.2/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
315+
github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ=
316+
github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
305317
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
306318
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
307319
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -314,6 +326,7 @@ github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
314326
github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
315327
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
316328
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
329+
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
317330
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
318331
github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ=
319332
github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U=
@@ -371,6 +384,7 @@ github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhso
371384
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
372385
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
373386
github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
387+
github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
374388
github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
375389
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
376390
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
@@ -400,6 +414,7 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
400414
go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
401415
go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
402416
go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
417+
go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
403418
go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
404419
go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
405420
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
@@ -576,8 +591,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
576591
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
577592
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
578593
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
579-
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
580-
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
594+
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
595+
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
581596
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
582597
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
583598
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -729,6 +744,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
729744
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
730745
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
731746
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
747+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
732748
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
733749
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
734750
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=

‎internal/app/n3dr/artifactsv2/download.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/030/n3dr/internal/app/n3dr/s3"
1717
"github.com/030/p2iwd/pkg/p2iwd"
1818
"github.com/hashicorp/go-retryablehttp"
19-
"github.com/mholt/archiver"
19+
"github.com/mholt/archiver/v3"
2020
log "github.com/sirupsen/logrus"
2121
)
2222

‎internal/app/n3dr/artifactsv2/upload/maven2/snapshot/upload.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"path/filepath"
1010
"regexp"
1111

12-
"github.com/030/n3dr/internal/app/n3dr/artifactsv2/artifacts"
1312
"github.com/hashicorp/go-retryablehttp"
1413
log "github.com/sirupsen/logrus"
1514
)
@@ -22,8 +21,6 @@ type Nexus3 struct {
2221
func (n *Nexus3) statusCode(resp *http.Response) error {
2322
if resp.StatusCode == http.StatusCreated {
2423
log.Trace("file has been uploaded")
25-
artifacts.PrintType(n.RepoFormat)
26-
return nil
2724
} else {
2825
bodyBytes, err := io.ReadAll(resp.Body)
2926
if err != nil {
@@ -65,7 +62,7 @@ func (n *Nexus3) readRetryAndUpload(path string) error {
6562
log.Tracef("uri: '%s'", uri)
6663

6764
u := protocol + "://" + n.FQDN + "/repository/" + n.RepoName + "/" + uri
68-
log.Tracef("upload url: '%s'", u)
65+
log.Tracef("snapshot upload url: '%s'", u)
6966
req, err := http.NewRequest("PUT", u, f)
7067
if err != nil {
7168
return err

‎internal/app/n3dr/artifactsv2/upload/upload.go

+86-53
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ type Nexus3 struct {
4040
*connection.Nexus3
4141
}
4242

43+
type repoFormatAndType struct {
44+
format, repoType string
45+
}
46+
4347
func uploadStatus(err error) (int, error) {
4448
re := regexp.MustCompile(`status (\d{3})`)
4549
match := re.FindStringSubmatch(err.Error())
@@ -70,10 +74,11 @@ func (n *Nexus3) reposOnDisk() (localDiskRepos []string, err error) {
7074
return nil, err
7175
}
7276
log.Infof("found the following localDiskRepos: '%v'", localDiskRepos)
77+
7378
return localDiskRepos, nil
7479
}
7580

76-
func (n *Nexus3) repoFormatLocalDiskRepo(localDiskRepo string) (string, error) {
81+
func (n *Nexus3) repoFormatLocalDiskRepo(localDiskRepo string) (repoFormatAndType, error) {
7782
cn := connection.Nexus3{
7883
BasePathPrefix: n.BasePathPrefix,
7984
FQDN: n.FQDN,
@@ -85,19 +90,21 @@ func (n *Nexus3) repoFormatLocalDiskRepo(localDiskRepo string) (string, error) {
8590
a := artifacts.Nexus3{Nexus3: &cn}
8691
repos, err := a.Repos()
8792
if err != nil {
88-
return "", err
93+
return repoFormatAndType{}, err
8994
}
9095

9196
var repoFormat string
97+
var repoType string
9298
for _, repo := range repos {
9399
repoName := repo.Name
94100
if repoName == localDiskRepo {
95101
repoFormat = repo.Format
102+
repoType = repo.Type
96103
}
97104
}
98-
log.Infof("format of repo: '%s' is: '%s'", localDiskRepo, repoFormat)
105+
log.Infof("format of repo: '%s' is: '%s' and repoType: '%s'", localDiskRepo, repoFormat, repoType)
99106

100-
return repoFormat, nil
107+
return repoFormatAndType{repoFormat, repoType}, nil
101108
}
102109

103110
func maven(path string, skipErrors bool) (mp mavenParts, err error) {
@@ -298,7 +305,7 @@ func (n *Nexus3) checkLocalChecksumAndCompareWithOneInRemote(f, localDiskRepo, d
298305
if err != nil {
299306
return false, err
300307
}
301-
log.Info(f, downloadedFileChecksum)
308+
log.Debugf("checksum of file: '%s' is '%s'", f, downloadedFileChecksum)
302309

303310
retryClient := retryablehttp.NewClient()
304311
retryClient.Logger = nil
@@ -311,7 +318,7 @@ func (n *Nexus3) checkLocalChecksumAndCompareWithOneInRemote(f, localDiskRepo, d
311318
}
312319

313320
u := scheme + "://" + n.FQDN + "/repository/" + localDiskRepo + "/" + dir + "/" + filename + ".sha512"
314-
log.Info("URL: ", u)
321+
log.Debugf("upload URL: '%s'", u)
315322

316323
req, err := http.NewRequest("GET", u, nil)
317324
if err != nil {
@@ -335,10 +342,10 @@ func (n *Nexus3) checkLocalChecksumAndCompareWithOneInRemote(f, localDiskRepo, d
335342
}()
336343
bodyBytes, err := io.ReadAll(resp.Body)
337344
if err != nil {
338-
return identical, err
345+
return false, err
339346
}
340347
bodyString := string(bodyBytes)
341-
log.Info(bodyString)
348+
log.Debugf("checksum of artifact in nexus3: '%s'", bodyString)
342349

343350
if bodyString == downloadedFileChecksum {
344351
identical = true
@@ -347,16 +354,16 @@ func (n *Nexus3) checkLocalChecksumAndCompareWithOneInRemote(f, localDiskRepo, d
347354
return identical, nil
348355
}
349356

350-
func (n *Nexus3) UploadSingleArtifact(client *client.Nexus3, path, localDiskRepo, localDiskRepoHome, repoFormat string, skipErrors bool) error {
357+
func (n *Nexus3) UploadSingleArtifact(client *client.Nexus3, path, localDiskRepo, localDiskRepoHome, repoFormat string, skipErrors bool) (bool, error) {
351358
dir := strings.Replace(filepath.Dir(path), localDiskRepoHome+"/", "", -1)
352359
filename := filepath.Base(path)
353360

354361
var f *os.File
355362
af := artifactFiles{}
356363

357364
if identical, _ := n.checkLocalChecksumAndCompareWithOneInRemote(filepath.Clean(path), localDiskRepo, dir, filename); identical {
358-
log.Info("Already uploaded")
359-
return nil
365+
log.Debugf("artifact: '%s' has already been uploaded", filename)
366+
return true, nil
360367
}
361368

362369
c := components.UploadComponentParams{}
@@ -365,7 +372,7 @@ func (n *Nexus3) UploadSingleArtifact(client *client.Nexus3, path, localDiskRepo
365372
c.Repository = localDiskRepo
366373
f, err := os.Open(filepath.Clean(path))
367374
if err != nil {
368-
return err
375+
return false, err
369376
}
370377
c.AptAsset = f
371378
case "maven2":
@@ -375,7 +382,7 @@ func (n *Nexus3) UploadSingleArtifact(client *client.Nexus3, path, localDiskRepo
375382
filePathPom := fileNameWithoutExtIncludingDir + ".pom"
376383

377384
if slices.Contains(checkedMavenFolders, dirPath) {
378-
return nil
385+
return false, nil
379386
}
380387

381388
if _, err := os.Stat(filePathPom); err == nil {
@@ -384,13 +391,13 @@ func (n *Nexus3) UploadSingleArtifact(client *client.Nexus3, path, localDiskRepo
384391
c.Repository = localDiskRepo
385392

386393
if err := af.mavenJarAndOtherExtensions(&c, fileNameWithoutExtIncludingDir, skipErrors); err != nil {
387-
return err
394+
return false, err
388395
}
389396

390397
var err error
391398
f, err = os.Open(filepath.Clean(filePathPom))
392399
if err != nil {
393-
return err
400+
return false, err
394401
}
395402
c.Maven2Asset1 = f
396403
ext1 := "pom"
@@ -441,13 +448,13 @@ func (n *Nexus3) UploadSingleArtifact(client *client.Nexus3, path, localDiskRepo
441448
c.Repository = localDiskRepo
442449

443450
if err := af.mavenJarAndOtherExtensions(&c, fileNameWithoutExtIncludingDir, skipErrors); err != nil {
444-
return err
451+
return false, err
445452
}
446453

447454
//
448455
mp, err := maven(path, skipErrors)
449456
if err != nil {
450-
return err
457+
return false, err
451458
}
452459
c.Maven2ArtifactID = &mp.artifact
453460
c.Maven2Version = &mp.version
@@ -463,7 +470,7 @@ func (n *Nexus3) UploadSingleArtifact(client *client.Nexus3, path, localDiskRepo
463470
groupID = match[1]
464471
groupID = strings.ReplaceAll(groupID, `/`, `.`)
465472
} else {
466-
return fmt.Errorf("groupID should not be empty, path: '%s' and regex: '%s'", path, regex)
473+
return false, fmt.Errorf("groupID should not be empty, path: '%s' and regex: '%s'", path, regex)
467474
}
468475
c.Maven2GroupID = &groupID
469476
generatePOM := true
@@ -516,21 +523,21 @@ func (n *Nexus3) UploadSingleArtifact(client *client.Nexus3, path, localDiskRepo
516523
c.Repository = localDiskRepo
517524
f, err := os.Open(filepath.Clean(path))
518525
if err != nil {
519-
return err
526+
return false, err
520527
}
521528
c.NpmAsset = f
522529
case "nuget":
523530
c.Repository = localDiskRepo
524531
f, err := os.Open(filepath.Clean(path))
525532
if err != nil {
526-
return err
533+
return false, err
527534
}
528535
c.NugetAsset = f
529536
case "raw":
530537
c.Repository = localDiskRepo
531538
f, err := os.Open(filepath.Clean(path))
532539
if err != nil {
533-
return err
540+
return false, err
534541
}
535542
c.RawAsset1 = f
536543
c.RawDirectory = &dir
@@ -541,28 +548,28 @@ func (n *Nexus3) UploadSingleArtifact(client *client.Nexus3, path, localDiskRepo
541548
c.Repository = localDiskRepo
542549
f, err := os.Open(filepath.Clean(path))
543550
if err != nil {
544-
return err
551+
return false, err
545552
}
546553
c.RubygemsAsset = f
547554
}
548555
case "yum":
549556
c.Repository = localDiskRepo
550557
f, err := os.Open(filepath.Clean(path))
551558
if err != nil {
552-
return err
559+
return false, err
553560
}
554561
c.YumAsset = f
555562
c.YumAssetFilename = &filename
556563
default:
557-
return nil
564+
return false, nil
558565
}
559566

560567
files := []*os.File{f, af.f2, af.f3, af.f4, af.f5, af.f6, af.f2, af.f7}
561568
if err := upload(c, client, path, files); err != nil {
562-
return err
569+
return false, err
563570
}
564571

565-
return nil
572+
return false, nil
566573
}
567574

568575
func upload(c components.UploadComponentParams, client *client.Nexus3, path string, files []*os.File) error {
@@ -595,6 +602,35 @@ func upload(c components.UploadComponentParams, client *client.Nexus3, path stri
595602
return nil
596603
}
597604

605+
func (n *Nexus3) uploadAndPrintRepoFormat(c *client.Nexus3, path, localDiskRepo, localDiskRepoHome, repoFormat string, skipErrors bool) error {
606+
identical, err := n.UploadSingleArtifact(c, path, localDiskRepo, localDiskRepoHome, repoFormat, skipErrors)
607+
if err != nil {
608+
uploaded, errRegex := regexp.MatchString("status 400", err.Error())
609+
if errRegex != nil {
610+
return err
611+
}
612+
if uploaded {
613+
log.Debugf("artifact: '%s' has already been uploaded", path)
614+
return nil
615+
}
616+
617+
errString := fmt.Errorf("could not upload artifact: '%s', err: '%w'", path, err)
618+
if n.SkipErrors {
619+
log.Error(errString)
620+
} else {
621+
return errString
622+
}
623+
} else {
624+
artifacts.PrintType(repoFormat)
625+
}
626+
if identical {
627+
log.Debugf("checksum file: '%s' locally is identical compared to one in nexus", path)
628+
return nil
629+
}
630+
631+
return nil
632+
}
633+
598634
func (n *Nexus3) ReadLocalDirAndUploadArtifacts(localDiskRepoHome, localDiskRepo, repoFormat string) error {
599635
var wg sync.WaitGroup
600636

@@ -617,24 +653,8 @@ func (n *Nexus3) ReadLocalDirAndUploadArtifacts(localDiskRepoHome, localDiskRepo
617653
go func(path, localDiskRepo, localDiskRepoHome, repoFormat string, skipErrors bool) {
618654
defer wg.Done()
619655

620-
if err := n.UploadSingleArtifact(c, path, localDiskRepo, localDiskRepoHome, repoFormat, skipErrors); err != nil {
621-
uploaded, errRegex := regexp.MatchString("status 400", err.Error())
622-
if errRegex != nil {
623-
panic(err)
624-
}
625-
if uploaded {
626-
log.Debugf("artifact: '%s' has already been uploaded", path)
627-
return
628-
}
629-
630-
errString := fmt.Errorf("could not upload artifact: '%s', err: '%w'", path, err)
631-
if n.SkipErrors {
632-
log.Error(errString)
633-
} else {
634-
panic(errString)
635-
}
636-
} else {
637-
artifacts.PrintType(repoFormat)
656+
if err := n.uploadAndPrintRepoFormat(c, path, localDiskRepo, localDiskRepoHome, repoFormat, skipErrors); err != nil {
657+
panic(err)
638658
}
639659
}(path, localDiskRepo, localDiskRepoHome, repoFormat, n.SkipErrors)
640660
}
@@ -676,8 +696,17 @@ func (n *Nexus3) maven2SnapshotsUpload(localDiskRepo string) {
676696
log.Tracef("VersionPolicy: '%s'", vp)
677697

678698
if strings.EqualFold(vp, "snapshot") {
679-
s := snapshot.Nexus3{DownloadDirName: n.DownloadDirName, FQDN: n.FQDN, Pass: n.Pass, RepoFormat: "maven2", RepoName: localDiskRepo, SkipErrors: n.SkipErrors, User: n.User}
699+
s := snapshot.Nexus3{DownloadDirName: n.DownloadDirName, FQDN: n.FQDN, HTTPS: *n.HTTPS, Pass: n.Pass, RepoFormat: "maven2", RepoName: localDiskRepo, SkipErrors: n.SkipErrors, User: n.User}
700+
680701
if err := s.Upload(); err != nil {
702+
uploaded, errRegex := regexp.MatchString("bad status: 400 Repository does not allow updating assets", err.Error())
703+
if errRegex != nil {
704+
panic(err)
705+
}
706+
if uploaded {
707+
log.Debugf("artifact from localDiskRepo: '%s' has been uploaded already", localDiskRepo)
708+
return
709+
}
681710
if !n.SkipErrors {
682711
panic(err)
683712
}
@@ -698,22 +727,26 @@ func (n *Nexus3) uploadArtifactsSingleDir(localDiskRepo string) {
698727
return
699728
}
700729

701-
repoFormat, err := n.repoFormatLocalDiskRepo(localDiskRepo)
730+
repoFormatAndType, err := n.repoFormatLocalDiskRepo(localDiskRepo)
702731
if err != nil {
703732
panic(err)
704733
}
705-
if repoFormat == "" {
734+
if repoFormatAndType.format == "" {
706735
log.Errorf("repoFormat not detected. Verify whether repo: '%s' resides in Nexus", localDiskRepo)
707736
return
708737
}
709738

710-
if repoFormat == "maven2" {
711-
n.maven2SnapshotsUpload(localDiskRepo)
712-
}
739+
log.Warnf("only uploads to 'hosted' repositories are supported. Current: '%v'", repoFormatAndType)
740+
if repoFormatAndType.repoType == "hosted" {
741+
if repoFormatAndType.format == "maven2" {
742+
log.Info("upload to snapshot repo")
743+
n.maven2SnapshotsUpload(localDiskRepo)
744+
}
713745

714-
localDiskRepoHome := filepath.Join(n.DownloadDirName, localDiskRepo)
715-
if err := n.ReadLocalDirAndUploadArtifacts(localDiskRepoHome, localDiskRepo, repoFormat); err != nil {
716-
panic(err)
746+
localDiskRepoHome := filepath.Join(n.DownloadDirName, localDiskRepo)
747+
if err := n.ReadLocalDirAndUploadArtifacts(localDiskRepoHome, localDiskRepo, repoFormatAndType.format); err != nil {
748+
panic(err)
749+
}
717750
}
718751
}
719752

‎internal/app/n3dr/config/repository/repository.go

+109
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,42 @@ func created(name string, err error) error {
3131
return fmt.Errorf("could not create repository: '%v', err: '%w'", name, err)
3232
}
3333

34+
func (r *Repository) CreateMavenGroup(memberNames []string, name string) error {
35+
log.Infof("creating maven group: '%s'...", name)
36+
client, err := r.Nexus3.Client()
37+
if err != nil {
38+
return err
39+
}
40+
if name == "" {
41+
return fmt.Errorf("repo name should not be empty")
42+
}
43+
if len(memberNames) == 0 {
44+
return fmt.Errorf("memberNames should not be empty")
45+
}
46+
47+
online := true
48+
mhsa := models.StorageAttributes{BlobStoreName: "default", StrictContentTypeValidation: &r.StrictContentTypeValidation}
49+
group := models.GroupAttributes{MemberNames: memberNames}
50+
body := models.MavenGroupRepositoryAPIRequest{
51+
Group: &group,
52+
Name: &name,
53+
Online: &online,
54+
Storage: &mhsa,
55+
}
56+
createMavenGroup := repository_management.CreateRepositoryParams{Body: &body}
57+
createMavenGroup.WithTimeout(time.Second * 30)
58+
if createRepositoryCreated, err := client.RepositoryManagement.CreateRepository(&createMavenGroup); err != nil {
59+
log.Debugf("createRepositoryCreated: '%v'", createRepositoryCreated)
60+
log.Tracef("createRepositoryCreatedError '%v'", err)
61+
if err := created(name, err); err != nil {
62+
return err
63+
}
64+
}
65+
log.Infof("created the following maven group: '%v'", name)
66+
67+
return nil
68+
}
69+
3470
func (r *Repository) CreateAptProxied(name string) error {
3571
log.Infof("Creating proxied apt repository: '%s'...", name)
3672
client, err := r.Nexus3.Client()
@@ -68,6 +104,42 @@ func (r *Repository) CreateAptProxied(name string) error {
68104
return nil
69105
}
70106

107+
func (r *Repository) CreateNpmProxied(name string) error {
108+
log.Infof("Creating npm proxy: '%s'...", name)
109+
client, err := r.Nexus3.Client()
110+
if err != nil {
111+
return err
112+
}
113+
if name == "" {
114+
return fmt.Errorf("repo name should not be empty")
115+
}
116+
117+
httpClientBlocked := false
118+
httpClientAutoBlocked := true
119+
httpClient := models.HTTPClientAttributes{AutoBlock: &httpClientAutoBlocked, Blocked: &httpClientBlocked}
120+
negativeCacheEnabled := true
121+
var negativeCacheTimeToLive int32 = 1440
122+
negativeCache := models.NegativeCacheAttributes{Enabled: &negativeCacheEnabled, TimeToLive: &negativeCacheTimeToLive}
123+
var contentMaxAge int32 = 1440
124+
var metadataMaxAge int32 = 1440
125+
remoteURL := r.ProxyRemoteURL
126+
proxy := models.ProxyAttributes{ContentMaxAge: &contentMaxAge, MetadataMaxAge: &metadataMaxAge, RemoteURL: remoteURL}
127+
online := true
128+
npm := models.NpmAttributes{}
129+
mhsa := models.StorageAttributes{BlobStoreName: "default", StrictContentTypeValidation: &r.StrictContentTypeValidation}
130+
ma := models.NpmProxyRepositoryAPIRequest{Npm: &npm, Name: &name, Online: &online, Storage: &mhsa, Proxy: &proxy, NegativeCache: &negativeCache, HTTPClient: &httpClient}
131+
createNpmProxy := repository_management.CreateRepository10Params{Body: &ma}
132+
createNpmProxy.WithTimeout(time.Second * 30)
133+
if _, err := client.RepositoryManagement.CreateRepository10(&createNpmProxy); err != nil {
134+
if err := created(name, err); err != nil {
135+
return err
136+
}
137+
}
138+
log.Infof("created the following repository: '%v'", name)
139+
140+
return nil
141+
}
142+
71143
func (r *Repository) CreateYumProxied(name string) error {
72144
log.Infof("Creating proxied yum repository: '%s'...", name)
73145
client, err := r.Nexus3.Client()
@@ -103,6 +175,43 @@ func (r *Repository) CreateYumProxied(name string) error {
103175
return nil
104176
}
105177

178+
func (r *Repository) CreateMavenProxied(name string) error {
179+
log.Infof("creating the following maven proxy: '%s'...", name)
180+
client, err := r.Nexus3.Client()
181+
if err != nil {
182+
return err
183+
}
184+
remoteURL := r.ProxyRemoteURL
185+
log.Infof("remoteURL: '%s'", remoteURL)
186+
if name == "" || remoteURL == "" {
187+
return fmt.Errorf("repo name of proxy url should not be empty")
188+
}
189+
190+
httpClientBlocked := false
191+
httpClientAutoBlocked := true
192+
httpClient := models.HTTPClientAttributesWithPreemptiveAuth{AutoBlock: &httpClientAutoBlocked, Blocked: &httpClientBlocked}
193+
negativeCacheEnabled := true
194+
var negativeCacheTimeToLive int32 = 1440
195+
negativeCache := models.NegativeCacheAttributes{Enabled: &negativeCacheEnabled, TimeToLive: &negativeCacheTimeToLive}
196+
var contentMaxAge int32 = 1440
197+
var metadataMaxAge int32 = 1440
198+
proxy := models.ProxyAttributes{ContentMaxAge: &contentMaxAge, MetadataMaxAge: &metadataMaxAge, RemoteURL: remoteURL}
199+
online := true
200+
maven := models.MavenAttributes{LayoutPolicy: "STRICT", VersionPolicy: "MIXED"}
201+
mhsa := models.StorageAttributes{BlobStoreName: "default", StrictContentTypeValidation: &r.StrictContentTypeValidation}
202+
ma := models.MavenProxyRepositoryAPIRequest{Maven: &maven, Name: &name, Online: &online, Storage: &mhsa, Proxy: &proxy, NegativeCache: &negativeCache, HTTPClient: &httpClient}
203+
createMavenProxy := repository_management.CreateRepository2Params{Body: &ma}
204+
createMavenProxy.WithTimeout(time.Second * 30)
205+
if _, err := client.RepositoryManagement.CreateRepository2(&createMavenProxy); err != nil {
206+
if err := created(name, err); err != nil {
207+
return err
208+
}
209+
}
210+
log.Infof("created the following maven proxy: '%v'", name)
211+
212+
return nil
213+
}
214+
106215
func (r *Repository) CreateDockerHosted(secure bool, port int32, name string) error {
107216
log.Infof("Creating docker hosted repository: '%s'...", name)
108217
client, err := r.Nexus3.Client()

‎test/integration-tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ repositories() {
409409
--dockerHost ${DOCKER_URL}
410410

411411
count_downloads 354 ${testZipSizeDir}
412-
test_zip 1399 ${testZipSizeDir}
412+
test_zip "1403[0-9]\{2\}" ${testZipSizeDir}
413413

414414
cleanup_downloads
415415
}

0 commit comments

Comments
 (0)
Please sign in to comment.