1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00

21 Commits

Author SHA1 Message Date
Syed Ahmed
e9161cb3ae robots: Add robot federation for keyless auth (PROJQUAY-7803) (#3207)
robots: Add robot federation for keyless auth (PROJQUAY-7652)

adds the ability to configure federated auth for robots by
using external OIDC providers. Each robot can be configured
to have multiple external OIDC providers as the source for
authentication.
2024-09-24 11:32:38 -04:00
dependabot[bot]
d2e5a69b26 build(deps): bump pyjwt from 2.4.0 to 2.8.0 (#2166)
* build(deps): bump pyjwt from 2.4.0 to 2.8.0

Bumps [pyjwt](https://github.com/jpadilla/pyjwt) from 2.4.0 to 2.8.0.
- [Release notes](https://github.com/jpadilla/pyjwt/releases)
- [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/jpadilla/pyjwt/compare/2.4.0...2.8.0)

---
updated-dependencies:
- dependency-name: pyjwt
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Expect new messages

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oleg Bulatov <oleg@bulatov.me>
2023-10-03 14:08:00 +02:00
Kenny Lee Sin Cheong
5f63b3a7bb chore: drop deprecated tables and remove unused code (PROJQUAY-522) (#2089)
* chore: drop deprecated tables and remove unused code

* isort imports

* migration: check for table existence before drop
2023-08-25 12:17:24 -04:00
Oleg Bulatov
ea49bb53a3 chore: Bump mypy (#1962) 2023-06-28 13:47:32 +02:00
Modassar Rana
618945b607 Added support for IBMZ (#1737)
Updated support for Z
2023-02-17 15:04:04 +01:00
Dave O'Connor
db225c3293 Bump PyJWT (#1465) 2022-08-08 11:02:09 -04:00
Kenny Lee Sin Cheong
6ed0bcdedc auth: allow rs384 in jwt (PROJQUAY-4148) (#1449)
Allow the use of RS384 for jwt and oidc.
2022-07-18 14:03:27 -04:00
Brandon Caton
58b0657255 Revert "schema1: Permit signed schema1 manifests during conversion (PROJQUAY-PROJQUAY-3285) (#1146)" (#1150)
This reverts commit b5bd74bf05.
2022-02-25 16:31:23 -05:00
Brandon Caton
b5bd74bf05 schema1: Permit signed schema1 manifests during conversion (PROJQUAY-PROJQUAY-3285) (#1146)
Currently if an image with an OCI manifest is requested and the client does not support Docker Schema 2 or OCI manifests it will default to returning an unsigned Docker V2 Schema 1 manifest. Older clients who send a application/vnd.docker.distribution.manifest.v1+prettyjws media type header expect a signed Docker V2 Schema 1 manifest and break when an unsigned manifest is recieved. This change defaults to returning a signed manifest for OCI images if the application/vnd.docker.distribution.manifest.v1+prettyjws is present before falling back to an unsigned manifest.
2022-02-25 13:15:31 -05:00
mosen
fca67e7729 feat: mypy type annotations (PROJQUAY-740) (#455)
* Add dev dependencies mypy and typing

* Add makefile target `types-test`, not yet included in `test` target.

* Generate stubs for imported modules to avoid mypy complaining about missing types.

* Remove generated stubs as there are way too many and they cause tons of mess in the repo. Switched to ignoring untyped modules for now, to concentrate on Quay-only type checking.

* mypy config changed to ignore missing imports

* ignore property decorator as it is not supported by mypy

* mypy annotations for many configuration variables

* re-generate mypy_stubs directory as its necessary in some classes for base classes to prevent mypy errors

* util/registry/queuefile referred to non existent definition of Empty class in multiprocessing.queues

* ignore type checking for things like monkey patching and exported/re-imported objects that 
mypy does not allow.

* Adjust mypy config to warn us about unreachable return paths and useless expressions.

* Add the __annotations__ property to INTERNAL_ONLY_PROPERTIES so that it is not part of the config schema testing

* Remove redundant dependencies `typing` and `typing-extensions` which are NOOP after Python 3.5

* Remove mypy-extensions which only provides a TypedDict implementation but has not been updated since 2019.

* updated mypy to 0.910 which requires all types packages to be installed manually.

* exclude local-dev from type checking until core team can suggest an outcome for __init__.py duplicate packages

* re-add typing dependency which will be needed until Python 3.9

* ignore .mypy_cache

* add mypy stub for features module to replace inline definitions

* import annotations eager evaluation in billing.py as it was required to reference a class declared later in the module.

* remove the type definition of V1ProtocolSteps/V2ProtocolSteps to make tox happy
2021-10-25 09:56:26 +02:00
Kenny Lee Sin Cheong
7d9a49da10 Replace jwkest with authlib (#685)
* Replace jwkest with authlib and PyCrypto with cryptography

Remove pycryptodome dependencies.
Remove post-fork random seed init - python-cryptography's pseudo RNG should be fork safe:
- https://cryptography.io/en/latest/security.html?highlight=fork
- https://cryptography.io/en/latest/hazmat/backends/openssl.html?highlight=fork#os-random-engine

* deps: Pin cryptography to 3.3.1

Latest available version available on RHEL.
As of 3.4, cryptography builds on rust, which is not readily available
on RHEL.
2021-03-15 15:25:23 -04:00
Kenny Lee Sin Cheong
4785f2d119 Deprecate use of pycryptodome for AES (#679)
Since we're already using the cryptography package elsewhere, there is
no need to have 2 different crypto packages as dependencies.
2021-03-08 13:33:44 -05:00
Kurtis Mullins
bd7252c536 [PROJQUAY-1021] task: Update "Black" to version 20.8b1 2020-11-30 18:48:19 -05:00
Kurtis Mullins
9ccb3ea9b2 [PROJQUAY-1190] fix: Use Python3 strings for user-facing tokens (#589) 2020-10-27 12:28:52 -04:00
Louis DeLosSantos
0a9487f8ac notifications: add incoming jwt verification (#568)
this commit adds jwt verification to the notifications post endpoint.

Signed-off-by: ldelossa <ldelossa@redhat.com>

Co-authored-by: ldelossa <ldelossa@localhost.localdomain>
2020-10-08 14:35:39 -04:00
Joseph Schorr
0e628b1569 Deprecate Image rows and move to in-memory synthesized legacy images [Python 3] (#442)
* Change verbs to use a DerivedStorageForManifest table instead of DerivedStorageForImage

This allows us to deprecate the DerivedStorageForImage table.

Fixes https://issues.redhat.com/browse/PROJQUAY-519

* Change uploaded blob tracking to use its own table and deprecate
RepositoryTag

* Start recording the compressed layers size and config media type on the
manifest row in the database

NOTE: This change includes a database migration which will *lock* the
manifest table

* Change tag API to return the layers size from the manifest

* Remove unused code

* Add new config_media_type field to OCI types

* Fix secscan V2 test for us no longer writing temp images

* Remove unused uploading field

* Switch registry model to use synthetic legacy images

Legacy images are now (with exception of the V2 security model) read from the *manifest* and sythensized in memory. The legacy image IDs are generated realtime based on the hashids library. This change also further deprecates a bunch of our Image APIs, reducing them to only returning the image IDs, and emptying out the remaining metadata (to avoid the requirement of us loading the information for the manifest from storage).

This has been tested with our full clients test suite with success.

* Add a backfill worker for manifest layers compressed sizes

* Change image tracks into manifest tracks now that we no longer have
manifest-less tags

* Add back in the missing method

* Add missing joins to reduce extra queries

* Remove unnecessary join when looking up legacy images

* Remove extra hidden filter on tag queries

* Further DB improvements

* Delete all Verbs, as they were deprecated

* Add back missing parameter in manifest data type

* Fix join to return None for the robot if not defined on mirror config

* switch to using secscan_v4_model for all indexing and remove most of secscan_v2_model code

* Add a missing join

* Remove files accidentally re-added due to rebase

* Add back hashids lib

* Rebase fixes

* Fix broken test

* Remove unused GPG signer now that ACI conversion is removed

* Remove duplicated repomirrorworker

* Remove unused notification code for secscan. We'll re-add it once Clair
V4 security notifications are ready to go

* Fix formatting

* Stop writing Image rows when creating manifests

* Stop writing empty layer blobs for manifests

As these blobs are shared, we don't need to write ManifestBlob rows
for them

* Remove further unused code

* Add doc comment to _build_blob_map

* Add unit test for synthetic V1 IDs

* Remove unused import

* Add an invalid value test to synthetic ID decode tests

* Add manifest backfill worker back in

Seems to have been removed at some point

* Add a test for cached active tags

* Rename test_shared to not conflict with another same-named test file

Pytest doesn't like having two test modules with the same name

* Have manifestbackfillworker also copy over the config_media_type if present

Co-authored-by: alecmerdler <alecmerdler@gmail.com>
2020-07-28 13:03:10 -04:00
Kurtis Mullins
38be6d05d0 Python 3 (#153)
* Convert all Python2 to Python3 syntax.

* Removes oauth2lib dependency

* Replace mockredis with fakeredis

* byte/str conversions

* Removes nonexisting __nonzero__ in Python3

* Python3 Dockerfile and related

* [PROJQUAY-98] Replace resumablehashlib with rehash

* PROJQUAY-123 - replace gpgme with python3-gpg

* [PROJQUAY-135] Fix unhashable class error

* Update external dependencies for Python 3

- Move github.com/app-registry/appr to github.com/quay/appr
- github.com/coderanger/supervisor-stdout
- github.com/DevTable/container-cloud-config
- Update to latest mockldap with changes applied from coreos/mockldap
- Update dependencies in requirements.txt and requirements-dev.txt

* Default FLOAT_REPR function to str in json encoder and removes keyword assignment

True, False, and str were not keywords in Python2...

* [PROJQUAY-165] Replace package `bencode` with `bencode.py`

- Bencode is not compatible with Python 3.x and is no longer
  maintained. Bencode.py appears to be a drop-in replacement/fork
  that is compatible with Python 3.

* Make sure monkey.patch is called before anything else (

* Removes anunidecode dependency and replaces it with text_unidecode

* Base64 encode/decode pickle dumps/loads when storing value in DB

Base64 encodes/decodes the serialized values when storing them in the
DB. Also make sure to return a Python3 string instead of a Bytes when
coercing for db, otherwise, Postgres' TEXT field will convert it into
a hex representation when storing the value.

* Implement __hash__ on Digest class

In Python 3, if a class defines __eq__() but not __hash__(), its
instances will not be usable as items in hashable collections (e.g sets).

* Remove basestring check

* Fix expected message in credentials tests

* Fix usage of Cryptography.Fernet for Python3 (#219)

- Specifically, this addresses the issue where Byte<->String
  conversions weren't being applied correctly.

* Fix utils

- tar+stream layer format utils
- filelike util

* Fix storage tests

* Fix endpoint tests

* Fix workers tests

* Fix docker's empty layer bytes

* Fix registry tests

* Appr

* Enable CI for Python 3.6

* Skip buildman tests

Skip buildman tests while it's being rewritten to allow ci to pass.

* Install swig for CI

* Update expected exception type in redis validation test

* Fix gpg signing calls

Fix gpg calls for updated gpg wrapper, and add signing tests.

* Convert / to // for Python3 integer division

* WIP: Update buildman to use asyncio instead of trollius.

This dependency is considered deprecated/abandoned and was only
used as an implementation/backport of asyncio on Python 2.x
This is a work in progress, and is included in the PR just to get the
rest of the tests passing. The builder is actually being rewritten.

* Target Python 3.8

* Removes unused files

- Removes unused files that were added accidentally while rebasing
- Small fixes/cleanup
- TODO tasks comments

* Add TODO to verify rehash backward compat with resumablehashlib

* Revert "[PROJQUAY-135] Fix unhashable class error" and implements __hash__ instead.

This reverts commit 735e38e3c1d072bf50ea864bc7e119a55d3a8976.
Instead, defines __hash__ for encryped fields class, using the parent
field's implementation.

* Remove some unused files ad imports

Co-authored-by: Kenny Lee Sin Cheong <kenny.lee@redhat.com>
Co-authored-by: Tom McKay <thomasmckay@redhat.com>
2020-06-05 16:50:13 -04:00
alecmerdler
3dd5f045ff fix all the docstrings 2020-02-05 19:55:07 -08:00
Jimmy Zelinskie
5b3db536ef util/metrics: remove metricqueue abstraction
This change replaces the metricqueue library with a native Prometheus
client implementation with the intention to aggregated results with the
Prometheus PushGateway.

This change also adds instrumentation for greenlet context switches.
2019-12-05 12:05:43 -05:00
Tom McKay
e6ae94db8b 'make black' results 2019-12-02 12:23:08 -05:00
Jimmy Zelinskie
9c0dd3b722 initial import for Open Source 🎉 2019-11-12 11:09:47 -05:00