Skip to content

Commit 25d2689

Browse files
authored
feat: Add support for Private docker registries (#16837)
#### Summary - [x] Depends on cloudquery/plugin-pb-go#248 I have verified that this functionality works with AWS ECR and with private Github container registry (ghcr.io) by clearing all local images from docker then running `go run main.go install src.yml` where the source was like this: ``` kind: source spec: name: "typeform" registry: "docker" # docker_registry_auth_token: ${DOCKER_AUTH} # path: "012345678910.dkr.ecr.us-east-2.amazonaws.com/bernays:typeform" path: "ghcr.io/bbernays/typeform:v1.3.0" ```
1 parent 8903563 commit 25d2689

9 files changed

Lines changed: 124 additions & 34 deletions

File tree

cli/cmd/install.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,23 @@ func installPlugin(cmd *cobra.Command, args []string) error {
7777
sourceRegInferred := make([]bool, len(sources))
7878
for i, source := range sources {
7979
sourcePluginConfigs[i] = managedplugin.Config{
80-
Name: source.Name,
81-
Version: source.Version,
82-
Path: source.Path,
83-
Registry: SpecRegistryToPlugin(source.Registry),
80+
Name: source.Name,
81+
Version: source.Version,
82+
Path: source.Path,
83+
Registry: SpecRegistryToPlugin(source.Registry),
84+
DockerAuth: source.DockerRegistryAuthToken,
8485
}
8586
sourceRegInferred[i] = source.RegistryInferred()
8687
}
8788
destinationPluginConfigs := make([]managedplugin.Config, len(destinations))
8889
destinationRegInferred := make([]bool, len(destinations))
8990
for i, destination := range destinations {
9091
destinationPluginConfigs[i] = managedplugin.Config{
91-
Name: destination.Name,
92-
Version: destination.Version,
93-
Path: destination.Path,
94-
Registry: SpecRegistryToPlugin(destination.Registry),
92+
Name: destination.Name,
93+
Version: destination.Version,
94+
Path: destination.Path,
95+
Registry: SpecRegistryToPlugin(destination.Registry),
96+
DockerAuth: destination.DockerRegistryAuthToken,
9597
}
9698
destinationRegInferred[i] = destination.RegistryInferred()
9799
}

cli/cmd/migrate.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,23 @@ func migrate(cmd *cobra.Command, args []string) error {
8080
sourceRegInferred := make([]bool, len(sources))
8181
for i, source := range sources {
8282
sourcePluginConfigs[i] = managedplugin.Config{
83-
Name: source.Name,
84-
Version: source.Version,
85-
Path: source.Path,
86-
Registry: SpecRegistryToPlugin(source.Registry),
83+
Name: source.Name,
84+
Version: source.Version,
85+
Path: source.Path,
86+
Registry: SpecRegistryToPlugin(source.Registry),
87+
DockerAuth: source.DockerRegistryAuthToken,
8788
}
8889
sourceRegInferred[i] = source.RegistryInferred()
8990
}
9091
destinationPluginConfigs := make([]managedplugin.Config, len(destinations))
9192
destinationRegInferred := make([]bool, len(destinations))
9293
for i, destination := range destinations {
9394
destinationPluginConfigs[i] = managedplugin.Config{
94-
Name: destination.Name,
95-
Version: destination.Version,
96-
Path: destination.Path,
97-
Registry: SpecRegistryToPlugin(destination.Registry),
95+
Name: destination.Name,
96+
Version: destination.Version,
97+
Path: destination.Path,
98+
Registry: SpecRegistryToPlugin(destination.Registry),
99+
DockerAuth: destination.DockerRegistryAuthToken,
98100
}
99101
destinationRegInferred[i] = destination.RegistryInferred()
100102
}

cli/cmd/sync.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,11 @@ func sync(cmd *cobra.Command, args []string) error {
147147
opts = append(opts, managedplugin.WithOtelEndpointInsecure())
148148
}
149149
cfg := managedplugin.Config{
150-
Name: source.Name,
151-
Registry: SpecRegistryToPlugin(source.Registry),
152-
Version: source.Version,
153-
Path: source.Path,
150+
Name: source.Name,
151+
Registry: SpecRegistryToPlugin(source.Registry),
152+
Version: source.Version,
153+
Path: source.Path,
154+
DockerAuth: source.DockerRegistryAuthToken,
154155
}
155156
if isolatePluginEnvironment {
156157
cfg.Environment = filterPluginEnv(osEnviron, source.Name, "source")
@@ -183,10 +184,11 @@ func sync(cmd *cobra.Command, args []string) error {
183184
}
184185

185186
cfg := managedplugin.Config{
186-
Name: destination.Name,
187-
Registry: SpecRegistryToPlugin(destination.Registry),
188-
Version: destination.Version,
189-
Path: destination.Path,
187+
Name: destination.Name,
188+
Registry: SpecRegistryToPlugin(destination.Registry),
189+
Version: destination.Version,
190+
Path: destination.Path,
191+
DockerAuth: destination.DockerRegistryAuthToken,
190192
}
191193
if isolatePluginEnvironment {
192194
cfg.Environment = filterPluginEnv(osEnviron, destination.Name, "destination")

cli/cmd/tables.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ func tables(cmd *cobra.Command, args []string) error {
8282
sourceRegInferred := make([]bool, len(sources))
8383
for i, sourceSpec := range sources {
8484
pluginConfigs[i] = managedplugin.Config{
85-
Name: sourceSpec.Name,
86-
Path: sourceSpec.Path,
87-
Version: sourceSpec.Version,
88-
Registry: SpecRegistryToPlugin(sourceSpec.Registry),
85+
Name: sourceSpec.Name,
86+
Path: sourceSpec.Path,
87+
Version: sourceSpec.Version,
88+
Registry: SpecRegistryToPlugin(sourceSpec.Registry),
89+
DockerAuth: sourceSpec.DockerRegistryAuthToken,
8990
}
9091
sourceRegInferred[i] = sourceSpec.Registry == specs.RegistryUnset
9192
}

cli/go.mod

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/cloudquery/plugin-sdk/v4 v4.30.0
1313
github.com/distribution/reference v0.5.0
1414
github.com/docker/distribution v2.8.3+incompatible
15-
github.com/docker/docker v24.0.8+incompatible
15+
github.com/docker/docker v25.0.3+incompatible
1616
github.com/getsentry/sentry-go v0.24.1
1717
github.com/ghodss/yaml v1.0.0
1818
github.com/google/go-cmp v0.6.0
@@ -33,7 +33,7 @@ require (
3333
golang.org/x/net v0.21.0
3434
golang.org/x/sync v0.6.0
3535
golang.org/x/term v0.17.0
36-
google.golang.org/grpc v1.60.1
36+
google.golang.org/grpc v1.61.0
3737
google.golang.org/protobuf v1.32.0
3838
gopkg.in/yaml.v3 v3.0.1
3939
)
@@ -58,6 +58,7 @@ require (
5858
github.com/cespare/xxhash/v2 v2.2.0 // indirect
5959
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
6060
github.com/chenzhuoyu/iasm v0.9.1 // indirect
61+
github.com/containerd/log v0.1.0 // indirect
6162
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
6263
github.com/davecgh/go-spew v1.1.1 // indirect
6364
github.com/deepmap/oapi-codegen v1.16.2 // indirect
@@ -66,10 +67,13 @@ require (
6667
github.com/docker/go-units v0.5.0 // indirect
6768
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
6869
github.com/fatih/structs v1.1.0 // indirect
70+
github.com/felixge/httpsnoop v1.0.4 // indirect
6971
github.com/flosch/pongo2/v4 v4.0.2 // indirect
7072
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
7173
github.com/gin-contrib/sse v0.1.0 // indirect
7274
github.com/gin-gonic/gin v1.9.1 // indirect
75+
github.com/go-logr/logr v1.4.1 // indirect
76+
github.com/go-logr/stdr v1.2.2 // indirect
7377
github.com/go-playground/locales v0.14.1 // indirect
7478
github.com/go-playground/universal-translator v0.18.1 // indirect
7579
github.com/go-playground/validator/v10 v10.18.0 // indirect
@@ -130,6 +134,10 @@ require (
130134
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
131135
github.com/yosssi/ace v0.0.5 // indirect
132136
github.com/zeebo/xxh3 v1.0.2 // indirect
137+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect
138+
go.opentelemetry.io/otel v1.23.1 // indirect
139+
go.opentelemetry.io/otel/metric v1.23.1 // indirect
140+
go.opentelemetry.io/otel/trace v1.23.1 // indirect
133141
golang.org/x/arch v0.7.0 // indirect
134142
golang.org/x/crypto v0.19.0 // indirect
135143
golang.org/x/mod v0.15.0 // indirect

cli/go.sum

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ github.com/cloudquery/plugin-pb-go v1.19.0 h1:QqdIoblmD+42Lv99cIJqkN34vvOWaX6j7S
7474
github.com/cloudquery/plugin-pb-go v1.19.0/go.mod h1:YSEBZV1O043VqV1OQDtujdOqX9t5IjOwdXP94EersEU=
7575
github.com/cloudquery/plugin-sdk/v4 v4.30.0 h1:ArgDxga+s5U32afSNzF5v+s7jeYski11Y8uV0240OEw=
7676
github.com/cloudquery/plugin-sdk/v4 v4.30.0/go.mod h1:Jqd/uO6UdM5/7+JXBXT1onJHoK3Tql9wz9fIADwRG3k=
77+
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
78+
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
7779
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
7880
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
7981
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
@@ -86,8 +88,8 @@ github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK
8688
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
8789
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
8890
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
89-
github.com/docker/docker v24.0.8+incompatible h1:lbGlhLzolo0tpp+paD0JzOYId072MQmQxZLPevQCFPU=
90-
github.com/docker/docker v24.0.8+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
91+
github.com/docker/docker v25.0.3+incompatible h1:D5fy/lYmY7bvZa0XTZ5/UJPljor41F+vdyJG5luQLfQ=
92+
github.com/docker/docker v25.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
9193
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
9294
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
9395
github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=
@@ -100,6 +102,8 @@ github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
100102
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
101103
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
102104
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
105+
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
106+
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
103107
github.com/flosch/pongo2/v4 v4.0.2 h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0Hw=
104108
github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8=
105109
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
@@ -120,6 +124,11 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb
120124
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
121125
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
122126
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
127+
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
128+
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
129+
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
130+
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
131+
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
123132
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
124133
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
125134
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
@@ -174,6 +183,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
174183
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
175184
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
176185
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
186+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms=
187+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg=
177188
github.com/imkira/go-interpol v1.1.0 h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk=
178189
github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
179190
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
@@ -395,6 +406,22 @@ github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
395406
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
396407
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
397408
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
409+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 h1:doUP+ExOpH3spVTLS0FcWGLnQrPct/hD/bCPbDRUEAU=
410+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0/go.mod h1:rdENBZMT2OE6Ne/KLwpiXudnAsbdrdBaqBvTN8M8BgA=
411+
go.opentelemetry.io/otel v1.23.1 h1:Za4UzOqJYS+MUczKI320AtqZHZb7EqxO00jAHE0jmQY=
412+
go.opentelemetry.io/otel v1.23.1/go.mod h1:Td0134eafDLcTS4y+zQ26GE8u3dEuRBiBCTUIRHaikA=
413+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 h1:DeFD0VgTZ+Cj6hxravYYZE2W4GlneVH81iAOPjZkzk8=
414+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0/go.mod h1:GijYcYmNpX1KazD5JmWGsi4P7dDTTTnfv1UbGn84MnU=
415+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.20.0 h1:CsBiKCiQPdSjS+MlRiqeTI9JDDpSuk0Hb6QTRfwer8k=
416+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.20.0/go.mod h1:CMJYNAfooOwSZSAmAeMUV1M+TXld3BiK++z9fqIm2xk=
417+
go.opentelemetry.io/otel/metric v1.23.1 h1:PQJmqJ9u2QaJLBOELl1cxIdPcpbwzbkjfEyelTl2rlo=
418+
go.opentelemetry.io/otel/metric v1.23.1/go.mod h1:mpG2QPlAfnK8yNhNJAxDZruU9Y1/HubbC+KyH8FaCWI=
419+
go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM=
420+
go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0=
421+
go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6HmYY8=
422+
go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI=
423+
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
424+
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
398425
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
399426
golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc=
400427
golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
@@ -490,10 +517,13 @@ golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6f
490517
gonum.org/v1/gonum v0.12.0 h1:xKuo6hzt+gMav00meVPUlXwSdoEJP46BR+wdxQEFK2o=
491518
gonum.org/v1/gonum v0.12.0/go.mod h1:73TDxJfAAHeA8Mk9mf8NlIppyhQNo5GLTcYeqgo2lvY=
492519
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
520+
google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac h1:ZL/Teoy/ZGnzyrqK/Optxxp2pmVh+fmJ97slxSRyzUg=
521+
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe h1:0poefMBYvYbs7g5UkjS6HcxBPaTRAmznle9jnxYoAI8=
522+
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA=
493523
google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe h1:bQnxqljG/wqi4NTXu2+DJ3n7APcEA882QZ1JvhQAq9o=
494524
google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
495-
google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
496-
google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
525+
google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
526+
google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
497527
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
498528
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
499529
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=

cli/internal/specs/v0/metadata.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ type Metadata struct {
2929
// Registry can be "", "github", "local", "grpc", "docker", "cloudquery"
3030
Registry Registry `json:"registry,omitempty" jsonschema:"default=cloudquery"`
3131

32+
// DockerRegistryAuthToken is the token to use to authenticate with the docker registry
33+
DockerRegistryAuthToken string `json:"docker_registry_auth_token,omitempty"`
34+
3235
// registryInferred is a flag that indicates whether the registry was inferred from an empty value
3336
registryInferred bool
3437
}

cli/internal/specs/v0/schema.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/pages/docs/reference/source-spec.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,40 @@ The name field may be used to uniquely identify a particular source configuratio
4646
- `grpc`: mostly useful in debug mode when plugin is already running in a different terminal, CloudQuery will connect to the gRPC plugin server directly without spawning the process.
4747
- `docker`: CloudQuery will run the plugin in a Docker container. This is most useful for plugins written in Python, as they do not support the `local`, `github` and `cloudquery` registries.
4848

49+
<!-- vale off -->
50+
51+
### docker_registry_auth_token
52+
53+
<!-- vale on -->
54+
55+
(`string`, optional, default: `""`, introduced in CLI `v5.7.0`)
56+
57+
Authentication token for private Docker container registries. This is required if the plugin is hosted in a private Docker container registry. The token should be a valid Docker registry token that can be used to pull the plugin image. This option is only relevant when `registry` is set to `docker`. The token is a base64 encoded string. Here is an example of how to generate the token:
58+
59+
```shell
60+
echo -n "{\"username\":\"<REPLACE_WITH_PASSWORD>\",\"password\":\"<REPLACE_WITH_PASSWORD>\"}" | base64`
61+
```
62+
Details about specific private container registries:
63+
64+
AWS ECR:
65+
The username is `AWS` and you can get the password by running `aws ecr get-login-password --region <region>`. Replace `<region>` with the region where the ECR is located.
66+
67+
Generating the token for AWS ECR would look like this:
68+
69+
```shell
70+
echo -n "{\"username\":\"AWS\",\"password\":\"$(aws ecr get-login-password --region <REGION>)\"}" | base64
71+
```
72+
73+
GitHub Container Registry:
74+
The username is `USERNAME` and you use a personal access token as the password. More information can be found [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-with-a-personal-access-token-classic)
75+
76+
Generating the token for GitHub Container Registry would look like this:
77+
78+
```shell
79+
export CR_PAT=YOUR_TOKEN
80+
echo -n "{\"username\":\"USERNAME\",\"password\":\"$CR_PAT\"}" | base64
81+
```
82+
4983
### path
5084

5185
(`string`, required)

0 commit comments

Comments
 (0)