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

155 Commits

Author SHA1 Message Date
Kenny Lee Sin Cheong
45d00a6b8f superusers: gives superusers access to team invite api (PROJQUAY-4765) (#1694) 2023-01-10 12:36:47 -05:00
Kenny Lee Sin Cheong
fe2b89d656 logs: create action logs on proxy cache config creation/deletion (PROJQUAY-4718) (#1625) 2022-11-22 12:36:57 -05:00
Kenny Lee Sin Cheong
7cd55ea0cd users: fix create repo on push on orgs for restricted users (PROJQUAY-4732) (#1634) 2022-11-22 11:50:16 -05:00
Kenny Lee Sin Cheong
0caa4203ec users: prevent CREATE_NAMESPACE_ON_PUSH is restricted (PROJQUAY-4702) (#1621)
Prevent creating namespaces/orgs on pushes (CREATE_NAMESPACE_ON_PUSH)
if user is restricted.

Also updates RESTRICTED_USERS_WHITELIST to defaults to all if not set,
given that FEATURE_RESTRICTED_USERS is set.
2022-11-09 18:23:01 -05:00
Kenny Lee Sin Cheong
8fc03857cb users: when set, grant superusers repository permissions. (#1620)
When FEATURE_SUPERUSERS_FULL_ACCESS is set, grant superusers
repository permission registry-wide.
2022-11-08 16:48:58 -05:00
Kenny Lee Sin Cheong
ef8ad2c3e1 users: prevent creating repo on push for restricted users (PROJQUAY-4706) (#1614)
Prevent restricted users' from automatically creating repos or orgs
on v2 auth requests (PROJQUAY-4706, PROJQUAY-4708).
2022-11-07 17:41:45 -05:00
Kenny Lee Sin Cheong
64ec15605c superusers: grant superusers additinonal org permissions (PROJQUAY-4687) (#1613)
When FEATURE_SUPERUSERS_FULL_ACCESS is set, grant superusers org admin permissions:
- PROJQUAY-4687
- PROJQUAY-4690
- PROJQUAY-4693
- PROJQUAY-4697
- PROJQUAY-4701
2022-11-07 17:41:18 -05:00
Harish Govindarajulu
ad5e3f8d51 Modify registry auth url for proxy cache validation (PROJQUAY-4585) (#1603)
When authenticating again a registry, if the www-authenticate header
doesn't specify a service, exclude it from the url

Signed-off-by: harishsurf <hgovinda@redhat.com>
2022-11-04 10:13:26 -04:00
Brandon Caton
d34e9399af auth: Adding wraps to user namespace decorator (PROJQUAY-4694) (#1607)
Missing wraps decorator on disallow_for_user_namespace prevents some API endpoints from being discovered on the frontend.
2022-11-03 12:19:34 -04:00
kwestpharedhat
dcf5a377a9 Quay: Cloudfront multi domain (PROJQUAY-4506) (#1598)
Multi domain support for Quay. CLOUDFRONT ONLY
2022-11-02 13:05:14 -05:00
Kenny Lee Sin Cheong
c84067a4d6 users: add restricted users' filter (PROJQUAY-1245) (#1551)
- Similar to LDAP_SUPERUSER_FILTER, add a specific filter to define
restricted users, based on the LDAP_USER_FILTER
- restrict writes on restricted users' own namespace. Normal
permissions applies on organization membership
- add global readonly superuser GLOBAL_READONLY_SUPER_USERS (PROJQUAY-2604)
- Removes RESTRICTED_USER_INCLUDE_ROBOTS, FEATURE_RESTRICTED_READ_ONLY_USERS
2022-10-28 13:38:37 -04:00
Jonathan King
ea90cc4f26 auth: Speed up permissions loading (PROJQUAY-4004) (#1566) 2022-10-14 11:04:32 -07:00
Fredrik Larsson
d5fc1d1956 Clarify date format created by format_date (#1545)
The format created by email.utils.formatdate is RFC 2822, not RFC 822.
2022-10-04 15:23:03 -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
Syed Mushtaq Ahmed
e6be9fc43a storage: Add username field to requests on CloudFront (PROJQUAY-3511) (#1486)
* storage: Add username field to requests on CloudFront (PROJQUAY-3511)

This is to corelate the a user with CDN traffic in CloudFront logs
2022-08-22 10:24:48 -04:00
Syed Mushtaq Ahmed
aefddd36dd api: add OPTIONS method to /config request (PROJQUAY-4276) (#1476)
needed for the new UI to read quay config
2022-08-10 12:44:54 -04:00
Dave O'Connor
db225c3293 Bump PyJWT (#1465) 2022-08-08 11:02:09 -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
Kenny Lee Sin Cheong
871c43eaf3 api: handle missing tag on DELETE tag api (#1444) 2022-07-15 13:47:20 -04:00
Syed Mushtaq Ahmed
bf99e71851 api: Update werkzeug to 1.0.0 and add valid CORS methods (PROJQUAY-4163) (#1443)
werkzeug 1.0.0 allows us to set samesite policy to "None" for CORS
requests from quay-ui
2022-07-14 14:30:52 -04:00
Syed Mushtaq Ahmed
1a016efc80 ui: Add CSRF and token endpoint and public config endpoint (PROJQUAY-3865) (#1323)
Adds /csrf_token and /config API endpoints to enable integration with
the new UI
2022-06-29 12:14:28 -04:00
Oleg Bulatov
366be31896 Update type hints (#1409)
* Update peewee types

Also remove tools/sharedimagestorage.py as it doesn't work anymore.

    tools/sharedimagestorage.py:3: error: "ModelSelect[ImageStorage]" has no attribute "annotate"

* Remove endpoints/api/test/test_security.py from exclude list

* Format storage/test/test_azure.py
2022-06-27 17:52:29 +02:00
Oleg Bulatov
ed8f12ba34 Enable some flake8 checks in CI (#1389) 2022-06-16 18:22:16 +02:00
Flavian Missi
f2c4375f65 fix: enable non-admins to cache images via pull-thru (PROJQUAY-3806) (#1366)
introduces a check of the OrganizationMemberPermission for pulls
against a proxy org.

if the proxy cache feature is disabled, or the org is not a proxy org
the check is not performed and Quay will behave normally.

this check does not mean pulls will work transparently though -
non-admin users need to be added to a team in the proxy org with the
member role, and default read and write permissions need to be given to
that team so that non-admin users can pull and update the cache for
images they do not own (the user who first pulls an image ends up
owning the repository since that is when the repo gets created).
2022-06-14 07:43:05 +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
Syed Mushtaq Ahmed
922a82a3d9 oauth: Add the code param to the oauthrize.html template (PROJQUAY-3648) (#1362)
Fixes an issue where the code param is not passed to the app redirect
URI if the user has not authorized the app before
2022-06-07 13:35:28 -04:00
Sunandadadi
f90e5e3dce Quota: Configuring Quota for user panel(PROJQUAY-3767) (#1334)
* Quota: Configuring Quota for user panel

* Added Quota Consumed column on Super users panel

* Fixing tests

* Fixing tests

* Adding tests for user quota operations

* Reverting org api changes + new endpoint for super user get method

* Reverting changes

* Added tests

* Fetching user namespace or organization
2022-05-31 11:22:37 -04:00
kwestpharedhat
1e4871eca2 Quota: Add Cache To Tag Delete (PROJQUAY-3828) (#1345)
Add quota cache to delete tag
2022-05-27 10:04:21 -05:00
Brandon Caton
fd9a6b2e60 v2auth: Check for user before creating org (PROJQUAY-3766) (#1315)
Currently when Quay is set to automatically create organizations it will check the user table for a matching username with organization set to true. This causes conflicts when a user already exists with the same username, where the check will fail and Quay will attempt to create an organization with the same name as the user. This change checks for only a matching username.
2022-05-11 13:28:34 -04:00
Kenny Lee Sin Cheong
9d8ff6b1c1 quota: address possible integrity exception if computing size concurrently (PROJQUAY-3752) (#1303) 2022-05-09 15:28:01 -04:00
Jonathan King
ad4bb6f185 compliance: Move export screening to RHSSO class (PROJQUAY-2056) (#1302)
- Created a RHSSO class
- Put export compliance logic in class override
2022-05-04 16:30:44 -04:00
Syed Mushtaq Ahmed
6effd4cdec auth: Add state to the oauthorize redirect (PROJQUAY-3648) (#1301)
Fixes issue where state is not passed to the redirect in an Oauth App
2022-05-04 11:11:19 -04:00
Sunandadadi
a983884e0f Quota API: Add super user permissions on Organization endpoints (PROJQUAY-3742) (#1296)
* Quota API: Add super user permissions on Organization endpoints (PROJQUAY-3742)

* Removing super user permissions form userquota endpoints

* Adding super user permission checks

* Moving super user scope decorator to class level
2022-05-02 10:36:02 -04:00
Kenny Lee Sin Cheong
c2ceda5a26 chore: various small changes to fix exceptions, remove unused code (#1295) 2022-04-29 15:11:15 -04:00
Syed Mushtaq Ahmed
edb4e72166 auth: Add state to the oauthorize page (PROJQUAY-3648) (#1292)
Add the `state` parameter to the oauth permissions page
that's rendered when asking user for permission.
2022-04-28 11:58:23 -04:00
kwestpharedhat
f4093b0db5 Quota: fix caching (PROJQUAY-3660) (#1291)
* fix caching

* fix caching race condition
2022-04-28 08:47:42 -05:00
Jonathan King
3140a62e01 Revert "Revert "quayio: Add export compliance service to Red Hat SSO (PROJQUAY-2056) (#1239)" (#1273)" (#1289)
This reverts commit 8324586e4c.
2022-04-27 13:16:53 -07:00
Kenny Lee Sin Cheong
3739c1fc21 notification: fix user ref when creating notification for quota (PROJQUAY-3711) (#1288) 2022-04-27 14:49:53 -04:00
Sunandadadi
5bb2c121b1 Quota: Show a different error message if default quota is set on removing quota (PROJQUAY-3657) (#1287)
* Quota: Show a different error message if default quota is set on removing quota (PROJQUAY-3657)

* Indentation fix
2022-04-27 10:48:33 -04:00
Sunandadadi
2d63be373f Quota API: Remove trailing backslash (PROJQUAY-3625) (#1286) 2022-04-26 18:12:51 -04:00
Sunandadadi
eea7389a24 Quota: Show system default on UI when quota configuration for the org is not set (PROJQUAY-3518) (#1280)
* Quota: Show system default on UI when quota configuration for the org is not set (PROJQUAY-3518)

* Fixing formatting

* Added function to reduce redundancy and shortened warning message

* added missing parameter to function call

* Fixed organization quota consumption view

* Fixing formatting

* Checking for None before calling function
2022-04-22 16:34:04 -04:00
kwestpharedhat
a6d4332016 fix monolithic uploads (#1275) 2022-04-21 12:01:46 -05:00
Sunandadadi
2dca65f9ce API: Removing internal only decorator from exposed Super user endpoints (#1271) 2022-04-21 12:29:11 -04:00
Kenny Lee Sin Cheong
8324586e4c Revert "quayio: Add export compliance service to Red Hat SSO (PROJQUAY-2056) (#1239)" (#1273)
This reverts commit 247fec3b05.
2022-04-20 15:30:54 -04:00
Sunandadadi
cd2889439b Quota Management: Quota settings on Organization view needs to be read only (PROJQUAY-3622) (#1263)
* Quota Management: Quota settings on Organization view needs to be read only (PROJQUAY-3622)

* Adding superuser permissions check on put and delete methods

* Reverting changes

* Reverting changes
2022-04-19 18:16:11 -04:00
Jonathan King
247fec3b05 quayio: Add export compliance service to Red Hat SSO (PROJQUAY-2056) (#1239)
- Add FEATURE_EXPORT_COMPLIANCE to config schema
- Add call to export compliance service during OAuth workflow when feature is enabled
2022-04-18 12:45:29 -04:00
Sunandadadi
3d6545b9da UI: Quota UI enhancements (PROJQUAY-0000) (#1242)
* Tracking aws ip ranges.json

* Reverting change

* Added default quota limit + added error display div + fixed indentation + minor restructuring of html

* Add check for non-negative or zero quota

* Added Limit percent check. numbers between 1-100 only acceptable

* Show warning note if no quota limit is set

* Show warning if no Reject type limit is selected

* Adding Remove button to delete quota configuration

* If Reject does not exist add default reject quota limit + css

* Throw error if more than one Reject Limit Type

* Throw error on identical limits

* Fixing showing default limits

* Added Organization view settings

* Show Remove btn only if quota exists

* Fixing Remove modal pop up

* Quota Reporting if quota is not set

* Fixing Removing Quota for org

* Fixing super user and org admin permissions

* fix to checking default quota

* Added super user perms check on put, delete endpoints

* Fixing formatting

* Fixing multiple rejects checks + returing empty list instead of None

* Using super user API calls + hiding policy div till quota is set

* Added require_scpe and show_if decorators for super user permissions

* fixing configured quota check after return type changed from None to list
2022-04-14 10:33:20 -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
Flavian Missi
514bc6f1ba registry_proxy_model: count repository size when caching images (PROJQUAY-3464) (#1215)
also check if the org is within its quota limits before caching an image
from the upstream registry.
2022-03-31 16:38:13 +02:00
Sunandadadi
7524171ac8 Proxy Cache: Interface and UI for Proxy cache Configuration (PROJQUAY-3029) (#1204) 2022-03-31 10:48:59 +02:00