1
0
mirror of https://github.com/quay/quay.git synced 2025-04-19 21:42:17 +03:00

35 Commits

Author SHA1 Message Date
Marcus Kok
91386aeead
chore: add test case for PROJQUAY-8712 (PROJQUAY-8712) (#3728)
add test case for PROJQUAY-8712
2025-03-21 11:48:22 -04:00
Marcus Kok
f69716b867
marketplace: splittable sku for MW02702 (PROJQUAY-8151) (#3389)
* marketplace: splittable sku for MW02702 (PROJQUAY-8151)
* Alembic migration to drop unique constraint on the orgrhsubscriptions
  table
* Can split sub quantities of MW02702 across multiple orgs
* Can specify quantity for the MW02702 SKU across orgs on react UI
* Update angular UI to allow user to specify quantities for MW02702
2025-01-09 09:37:09 -05:00
Brandon Caton
ec64325edd
api: adding global readonly user to list repo endpoint (PROJQUAY-7446) (#3072)
Adding global readonly user to list repo endpoint.
2024-07-25 11:18:34 -04:00
Brandon Caton
b78a746426
api: adding token to global readonly user list robots (PROJQUAY-7177) (#3073)
Adding robot token to response for global readonly superuser.
2024-07-25 10:06:15 -04:00
Brandon Caton
e4f05583c1
oauth: allowing to assign token to user (PROJQUAY-7074) (#2869)
Allow organization administrators to assign Oauth token to another user.
2024-06-25 09:23:51 -04:00
Marcus Kok
1cc6d5292d
marketplace: check for terminated subscriptions when fetching details (PROJQUAY-7035) (#2834)
check for terminated subscriptions when fetching details
2024-06-06 18:33:32 +00:00
Marcus Kok
131d66d13f
marketplace: add a check for masterEndSystemName when fetching subscriptions (PROJQUAY-6905) (#2775)
* add a check for masterEndSystemName when fetching subscriptions
* allow old SKUs to be used in org attachments
2024-03-25 13:47:22 -04:00
Marcus Kok
5db4251114
marketplace: add expiration check to org subscription operations (PROJQUAY-6716) (#2696)
add expiration check to org subscription operations
2024-03-18 09:15:46 -04:00
Harish Govindarajulu
98811f5397
feat: Add auto-prune policy at repository level (PROJQUAY-6354) (#2691)
* feat: Add support for auto pruning at repository level (PROJQUAY-6354)

* Add repositoryautoprunepolicy table to alembic migration script

* Add repository auto-prune policy endpoints

* Add UI for repository auto-pruning policies

* case: apply repo auto-prune policy when no namespace policy given

* case: both namespace and repo pruning policy are given

* Add tests for repository autoprune endpoint

* Add cypress test for repository auto-prune

* Add repo auto-prune policy clean-up for repository deletion

* Add repository auto pruning tables to quay db snapshot for cypress tests

* Address review comments

* Add more tests + fix CI + reformat files

* Address review comments #2

---------

Signed-off-by: harishsurf <hgovinda@redhat.com>
2024-02-27 15:02:57 +05:30
Marcus Kok
2ab7dc29f4
marketplace: add support for quantity from subscriptions api (PROJQUAY-6551) (#2633)
* Adds handling for when a subscription returned from the subscription watch api has a quantity greater than 1. Number of private repos should be correctly calculated using the quantity.

* Updates ui so that subscriptions can only be added to an org as a group, i.e. a subscription with quantity = 2 cannot be split across organizations.
2024-01-29 15:21:30 -05:00
Marcus Kok
2a4ac09306
billing: marketplace UI (PROJQUAY-6551) (#2595)
* billing: marketplace UI

adds UI in billing section for managing user and org-bound skus

add more unit tests for org binding

changed endpoint for bulk attaching skus to orgs
2024-01-11 11:48:38 -05:00
Marcus Kok
1c893baba5
marketplace: update reconciliationworker to use webCustomerId instead of ebsAccountNumber (PROJQUAY-233) (#2582)
* update reconciliationworker to use webCustomerId instead of
ebsAccountNumber

* fix reconciler where it was incorrectly using the ebsAccountNumber to
  create subscriptions
* add job to reconciler so that it reconciles different ids between the
  database and the user api
* separate skus to be used by billing and skus to be used by reconciler
2024-01-05 16:15:37 -05:00
Kenny Lee Sin Cheong
72f7c64ed6
chore: update werkzeug and related package versions (PROJQUAY-5098) (#1982)
* chore: update werkzeug and related package versions (PROJQUAY-5098)

Path converter related change reference: https://github.com/pallets/werkzeug/issues/2506

* Update query count
2023-09-12 11:51:09 -04:00
Marcus Kok
e44783fe19
billing: Assign SKU to org (PROJQUAY-5363) (#1989)
* add migration for orgrhskus table

* add endpoints for managing and listing skus bound to an org

* create checks in billing flow to look for org-bound skus

* refactor RH marketplace api objects to be more usable in tests

* update cypress test db data and exclude it from pre-commit hook formatting
2023-08-25 14:52:54 -04: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
Kenny Lee Sin Cheong
89725309be
billing: update Stripe checkout to support 3DS (PROJQUAY-5129) (#1818)
Update Stripe checkout in order to support auth requirements from
banks.
2023-04-11 14:41:37 -04:00
Kenny Lee Sin Cheong
6e8e2d2fe7
chore: remove deprecated appr code (PROJQUAY-4992) (#1718) 2023-01-24 10:11:04 +01:00
Harish Govindarajulu
1c8f5df6e2
Add Feature flag to whitelist users from recaptcha check(PROJQUAY-3697) (#1454)
Signed-off-by: harishsurf <hgovinda@redhat.com>
2022-07-22 16:18:45 -04:00
Oleg Bulatov
5eaf0584db
chore: Run mypy as CI job (#1363)
* Run mypy as CI job

* Fix peewee.pyi and configure pyright
2022-06-13 11:01:17 +02:00
Kenny Lee Sin Cheong
5471d3cbcb
secscan: deprecate support for Clair V2 (PROJQUAY-2837) (#951)
Removes read support for Clair V2, along with the need to package
jwtproxy with Quay.

TODO: Drop deprecate image api + image table, remove image data model.
2022-05-31 10:15:54 -04:00
Kenny Lee Sin Cheong
896a3aab3a
api: update the quota api so that it's more consistent with the other apis endpoints (PROJQUAY-2936) (#1221)
* api: update the quota api so that it's more consistent with the other apis (PROJQUAY-2936)

- Uodate the quota api to be more consistent with the rest of the
endpoints
- Handles some uncaught exceptions, such as division by zero
- Update some of the quota data models used by the api to take object
  references instead of names to make it easier to use
- Update table model naming conventions
- swagger operationid multiple nicknames
- Added more test cases for api
- Remove unused functions
- Update the UI for better UX, based on the api changes made

* quota: fix ui input form value

* quota: join quota type query

* Remove unused functions
2022-04-07 14:11:55 -04:00
Sunandadadi
7524171ac8
Proxy Cache: Interface and UI for Proxy cache Configuration (PROJQUAY-3029) (#1204) 2022-03-31 10:48:59 +02:00
Kenny Lee Sin Cheong
02dfc63f42
api: fully deprecate image api endpoints (PROJQUAY-3418) (#1164) 2022-03-22 11:12:39 -04:00
Jonathan King
a29f3e0eea
defaults: Update defaults in config and schema (PROJQUAY-2425) (#923)
- Update defaults in config.pu
2021-10-12 14:47:40 -07:00
thomasmckay
6470248be1
api: /v1/user/initialize to create first user (PROJQUAY-1926) (#771)
Add an unauthenticated API endpoint to create the initial user in the database. Usage is primarily intended for deployment automation.
2021-07-23 12:03:47 -04:00
Kurtis Mullins
bd7252c536
[PROJQUAY-1021] task: Update "Black" to version 20.8b1 2020-11-30 18:48:19 -05: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
Joseph Schorr
f2eaba7ef2
Optimize repository lookup queries to meet the expected maximums (#246)
* Optimize repository lookup queries to meet the expected maximums

We were accidentally looking up more data that strictly allowed

Adds some additional assertions and testing as well

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

* Change loading of repositories in the repo view to be paginated

We drop the "card" view and switch to a table-only view, but still
load the full set of repositories

A followup change will begin to change the UI to only load additional
repos when requested
2020-05-12 12:12:54 -04:00
Joseph Schorr
b211816aba
Implement experimental support for OCI manifests (#279)
* Implement OCI manifest and index support

* Remove unnecessary data model check in registry protocol fixtures

* Implement OCI testing

* Add migration for adding OCI content types

* Remove unused supports_schema2

* Add OCI_NAMESPACE_WHITELIST and reformat with black

* Catch errors in legacy image population and raise appropriately

* Add support for registration of additional artifact types

This change adds the infrastructure to support artifacts in OCI
manifests, but does not yet register any types

* Add a feature flag for enabling experimental Helm support via OCI

See: https://helm.sh/docs/topics/registries/
2020-04-13 11:24:09 -04:00
Joseph Schorr
59bc23313c
Add additional detection for transitive deletes and fix those found (#281)
We were not testing for transitive deletes when performing *User*
deletion, which led us to have a few
2020-03-25 15:58:12 -04:00
alecmerdler
3dd5f045ff fix all the docstrings 2020-02-05 19:55:07 -08:00
Joseph Schorr
6db1910a97 Change repository deletion to occur in the background
Fixes https://issues.redhat.com/browse/PROJQUAY-124
2020-01-27 14:16:01 -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