Ramkumar Chinchani
f3faae0e09
report listening port when chosen by kernel ( #770 )
...
Based off of the PR by @thesayyn
https://github.com/project-zot/zot/pull/720
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-09-09 08:41:13 +03:00
slab713
8ffb053cec
Replaced deprecated io/ioutil functions ( #768 )
...
Signed-off-by: slab713 <109306207+slab713@users.noreply.github.com >
2022-09-02 15:56:02 +03:00
Shivam Mishra
6c293719e3
storage: different subpaths can point to same root directory
...
currently different subpaths can only point to same root directory only
when one or both of the storage config does not enable dedupe
different subpath should be able to point to same root directory and in
that case their storage config should be same i.e GC,Dedupe, GC delay
and GC interval
Signed-off-by: Shivam Mishra <shimish2@cisco.com >
2022-08-31 15:43:43 -07:00
Alex Stan
49e8167dbe
graphql: Apply authorization on /_search endpoint
...
- AccessControlContext now resides in a separate package from where it can be imported,
along with the contextKey that will be used to set and retrieve this context value.
- AccessControlContext has a new field called Username, that will be of use for future
implementations in graphQL resolvers.
- GlobalSearch resolver now uses this context to filter repos available to the logged user.
- moved logic for uploading images in tests so that it can be used in every package
- tests were added for multiple request scenarios, when zot-server requires authz
on specific repos
- added tests with injected errors for extended coverage
- added tests for status code error injection utilities
Closes https://github.com/project-zot/zot/issues/615
Signed-off-by: Alex Stan <alexandrustan96@yahoo.ro >
2022-08-26 21:31:26 +03:00
Nicol Draghici
5450139ba1
Get identity when using TLS certificates
...
Signed-off-by: Nicol Draghici <idraghic@cisco.com >
2022-08-26 19:52:51 +03:00
Ramkumar Chinchani
2ff8e8b7d2
fix dependabot alerts
...
https://github.com/project-zot/zot/pull/737
https://github.com/project-zot/zot/pull/738
https://github.com/project-zot/zot/pull/739
https://github.com/project-zot/zot/pull/740
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-08-23 09:38:30 -07:00
Ramkumar Chinchani
5c01c4eab4
support OCI image index at manifest endpoint ( #638 )
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-08-20 11:18:48 +03:00
Catalin Hofnar
74630ed3a0
Added content-type to Access-Control-Allow-Headers needed for playground preflight
...
Signed-off-by: Catalin Hofnar <catalin.hofnar@gmail.com >
2022-08-16 22:47:24 +03:00
Ramkumar Chinchani
4b8e288cd3
fix dependabot alerts
...
https://github.com/project-zot/zot/pull/712
https://github.com/project-zot/zot/pull/714
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-08-13 00:02:36 -07:00
Nicol Draghici
a702a2377e
Remove AllowReadOnly and ReadOnly
...
Signed-off-by: Nicol Draghici <idraghic@cisco.com >
Remove check and set header every time
Signed-off-by: Nicol Draghici <idraghic@cisco.com >
2022-08-10 14:27:21 -07:00
Alex Stan
ada21ed842
Manage builds with different combinations of extensions
...
Files were added to be built whether an extension is on or off.
New build tags were added for each extension, while minimal and extended disappeared.
added custom binary naming depending on extensions used and changed references from binary to binary-extended
added automated blackbox tests for sync, search, scrub, metrics
added contributor guidelines
Signed-off-by: Alex Stan <alexandrustan96@yahoo.ro >
2022-06-30 09:53:52 -07:00
Shivam Mishra
620bc7c517
routes: strip query parameter from request URL
...
reuqest url also contains query parameter due to this in some scenarios
location header is setting up incorrectly, strip query parameter from
request url to correctly setup location header.
Closes #573 #575
Signed-off-by: Shivam Mishra <shimish2@cisco.com >
2022-06-08 22:50:37 -07:00
Andreea-Lupu
081ba0b2f2
fix periodic background tasks - gc and scrub
...
Signed-off-by: Andreea-Lupu <andreealupu1470@yahoo.com >
2022-06-02 08:58:02 -07:00
Lisca Ana-Roberta
62775cc095
fixed failed tests for all skopeo versions
...
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
skopeo verifications
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
skopeo verifications modified makefile
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
modified how to get digest and fixed makefile
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
fixed failed tests for all skopeo versions
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
echo skopeo version
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
skopeo verifications
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
skopeo verifications modified makefile
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
modified how to get digest and fixed makefile
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
skopeo failed tests fixed
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
changed function name
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
fixed lost modifications
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
fixed code coverage and dead code
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
2022-05-27 08:19:07 -07:00
Shivam Mishra
0dd00e7883
fix extension endpoints
...
Signed-off-by: Shivam Mishra <shimish2@cisco.com >
2022-05-25 13:46:43 -07:00
Ramkumar Chinchani
6b841809e3
fix CVE-2022-29173/GHSA-66x3-6cw3-v5gj
...
https://github.com/project-zot/zot/security/dependabot/16
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-05-25 11:34:24 -07:00
Shivam Mishra
dcdeb935fd
use zot as an extension name, ext as a component and search as a module
...
add endpoints field in ext discover api
distribution spec extension discover api has endpoints field required.
https://github.com/opencontainers/distribution-spec/blob/main/extensions/_oci.md#extensions-property-descriptions
Signed-off-by: Shivam Mishra <shimish2@cisco.com >
2022-05-24 19:12:40 -07:00
Petu Eusebiu
5e22acbbc4
s3: added logic for deduping blobs
...
Because s3 doesn't support hard links we store duplicated blobs
as empty files. When the original blob is deleted its content is
moved to the the next duplicated blob and so on.
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-05-24 17:00:10 -07:00
Shivam Mishra
36c9631000
ext: use distribution spec route prefix for extension api
...
Following the spec defined here https://github.com/opencontainers/distribution-spec/tree/main/extensions
Signed-off-by: Shivam Mishra <shimish2@cisco.com >
2022-05-22 16:35:16 -07:00
laurentiuNiculae
bb95af5b4d
default policy only authorization
...
unit tests for manifest integrity when updating
Signed-off-by: laurentiuNiculae <themelopeus@gmail.com >
2022-05-03 11:46:55 -07:00
Alex Stan
d325c8b5f4
Fix problems signaled by new linter version v1.45.2
...
PR (linter: upgrade linter version #405 ) triggered lint job which failed
with many errors generated by various linters. Configurations were added to
golangcilint.yaml and several refactorings were made in order to improve the
results of the linter.
maintidx linter disabled
Signed-off-by: Alex Stan <alexandrustan96@yahoo.ro >
2022-04-27 09:55:44 -07:00
Andreea-Lupu
5e35dfa28f
make gc periodic
...
Signed-off-by: Andreea-Lupu <andreealupu1470@yahoo.com >
2022-04-18 10:25:29 -07:00
Petu Eusebiu
4e20ab8a5d
go.mod: update dependencies
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-04-15 10:31:37 -07:00
Alexei Dodon
ad519e2d3e
Leave zot repositories in a consistent state after zot hits fd limit closes #359
...
Signed-off-by: Alexei Dodon <adodon@cisco.com >
2022-03-31 13:25:15 -07:00
Petu Eusebiu
be910cf01c
lint: Move out config reloader context from controller struct
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-03-24 10:50:01 -07:00
Petu Eusebiu
353b0c6034
Move api constants in separate 'constants' package to avoid circular imports
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-03-24 10:50:01 -07:00
Shivam Mishra
b8010e1ee4
routes: changes required to do browser authentication
...
whenever we make a request that contains header apart from CORS allowed header, browser sends a preflight request
and in response accept *Access-Control-Allow-Headers*.
preflight request is in form of OPTIONS method, added new http handler func to set headers
and returns HTTP status ok in case of OPTIONS method.
in case of authorization, request contains authorization header
added authorization header in Access-Control-Allow-Headers list
added AllowOrigin field in HTTPConfig this field value is set to Access-Control-Allow-Origin header and will give zot adminstrator to limit incoming request.
Signed-off-by: Shivam Mishra <shimish2@cisco.com >
2022-03-08 17:42:54 -08:00
Eng Zer Jun
0d77b60de7
test: use T.TempDir to create temporary test directory
...
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.
Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com >
2022-03-07 12:28:49 -08:00
Ramkumar Chinchani
4be2652085
conformance: fix cross-mount behavior when 'from' is missing
...
fixes issue #442
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-03-04 17:24:50 -08:00
Ramkumar Chinchani
95e4b2054b
upgrade module deps
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-03-04 13:10:58 -08:00
Ramkumar Chinchani
8db3e1b192
CVE-2022-23649: fix dependabot alert
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-03-02 12:01:14 -08:00
Ramkumar Chinchani
b2c8533719
test: fix ldap unit tests
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-02-09 14:48:34 -08:00
Ramkumar Chinchani
730fe70f2f
coverage: improve code coverage
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-02-09 07:42:15 -08:00
Ramkumar Chinchani
d2aa016cdb
storage: flush/sync contents to disk on file close
...
Behavior controlled by configuration (default=off)
It is a trade-off between performance and consistency.
References:
[1] https://github.com/golang/go/issues/20599
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-02-07 12:08:01 -08:00
Ramkumar Chinchani
87084f286b
storage: improve/fix oci image validation
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-02-02 13:31:41 -08:00
Ramkumar Chinchani
45fe129c63
notaryv2: fix 'notation list'
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-01-31 14:33:21 -08:00
Ramkumar Chinchani
e0a1a82890
coverage: add failure injection framework
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-01-28 08:56:00 -08:00
Ramkumar Chinchani
1e5ea7e09c
controller: support rate-limiting incoming requests
...
helps constraining resource usage and against flood attacks.
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-01-24 12:48:13 -08:00
Petu Eusebiu
4f825a5e2f
[Identity-based Authorization] Add an option to specify a global policy for all repositories
...
using regex.
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-01-07 10:55:20 -08:00
Ramkumar Chinchani
8183e1467c
lint: some more linter-related cleanup
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2021-12-23 22:01:40 -08:00
Ramkumar Chinchani
ac3801ea2d
lint: upgrade golangci-lint
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2021-12-20 17:20:35 -08:00
Andreea-Lupu
c61c3836db
implement scrub to check manifest/blob integrity
...
Signed-off-by: Andreea-Lupu <andreealupu1470@yahoo.com >
2021-12-09 11:18:09 -08:00
Ramkumar Chinchani
96226af869
move references to zotregistry.io and project-zot
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2021-12-05 10:52:27 -08:00
Ramkumar Chinchani
e42e42a2cc
artifacts: initial support for artifacts/notaryv2 spec
...
https://github.com/oras-project/artifacts-spec
https://github.com/notaryproject/notaryproject
Fixes issue #264
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2021-12-01 18:55:39 -08:00
Alexei Dodon
f99fa37623
ci/cd: unit test hangs for a long time intermittently closes #286
...
Signed-off-by: Alexei Dodon <adodon@cisco.com >
2021-11-29 14:07:49 -08:00
Alexei Dodon
e900b09cfb
Fix data races in tests, closes #255
...
Signed-off-by: Alexei Dodon <adodon@cisco.com >
2021-11-17 13:23:59 -08:00
Petu Eusebiu
9c568c0ee2
storage: add s3 backend support (without GC and dedupe)
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2021-11-15 08:09:00 -08:00
Petu Eusebiu
19003e8a71
Added new extension "sync"
...
Periodically poll registries and pull images according to sync's config
Added sync on demand, syncing when clients asks for an image which
zot doesn't have.
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2021-10-21 10:32:46 -07:00
Petu Eusebiu
20f4051446
Clean blob uploads when clients interrupts uploading, closes #225
2021-10-08 14:55:57 -07:00
Petu Eusebiu
609d85d875
Add identity-based access control, closes #51
...
Add a cli subcommand to verify config files validity
2021-08-30 13:56:27 -07:00