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

142 Commits

Author SHA1 Message Date
OpenShift Cherrypick Robot
4c7b5f13d1 [redhat-3.12] api: allowing superuser to read catalog endpoint (PROJQUAY-8023) (#3333)
Allows for the full access and global readonly superuser to read all repositories from the /v2/_catalog endpoint.

---------

Co-authored-by: bcaton <bcaton@redhat.com>
2024-10-16 14:22:57 +00:00
OpenShift Cherrypick Robot
5377be160d [redhat-3.12] bug: fixing NaN value error for quota displayed on member org page (PROJQUAY-6465) (#3329)
bug: fixing NaN value error for quota displayed on member org page (PROJQUAY-6465)

---------

Co-authored-by: Shubhra Deshpande <shubhrajayant+github.com>
2024-10-15 17:52:48 +00:00
OpenShift Cherrypick Robot
c09555c9e7 [redhat-3.12] api: adding global readonly user to list repo endpoint (PROJQUAY-7446) (#3085)
Adding global readonly user to list repo endpoint.

Co-authored-by: bcaton <bcaton@redhat.com>
2024-07-25 13:37:46 -04:00
OpenShift Cherrypick Robot
cd29306bf4 [redhat-3.12] api: adding token to global readonly user list robots (PROJQUAY-7177) (#3083)
Adding token to list robots api when calling as global readonly superuser.

Co-authored-by: bcaton <bcaton@redhat.com>
2024-07-25 10:50:38 -04:00
OpenShift Cherrypick Robot
4df87fbe09 [redhat-3.12] api: adding global readonly superuser to superuser endpoints (PROJQUAY-7449) (#3076)
Giving global readonly superuser permissions to superuser endpoints.

Co-authored-by: bcaton <bcaton@redhat.com>
2024-07-25 10:01:52 -04:00
OpenShift Cherrypick Robot
9acc9142d0 [redhat-3.12] api: adding permissions for global readonly superuser (PROJQUAY-7177) (#3010)
Adding permissions for global readonly superuser


---------

Co-authored-by: bcaton <bcaton@redhat.com>
2024-07-09 15:42:02 -04:00
Sunandadadi
6688bcca09 backend: implement basic functionality (PROJQUAY-7076) (#2984)
* database: adding subject_backfilled index to manifest table (PROJQUAY-7360) (#2963)

adding subject_backfilled index to manifest table

* Rebasing with main

* updating cypress data

* fixing conflicts and rebasing with latest code

* adding tests

* Forcing an empty commit.

* Forcing an empty commit.

* skip_locked test fix

* adding tests

* minor fixes

---------

Co-authored-by: Brandon Caton <bcaton@redhat.com>
2024-06-27 16:48:39 -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
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
dbfb47d6fb marketplace: change redhatsubscriptions model to return a list of customer ids (PROJQUAY-7129) (#2868)
* marketplace: change redhatsubscriptions model to return a list of customer ids (PROJQUAY-7129)

* Use list comprehension in model and expect to return None if no rows are
returned

* fix behavior for reconciler and fix unit test for reconciler
2024-05-09 11:51:06 -04:00
Daniel Messer
470141eb87 api: human-readable limit requests for quotas (PROJQUAY-7122) (#2847)
* human-readable limit requests for quotas

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

* guidance on limit format errors

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

---------

Signed-off-by: dmesser <dmesser@redhat.com>
2024-05-03 14:37:00 -04:00
Brandon Caton
f241767005 api: reducing db calls in repo list endpoints with quota enabled (PROJQUAY-6895) (#2770)
Reducing the number of DB calls in the repo list endpoint with quota enabled by:
- Adding the id to RepositoryBaseElement when the repositories are initially fetched, removing the need to fetch the repository ID's again
- Fetching the repository sizes with a single DB call using the IN operator
2024-03-26 10:33:24 -04:00
Marcus Kok
6f2905b10e logs: add action log for team sync enable/disable (PROJQUAY-6763) (#2750)
* add action log for team sync enable/disable
* adds alembic migration for team sync logs added to log kind table
2024-03-18 14:22:23 -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
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
Kenny Lee Sin Cheong
be4edd02a3 cache: add caching for manifest requests (PROJQUAY-6482) (#2522) 2024-03-04 16:56:56 -05:00
Sunandadadi
74fd23d7d3 backend: Syncing teams with OIDC group (PROJQUAY-6290) (#2693) 2024-02-27 16:53:51 -05: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
Ivan Bazulic
46d1322ca7 api: Return layer compressed size with manifest request (PROJQUAY-6616) (#2627)
Previously, we weren't returning the total compressed layer size (in bytes) which is part of the manifest table. This makes it cumbersome to identify the real size of an image via `api/v1/repository/{LOCATION}/manifest/{manifestref}` endpoint since only individual layer sizes were returned and the total would then need to be manually summed over each individual layer. With this change, the API endpoint will return the compressed size of all layers if we're referencing a real image, if a reference points to an OCI index or a manifest list, the returned size will be 0.
2024-01-22 11:49:39 -05:00
Daniel Messer
e8ff33e728 logs: add failure logging for login, push, pull and delete events (PROJQUAY-5411) (#1903)
* add login failure logging

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

* move failure logging into credential validation

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

* more precise tracking of affected users

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

* fix indent

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

* differentiate robots with wrong credentials

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

* don't audit failures by default

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

* discrete failure tracking for logins, push, pulls and deletes

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

* refine log metadata

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

* login failure log visualization

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

* properly use data model

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

* fix unit test bug

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

* track non-existing repos differently

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

* log view visualization of failed pushes and pulls

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

* ensure all tests are conducted with failure logging

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

* additional unicode protection

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

* python black formatting

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

* add cypress test data

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

* add safety checks for ascii conversion attempts

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

* adjusting unit test with correct error message

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

* update to alembic head

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

* add standard oauth token metadata in audit

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

* update alembic head

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

* correct field name

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

* formatting

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

* bump alembic head

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

* refactor auth logging imports

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

* bump alembic head

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

* formatting

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

* restore module

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

* pre-commit fixes

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

* adding missing default

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

* bump alembic head

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

* update test data

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

* refactoring to save db calls

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

* fix unit tests

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

* handle unicode conversion errors on email look up

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

* bump alembic head

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

* proper debug logging and conditional db calls

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

* omit wildcard import

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

* re-add import

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

---------

Signed-off-by: dmesser <dmesser@redhat.com>
2024-01-16 16:46:20 +01:00
Sunandadadi
a7737722fc cache: adding caching on look_up repository (PROJQUAY-6472) (#2521)
* adding caching on look_up repository

* fixing query count in tests

* fixing tests

* isort fix
2024-01-16 09:58:56 -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
Brandon Caton
236e2fe4fd autoprune: adding audit logs to namespace autoprune policy API (PROJQUAY-6229) (#2431)
Add's audit logs to the CRUD endpoints for both user and organization namespace auto-prune policies.
2023-12-04 13:51:52 -05:00
Brandon Caton
aaba7539b9 api: adding nickname decorator to autoprune policy endpoints (PROJQUAY-6483) (#2524)
Adding nickname decorator to auto-prune policy endpoints
2023-12-04 09:14:41 -05:00
Kenny Lee Sin Cheong
0b6b1598de billing: apply free trial to stripe checkout sessions (PROJQUAY-6405) (#2491) 2023-11-15 16:38:55 -05:00
Sunandadadi
21e502f86e api: graceful error handling for robot acct already exists (PROJQUAY-6261) (#2436)
* Using try except to catch errors + added tests

* catching InvalidRobotException
2023-10-31 11:37:47 -04:00
Brandon Caton
e5a5e17814 api: accepting empty body for create robot endpoints (PROJQUAY-6224) (#2420)
accepting empty body for create robot endpoints
2023-10-19 09:39:32 +02:00
Brandon Caton
22c4bbfee5 autoprune: add auto-prune policy endpoints (PROJQUAY-6096) (#2393)
Add's the endpoints to create, update, delete, get, and list organization and user auto-prune policies.
2023-10-10 16:38:46 -04:00
Brandon Caton
dcdf132fce quota: removing extra calls to get namespace quotas (PROJQUAY-6048) (#2267)
Caches the result of retrieving the namespace quota limit.
2023-09-29 15:15:03 -04:00
Oleg Bulatov
84fa795ae7 chore: fix isort config and remove isort: skip_file (#2196)
* chore: pass config to isort as it doesn't always detect it

* chore: mark package "test" as local, not stdlib

* chore: remove "isort: skip_file"

* chore: fix app in test_load_security_information

* chore: fix app in test_notification

* chore: fix app in test_index_report
2023-09-21 11:46:03 -04:00
Syed Ahmed
54fcfd14f9 secscan: Cache clair vuln reports (PROJQUAY-6057) (#2245)
uses modelcache to for caching clair security report responses
2023-09-20 20:33:41 +00: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
Sunandadadi
c93b6d080d api: fix duplicate robot accounts (PROJQUAY-5931) (#2192)
* api: fix duplicate robot accounts (PROJQUAY-5931)

* fixing formating

* referecing named tuples by names
2023-09-01 12:03:33 -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
0ea4826956 secscan: garbage collect manifests (#1663)
Garbage collect manifests no longer referenced in Quay from the
security scanner service.

Also moved quota related code from data/registry_model/ to data/model/
to avoid circular dependencies.
2023-07-06 11:59:47 -04:00
Oleg Bulatov
ea49bb53a3 chore: Bump mypy (#1962) 2023-06-28 13:47:32 +02:00
Ivan Bazulic
d7864ed4ee ui: Add custom TOS support (PROJQUAY-5648) (#1973)
* ui: Add custom TOS support
Enable adding of a custom TOS in the Quay footer for on-premise installations via the optional `TERMS_OF_SERVICE` config flag.
If the flag is not defined, the TOS field will not be visible on Quay rendering. Also changes the behaviour of the discovery endpoint to include custom terms of service instead of pointing to Quay.io terms of service for all installations.

* Fix formatting errors

* Fix TOS page for Quay.io deployments

* Change TOS variable name to TERMS_OF_SERVICE_URL for better clarity

* Removed reference to Quay.io from the discovery endpoint description
2023-06-19 11:44:52 -04:00
Brandon Caton
e38d70f0cb api: add permanently delete tag usage log (PROJQUAY-5496) (#1887)
Now logging the permanently delete tag as a usage log.
2023-06-02 10:43:14 -04:00
Harish Govindarajulu
e349762d78 proxy: Allow anonymous pulls from registries (PROJQUAY-5273) (#1906)
This change allows validation of proxy cache config api to support anonymous pulls
when the registry returns a 401 since repo name is not known during initial proxy config

Signed-off-by: harishsurf <hgovinda@redhat.com>
2023-05-25 11:53:15 -04:00
Marcus Kok
de8c48fa28 marketplace: fixing allowed repo count (PROJQUAY-5513) (#1891)
* Aggregate stripe plans and subscriptions.

* Validate end date for subscriptions when fetching from marketplace.

* Check subscription returned from stripe api is non-null value when
finding stripe plan for sku.
2023-05-25 10:46:58 -04:00
Brandon Caton
6cf0a3531b quota: calculating registry size (PROJQUAY-5476) (#1879)
Allows superusers to trigger a calculation of the deduplicated registry size. A superuser can go to the organization panel of the superuser page and select Calculate to queue a calculation of the registry total. The total will only be calculated when requested. Includes warning to user of increase of database load when running calculation.
2023-05-24 17:10:40 -04:00
Brandon Caton
9adf2d8cf0 superuser: paginate user's list (PROJQUAY-4297) (#1881)
Allow loading of superuser user list for larger registries by paginating API call.
2023-05-18 11:20:30 -04:00
Brandon Caton
c505a6bae8 superuser: paginating superuser organization list (PROJQUAY-4297) (#1876)
Allows super user organization list to load for larger registries.
2023-05-17 14:49:09 -04:00
Daniel Messer
41cd8330d0 logs: add audit log events for login/logout to Quay (PROJQUAY-2344) (#1866)
* add auditing of login and logout events

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

* python black formatting

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

* correctly identify username during

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

* revert change to existing code

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

* remove superfluous ip tracking

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

* beautify login messages

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

* remove unused import

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

* move alembic patch to head

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

* correctly log target namespace for robots

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

* python black formatting

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

* login event detection refinement

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

* add missing visualization

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

* enrich login event data

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

* make login auditing configurable

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

* make update-testdata

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

---------

Signed-off-by: dmesser <dmesser@redhat.com>
2023-05-17 11:22:35 +02: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
Kenny Lee Sin Cheong
2d949b3b2e billing: allow changing subscription on empty stripe_id (PROJQUAY-5413) (#1857)
Fix to allow non-stripe user changing to free plan in order to convert
from user to organization.
2023-05-03 10:01:13 -04:00