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

26 Commits

Author SHA1 Message Date
Shaon H
92b6f4729a feat(mirror): organization-level mirror config CRUD APIs (PROJQUAY-1266) (#4923)
* mirror: Add FEATURE_ORG_MIRROR feature flag (PROJQUAY-1266)

Add organization-level repository mirroring feature flag to enable
the new org mirroring functionality. Feature is disabled by default.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* mirror: Add GET endpoint for org mirror config (PROJQUAY-1266)

Implements the GET /v1/organization/<org>/mirror endpoint to retrieve
organization-level mirror configuration. Includes business logic layer
with get_org_mirror_config() and comprehensive unit tests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* mirror: Add POST endpoint for org mirror config (PROJQUAY-1266)

Add create endpoint for organization-level mirror configuration:
- POST /v1/organization/<orgname>/mirror creates new config
- Validates robot account ownership and credentials
- Returns 201 on success, 409 if config already exists

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* mirror: Add DELETE endpoint for org mirror config (PROJQUAY-1266)

Add delete endpoint for organization-level mirror configuration:
- DELETE /v1/organization/<orgname>/mirror removes config
- Also deletes all associated discovered repositories
- Returns 204 on success, 404 if config doesn't exist

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* mirror: Add PUT endpoint for org mirror config (PROJQUAY-1266)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix test failure

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 16:01:15 -08:00
jbpratt
a49ccd6333 feat(endpoints): add tag immutability API layer (PROJQUAY-10159) (#4839)
Expose tag immutability through the existing tag REST API endpoint.
This adds:
- immutable field to PUT /api/v1/repository/{repo}/tag/{tag}
- TagImmutable 409 exception for blocked operations
- immutable field in tag list responses
- Exception handling for DELETE and PUT on immutable tags

Write permission required to lock, admin required to unlock.

Signed-off-by: Brady Pratt <bpratt@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-01-16 11:09:14 -05:00
Shubhra Deshpande
49ff0da0c2 feat: Added Redis database and Redis flush worker (PROJQUAY-7176) (#4321)
* Added redis database and redis flush worker

* updated digest validation

* adding test coverage for scan_keys function

* adding test coverage

* added tests for scan function

* added coverage for flush to database function

* added coverage for gnuicorn worker initialization

* Replaced mock methods in the test with actual function calls

---------

Co-authored-by: shudeshp <shudeshp@redhat.com>
2025-10-17 09:27:11 -04:00
Kenny Lee Sin Cheong
40031c2356 proxycache: fix queueitem payload for proxycachblobworker (PROJQUAY-9018) (#4076)
* proxycache: fix queueitem payload for proxycachblobworker (PROJQUAY-9018)

* Add feature flag for proxycacheblobworker

* PROXY_CACHE_BLOB_DOWNLOAD stub
2025-06-18 12:34:43 -04:00
Kenny Lee Sin Cheong
e838a58b54 util: Add opentelemetry support (PROJQUAY-8902) (#3863)
Instrument psycog2 and Flask for tracing with OpenTelemetry
---------

Co-authored-by: Marcus Kok <mkok@redhat.com>
2025-05-07 19:55:27 +00:00
Kenny Lee Sin Cheong
5f8ca041e7 ui: implement change to render modelcard stored in layers (PROJQUAY-8642) (#3692)
* ui: implement change to render modelcard stored in layers (PROJQUAY-8412)

When a manifest has certain annotations or artifactTypes, render the
applicable modelcard markdown in a new tags detail tab.

* removing untar when fetching model card

* removing extra api calls

* Add modelcar check tests

---------

Co-authored-by: bcaton <bcaton@redhat.com>
2025-03-05 19:14:22 +00:00
Sunandadadi
13f6cd590c featureflag: add feature flag for image expiry trigger (PROJQUAY-7460) (#3007)
* feature flag: add feature flag for image expiry trigger (PROJQUAY-7460)

* add FEATURE_IMAGE_EXPIRY_TRIGGER to CLIENT_WHITELIST

* minor fix

* setting IMAGE_EXPIRY_TRIGGER to true for testing

* fixing config.json
2024-07-08 17:43:14 -04:00
Brandon Caton
7ef664a646 autoprune: Registry level autopruning (PROJQUAY-7392) (#2950)
Allows for adding a default autopruning policy that will be applied to all namespaces.
2024-06-26 16:43:31 -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
Brandon Caton
d1124350ba api: adding endpoints to FEATURE_SUPERUSERS_FULL_ACCESS (PROJQUAY-7045) (#2924)
Adding permissions to additional endpoints when FEATURE_SUPERUSERS_FULL_ACCESS is enabled
2024-06-07 14:10:50 -04:00
Kenny Lee Sin Cheong
4546163e83 registry: implements the OCI 1.1 referrers API (PROJQUAY-7280) (#2597)
* registry: implements the OCI 1.1 referrers API

Migrations:
- Adds a subject column for lookup
- Adds a subject_backfilled column to track status of the backfilling
of existing manifests
- Adds a manifest_json column making use of postgres' JSONB support,
for future use.

Manifestsubjectbackfillworker: Indexes existing manifests for possible
existing subject field.

* Deprecate IGNORE_UNKNOWN_MEDIATYPES

* Cleanup
2024-06-07 13:28:13 -04:00
Brandon Caton
d2a1fedab4 quota: refactor, tests, and optimizations (PROJQUAY-6735) (#2712)
Adds the following changes:
- Additional logging
- Moving checks before expensive DB calls
- Additional tests
2024-03-06 09:06:38 -05:00
Brandon Caton
4f0db4b90f quota: feature flagging quota edit/view/enforce (PROJQUAY-6734) (#2709)
feature flagging quota edit/view/enforce functionality
2024-03-05 13:10:18 -05:00
Brandon Caton
0e496b46a5 autoprune: add initial setup for the autoprune feature (PROJQUAY-6094) (#2277)
Adds the auto-prune worker, database models, and feature flag.
2023-10-05 13:37:36 -04:00
Marcus Kok
0a1c7fb22e marketplace: add reconciler (PROJQUAY-5320) (#1817)
marketplace: add reconciler (PROJQUAY-5320)
* check RH marketplace after stripe for private repo creation / changing visibility
* add reconciliation worker that creates RH subscriptions in marketplace for pre-existing stripe customers
2023-05-08 09:48:17 -04:00
Marcus Kok
c3fc3a82ab secscan: send notifications for new indexes (PROJQUAY-4659) (#1813)
On new pushes, allow notifications being sent to user if vulnerabilities are found.
2023-03-29 13:17:52 -04:00
Kenny Lee Sin Cheong
2b3c3cc584 api: feature to limit org creation to superusers (PROJQUAY-1245) (#1516)
* api: feature to limit org creation to superusers

Introduces the following configuration flags:

FEATURE_SUPERUSERS_ORG_CREATION_ONLY:
    Limit org creation to superusers only

FEATURE_SUPERUSERS_FULL_ACCESS:
    Grant superusers read/write access to registry content in all namespaces

FEATURE_RESTRICTED_USERS:
    Users considered as restricted are not anle to create organization

RESTRICTED_USERS_WHITELIST:
    Whitelist for FEATURE_RESTRICTED_USERS

RESTRICTED_USER_INCLUDE_ROBOTS:
    Whether or not to include the user namespace's robots

RESTRICTED_USER_READ_ONLY:
    Only allow read-only operations for restricted users

* Revert superuser repositorylist endpoint
2022-09-23 09:41:23 -04: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
Brandon Caton
9eb4fb6aa4 Revert workqueue refactor (#1456)
Currently the prometheus and GC workers are not running correctly.
Reverting the following commits:
- 4e1a985e70
- dac183a1ef
- 68a0d9eaf0
- af1aacea08
- f334b80098
2022-07-22 13:11:39 -04:00
Oleg Bulatov
dac183a1ef Replace app with singletons.config and workqueues (#1399)
Where it is possible, instead of importing app, import only required
packages.
2022-06-20 12:07:13 +02: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
kwestpharedhat
15fa20a115 QuotaManagement: Reporting (PROJQUAY-2936) (#1048)
* initial commit

* fixing some bugs

* create quota management

Fix json request json type

Creation of quota is working

All quota crud operations

crud for quota limits

repository size reporting

adding registry model

error levels

namespacequota

remove holdover from user file

finalizing refactor to namespace over organization

finalization of functionality

fixing formatting to match with black style

missed some files in formatting

fixing access to attribute

add single test to verify its working

fix some bugs and add defensive catching

bug fixes and code resiliency

Bug fixes and making quota limits detect properly where necessary

remove transitive delete and other bug fixes

fix formatting and trasnitive deletion issues

fix repositorysize does not exist error

fix not nul constraint and add security tests

fix security tests and bug

more security test fixes

reorder security tests

put docker file back and adjust security testing

security tests reduced

Missed changes for status 200

missed additional 201 responses getting 200

security bypass for now

Another tweak to security testing

forgot 1 endpoint

bug fix for parsing dictionary

remove unnecessary check at blob head

add initdb for quota

Incorrect syntax repair

mysql only supports decimal

adding quota specific notifications

optimization

add permission checks

adjust security and add configuration parameter

fix security test for new security levels

Fix logic errors and improve caching

fix logic issue and error reporting

adjust things according to PR comments

fix refactor left overs

miscapitilazation

missed refactor location

refactor code to remove quota limit groupings

fix refactor errors

remove transitive deletion

fix transitive deletes

Transitive deletion work

Transitive deletion work

refactor registry model and remove it

place api behind feature flag

patch feature enabledment for tests

patch feature enabledment for tests

testing to see if the config is the problem

remove patch

fix new org bug

fixing notifications

mismatched parameters

fix org not exists

fixed paramter mismatch

fix nonetype access

fix nonetype access

new tables created user deletion issues

new tables created user deletion issues

parameter mismatch

fix transitive delete

fix model access error

record does not exist missing catch

fix quota deletion to always delete limits

quotalimits deletion on quota deletion

mistake

fix quota limits deletion

patch tests and disable feature

typo

switch to toggle feature

add feature patch to top of file

change testconfigpy

* change permissions

* adjust permissions

* change config access

* fix formatting

* gether feature information differently

* duplicate function name

* fix config name

* type conversion

* config adjustments

* incorrect keyword

* Update security api tests

* duplicate naming

* fix config schema

* revert files and fix error

* QuotaManagement: UI (PROJQUAY-2936) (#1)

* [WIP]: Quota Reporting on Quay UI

* Integrating quota reporting UI with backend

* Humanizing bytes on UI

* Quota Reporting UI on repo table view

* Taking pull and updating code

* Adding quota management view

* Added support for CRUD operations for org quota

* create quota management

Fix json request json type

Creation of quota is working

All quota crud operations

crud for quota limits

repository size reporting

adding registry model

error levels

namespacequota

remove holdover from user file

finalizing refactor to namespace over organization

finalization of functionality

fixing formatting to match with black style

missed some files in formatting

fixing access to attribute

add single test to verify its working

fix some bugs and add defensive catching

bug fixes and code resiliency

Bug fixes and making quota limits detect properly where necessary

remove transitive delete and other bug fixes

fix formatting and trasnitive deletion issues

fix repositorysize does not exist error

fix not nul constraint and add security tests

fix security tests and bug

more security test fixes

reorder security tests

put docker file back and adjust security testing

security tests reduced

Missed changes for status 200

missed additional 201 responses getting 200

security bypass for now

Another tweak to security testing

forgot 1 endpoint

bug fix for parsing dictionary

remove unnecessary check at blob head

add initdb for quota

Incorrect syntax repair

mysql only supports decimal

adding quota specific notifications

optimization

add permission checks

adjust security and add configuration parameter

fix security test for new security levels

Fix logic errors and improve caching

fix logic issue and error reporting

adjust things according to PR comments

fix refactor left overs

miscapitilazation

missed refactor location

refactor code to remove quota limit groupings

fix refactor errors

remove transitive deletion

fix transitive deletes

Transitive deletion work

Transitive deletion work

refactor registry model and remove it

place api behind feature flag

patch feature enabledment for tests

patch feature enabledment for tests

testing to see if the config is the problem

remove patch

fix new org bug

fixing notifications

mismatched parameters

fix org not exists

fixed paramter mismatch

fix nonetype access

fix nonetype access

new tables created user deletion issues

new tables created user deletion issues

parameter mismatch

fix transitive delete

fix model access error

record does not exist missing catch

fix quota deletion to always delete limits

quotalimits deletion on quota deletion

mistake

fix quota limits deletion

patch tests and disable feature

typo

switch to toggle feature

add feature patch to top of file

change testconfigpy

* Removing quota and state conf from repo-list and user-view

* Removing quota and state conf form app list page

* Removing quota conf from repo-list.html

* minor fixes

* Added Quota Repoting and configuring quota from UI

* Making quota configuration component reusable + added support to read bytes via KB, MB, etc + Added reporting for total org consumption + Added org consumption for super user panel + Added quota configurable support on super user panel

* Adding older quota management component

* Removing not reusable quota management component

* Adding % consumption for repo quotas

* Adding % consumption for organization level quota

* Adding check to verify request.args

* Removing todo

* Adding default 0 to quota

* Formatting with black

* Fixing params for tests

* Formatting test file

Co-authored-by: Keith Westphal <kwestpha@redhat.com>

* remove migration

* add migration back

* repair formatting

* QuotaManagement: Moving the logic for bytes conversion to human friendly units to the frontend  (PROJQUAY-2936) (#3)

* Moving the logic for bytes conversion to human friendly units to the frontend

* Reading updates from quota_limit_id

* Formatting using black

* remote unused function

* Adding quota configuring on super user panel (#4)

* Converting quota bytes to human friendly format (#5)

* PR refactors

* invalid reference

* bad return value

* fix bad reference

* bad reference

* fix tests

* Quota Config: UI improvements (#6)

* Quota UI Improvements

* Rendering table for quota limit config

* Removing proxy cache files

* Disabling quota config for org view

* Removing redundant get

* Fixing PR requests

* repair formatting

Co-authored-by: Sunandadadi <Sunandadadi@users.noreply.github.com>
2022-03-08 12:02:03 -06: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
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
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