0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00
Commit graph

339 commits

Author SHA1 Message Date
Ramkumar Chinchani
909a97b922 storage: compliance allows for a full blob upload without a session
implement a new method which just takes the repo name, body and digest
and creates a blob out of this
2020-01-31 11:49:15 -08:00
Ramkumar Chinchani
48fb4967a2 errors: compliance requires error codes to be string enum constants. 2020-01-30 23:54:05 -08:00
Ramkumar Chinchani
faad2b1d1f manifest can be deleted only by digest and not tag
Fixes issue #67.

As per dist spec, DELETE of a image manifest can only be done with
digest as <reference> param. Previously, tags were being allowed as
well. This is not conformant to the spec.
2020-01-28 14:51:51 -08:00
Peter Engelbert
268b4088fd Add support for bearer/token auth
New options added to configuration file to reference a public key used
to validate authorization tokens signed by an auth server with
corresponding private key.

Resolves #24

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
2020-01-27 12:42:23 -06:00
Ramkumar Chinchani
9000adba60 cli: deprecate "compliance" command
dist-spec community is now maintaining its own conformance suite hosted
at https://oci.bloodorange.io which over time will be more complete.

This makes zot's compliance cli superfluous. Hence, deprecating the cli.

However, we keep the unit tests itself though.
2020-01-16 15:05:55 -08:00
Ramkumar Chinchani
964af6ba51 compliance: be compliant with dist-spec compliance tests
dist-spec compliance tests are now becoming a part of dist-spec repo
itself - we want to be compliant

pkg/api/regex.go:
	* revert uppercasing in repository names

pkg/api/routes.go:
	* ListTags() should support the URL params 'n' and 'last'
	  for pagination

	* s/uuid/session_id/g to use the dist-spec's naming

	* Fix off-by-one error in GetBlobUpload()'s http response "Range" header

	* DeleteManifest() success status code is 202

	* Fix PatchBlobUpload() to account for "streamed" use case
	  where neither "Content-Length" nor "Content-Range" headers are set

pkg/storage/storage.go:
	* Add a "streamed" version of PutBlobChunk() called PutBlobChunkStreamed()

pkg/compliance/v1_0_0/check.go:
	* fix unit tests to account for changed response status codes
2020-01-16 11:28:23 -08:00
Ramkumar Chinchani
d64a3e33cc authN: first try local htpasswd then LDAP
We are noticing that LDAP connectivity issues and timeouts can affect
authN behavior from client side (which can timeout as well).

Instead, put local authN first so at least we have a reliable authN
method.

But, the caveat is that it is best if the local and LDAP user list
doesn't overlap.
2020-01-15 09:37:17 -08:00
Ramkumar Chinchani
31b30d858b routes: add more logs
There still appears to be another path where we are seeing 500s.
Adding more logs to catch this path.
2020-01-06 22:51:42 -08:00
Ramkumar Chinchani
8bbf892480 routes: be more paranoid
once we have an non-EOF error in this path, not clear if we can really
recover.
2020-01-05 23:21:27 -08:00
Ravi Chamarthy
d5d6928341
Merge pull request #54 from rchincha/compl 2020-01-04 19:16:57 -08:00
Ramkumar Chinchani
87bad57345 compliance: "Location" header can be absolute or relative
Pls. see: https://github.com/opencontainers/distribution-spec/issues/79
2020-01-04 19:05:39 -08:00
Ramkumar Chinchani
2eb4455df7 routes: improve error handling when returning blob data
We have noticed that very intermittently zot returns a 500 when copying
blob data. This is likely happening due to a io.ErrShortWrite
2020-01-04 18:39:21 -08:00
Ramkumar Chinchani
a57f085749 compliance: cleanup compliance test code
zot ci/cd tests are too stict, so separate and relax them for compliance
tests.

Location header is set in some cases, but some clarification is needed
in URL construction.

Fix some incorrect compliance tests.
2019-12-23 22:32:52 -08:00
Ramkumar Chinchani
c8563d8672 routes: handle "mount blob" to remain compliant
"mount blob" was the only feature we didn't handle.
We don't fully support it yet because we don't have access control
support, but at least handle it and return something sane to remain
compliant.
2019-12-20 10:37:41 -08:00
Ravi Chamarthy
535b9d07b1 Fix comments in storage.go 2019-12-13 17:31:05 -08:00
Josh Dolitsky
271b916a26 feat(compliance): Add JSON output option
This adds a new --json flag to the compliance subcommand, which
will output the compliance test results as minified JSON to stdout.

Also a few other small additions:
- Exit 1 if compliance tests fail
- Use random port for test server using freeport library (added)

Signed-off-by: Josh Dolitsky <393494+jdolitsky@users.noreply.github.com>
2019-12-13 14:57:51 -06:00
Ramkumar Chinchani
d30766de34 test/data: remove htpasswd file
Fixes issue #15
2019-12-13 11:11:24 -08:00
zendril
4e22352e9c Fixing all the issues with upgrading to golangci-lint 1.21.0 2019-12-13 00:53:18 -05:00
Ramkumar Chinchani
7779188a9c ldap: pull in external library code so go modules are in control
1) github.com/jtblin/go-ldap-client is an abandoned project and not keeping
up with go modules, so pull that code in (single file, BSD license)

2) minor refactor ldap as a result of 1)

3) update go.mod
2019-12-11 14:17:06 -08:00
Ramkumar Chinchani
9ae9e40b67 log: improve logging
- add a panic recovery handler
        - add logs on unexpected error paths
        - use logger's panic method
2019-11-26 14:18:20 -08:00
Ramkumar Chinchani
f07c535225 reorder header and data writes 2019-11-26 09:40:13 -08:00
Ramkumar Chinchani
5447ec5bdd ldap: improve recovery when connection failures 2019-11-18 11:54:11 -08:00
Ramkumar Chinchani
13a8d8631e ldap: setup a new ldap conn on bind failure 2019-11-08 11:39:55 -08:00
Ramkumar Chinchani
84b9194598 logs: strip properly 2019-10-24 14:20:17 -07:00
Ramkumar Chinchani
64b9482985 logs: sanitize logs 2019-10-24 13:15:29 -07:00
Ramkumar Chinchani
b107d6d1a4 compliance: initial commit 2019-10-14 10:59:11 -07:00
Ramkumar Chinchani
d294f9bc76 log: fix appending to logs 2019-09-20 14:31:01 -07:00
Ramkumar Chinchani
77dc1b7299 auth: add LDAP support
fixes #23
2019-09-20 13:57:06 -07:00
Ramkumar Chinchani
6295e0c91e auth: add LDAP support
fixes #23
2019-09-20 11:54:49 -07:00
Ramkumar Chinchani
322190de1e coverage: add unit test cases 2019-09-18 13:29:16 -07:00
Ramkumar Chinchani
4d73d8ff47 version: add commit id to binary during build 2019-09-16 11:58:32 -07:00
Ramkumar Chinchani
bb5ebe6984 issue #14: fix repo path walk 2019-08-29 13:47:59 -07:00
Ramkumar Chinchani
10199457b4 auth: allow for world-readable deployment mode 2019-08-28 15:39:49 -07:00
Ramkumar Chinchani
b6a0077d81 tls: harden TLS path 2019-08-27 15:15:33 -07:00
Ramkumar Chinchani
36ca298507 tls: require mutual auth only when htpasswd not available 2019-07-21 15:10:09 -07:00
Ramkumar Chinchani
066bf1b9eb router: move to gorilla/mux to support multiple name path components 2019-07-10 18:22:20 -07:00
Ramkumar Chinchani
ed2cd51282 routes: fix error codes 2019-06-26 17:30:24 -07:00
Ramkumar Chinchani
bf5273e176 routes: fix headers 2019-06-24 15:09:37 -07:00
Ramkumar Chinchani
9d4e8b4594 zot: initial commit 2019-06-21 15:29:19 -07:00