Commit graph

147 commits

Author SHA1 Message Date
Tomas Kopecek
8902675489 further changes 2022-12-08 09:57:35 +01:00
Tomas Kopecek
95912eb314 Move hub code to site-packages
Related: https://pagure.io/koji/issue/3587
2022-12-08 09:57:35 +01:00
Jana Cupova
21c8c0f681 Remove krbLogin API
Fixes: https://pagure.io/koji/issue/3593
2022-11-24 13:59:17 +01:00
Jana Cupova
7b53236925 Use inspect.getfullargspec instead of getargspec on hub and web
Fxes: https://pagure.io/koji/issue/3591
2022-11-20 09:32:23 +01:00
Tomas Kopecek
e9ebe2250d build policy
New 'build' policy replacing 'build_from_srpm' and 'build_from_repo_id'.

Related: https://pagure.io/koji/issue/3323

Author:    Tomas Kopecek <tkopecek@redhat.com>
2022-11-10 15:47:44 +01:00
Tomas Kopecek
eca9ac0282 remove unused code 2022-11-10 11:07:03 +01:00
Tomas Kopecek
dbb6d60e4f separate headers 2022-11-10 11:07:03 +01:00
Tomas Kopecek
82d2d4dd55 use header-based auth 2022-11-10 11:07:03 +01:00
Tomas Kopecek
850a161e2b cookies-based sessions
Related: https://pagure.io/koji/issue/3393
2022-11-10 11:07:03 +01:00
Jana Cupova
1cfe6538db Move database classes and functions from kojihub.py to koji/db.py
Move QueryProcessor, InsertProcessor, UpdateProcessor,
BulkInsertProcessor, _applyQueryOpts, get_event, _dml,
_fetchMulti, _fetchSingle, _singleValue, _multiRow, _singleRow

Update koji-sweep-db script to DB Processors

Fixes: https://pagure.io/koji/issue/3466
2022-10-11 14:29:05 +02:00
Tomas Kopecek
03f3d92a00 more verbose default policy denials
Related: https://pagure.io/koji/issue/3397
2022-07-11 09:47:13 +02:00
Tomas Kopecek
f72f033465 fix flake8 2022-05-04 15:25:36 +02:00
Mike McLean
c5ca8f39b9 log content-length when we get an error reading request
Fixes https://pagure.io/koji/issue/3288
2022-05-04 15:19:38 +02:00
Mike McLean
f89794ce07 also raise 400 errors when we can't read the client upload stream 2022-03-21 14:34:30 +01:00
Mike McLean
37b108bf24 fix indent 2022-03-21 14:34:30 +01:00
Mike McLean
3ece0d8e05 return 400 codes when client fails to send a full request
Fixes: https://pagure.io/koji/issue/3268
2022-03-21 14:34:30 +01:00
Jana Cupova
d80f956dc1 RLIMIT_OFILE alias for RLIMIT_NOFILE
Fixes: https://pagure.io/koji/issue/3101
2021-12-13 17:25:43 +01:00
Jana Cupova
f4616d4ee2 Deprecated hub option DisableGSSAPIProxyDNFallback
Fixes: https://pagure.io/koji/issue/3100
2021-12-13 17:20:22 +01:00
Jana Cupova
74ac826a87 Add limits on name values
Fixes: https://pagure.io/koji/issue/2117
2021-12-09 07:11:57 +01:00
Tomas Kopecek
038a2f1850 rename ProxyAuthType -> AllowProxyAuthType 2021-11-04 12:07:05 +00:00
Tomas Kopecek
24e5c0cb45 further fixes (will be squashed before merge) 2021-11-04 12:07:05 +00:00
Yu Ming Zhu
601cd33902 use scm_ as the prefix instead of scm for scminfo 2021-08-16 17:55:26 +00:00
Yu Ming Zhu
47c4b5d70b kojid: extend SCM.assert_allowed with hub policy
This is a simple extention of `SCM.assert_allowed`

- `assert_allowed_by_policy` will set the default "use_common" to False which is different to the old behavior
- `channel`, `user_id`, `scratch` are passed in the `policy_data` with scminfo right now.

This is a prototype for this change, and there are some other solutions could be implemented too

- Use a scmpolicy plugin as `postSCMCheckout` callback, the pro is that we can do more checks after the source is initialized on builder, meanwhile, the con is that the source will be downloaded even it is denied by policy. It might be a potential risk?
- Do the scm check in hub's `make_task`, this looks straightforward, but may lack some builder's information

fixes: #2757
2021-08-16 17:55:26 +00:00
Tomas Kopecek
44c89e3516 DBConnectionString/dsn option for db connection
Alternative DSN connection string fro connecting to postgres. Allow us
to specify e.g. sslmode without adding separate DB* options.

Fixes: https://pagure.io/koji/issue/2838
2021-07-20 11:49:06 +02:00
Yuming Zhu
a4152dc96f [kojixmlrpc] clean noisy error log
fixes: #2929
2021-06-28 15:17:12 +08:00
Tomas Kopecek
29a34f31a5 cli: show connection exception
For anonymous calls (whose use ensure_connection) is now shown also
original exception if --debug is specified.

Fixes: https://pagure.io/koji/issue/2592
2021-03-10 15:31:11 +01:00
Tomas Kopecek
425cd528a1 hub: priority policy
Fixes: https://projects.engineering.redhat.com/browse/RHELBLD-4275
2021-03-03 15:17:20 +01:00
Tomas Kopecek
d231fa02cb to_list is not needed in py3 code
Fixes: https://pagure.io/koji/issue/2514
2020-10-27 12:55:59 +01:00
Yu Ming Zhu
1b9cd6a95e hub: [multicall] cast args of exception to str
fixes: #2381
2020-09-01 11:23:04 +02:00
Tomas Kopecek
af311184fc dropping six from hub/web 2020-06-18 15:41:35 +02:00
Tomas Kopecek
47210e44bf hub: default policy allow packagelist changes with 'tag' permission
Fixes: https://pagure.io/koji/issue/2011
2020-06-16 11:04:14 +02:00
Tomas Kopecek
5bc763ab2d hub: log tracebacks for multicalls
Fixes: https://pagure.io/koji/issue/2204
2020-06-03 15:34:56 +02:00
Yuming Zhu
cf34706f04 use Exception instead of BaseException for bare expection 2020-03-03 21:38:22 +08:00
Yuming Zhu
c5db34a8e1 flake8: apply E501 with max-line-length=99 2020-03-03 21:38:22 +08:00
Yuming Zhu
f1ba6cefd7 flake8: apply all rest E7 rules 2020-03-03 21:38:22 +08:00
Yuming Zhu
0f727a2ab4 flake8: apply E3 rules 2020-03-03 21:38:22 +08:00
Yuming Zhu
05340b146b flake8: apply E2 rules except E266 2020-03-03 21:38:21 +08:00
Yuming Zhu
ce1f9928af flake8: apply E1 rules 2020-03-03 21:38:21 +08:00
Yuming Zhu
97cfaa4fcf flake8: follow E265 rule 2020-03-03 21:35:08 +08:00
Yuming Zhu
642508ccf6 flake8: follow all F rules 2020-03-03 21:35:08 +08:00
Yu Ming Zhu
bce5afdf0c hub: remove debugFunction API
testcase of list-api has some litaral reference. It doesn't matter but changed as well

fixes: #1833
2020-01-23 16:27:38 +01:00
Yu Ming Zhu
a58148a7ed sort imports in hub 2019-12-12 11:00:57 +00:00
Yuming Zhu
b2b8d5f9cc strict per item in config_files 2019-10-15 09:14:16 +02:00
Yu Ming Zhu
4c1928f377 extract read_config_files util for config parsing 2019-10-15 09:14:16 +02:00
Ken Dreyer
d2a8c10efc hub: remove reference to PythonOption
With mod_python we could use Apache's PythonOption directive. That
directive does not exist with mod_wsgi and we have to use SetEnv
instead.

Remove the PythonOption directive and describe how to use SetEnv.
2019-10-14 10:05:08 +02:00
Yuming Zhu
7b60e0e7eb backwards compatibility for ProxyDNs change 2019-10-10 13:04:06 +00:00
Yuming Zhu
d662fb837d keep on using REMOTE_USER
and handover realm translation to auth_to_local rules in /etc/krb5.conf
2019-10-10 13:02:55 +00:00
Yu Ming Zhu
4a3dc40147 use GSS_NAME instead of REMOTE_USER for GSSAPI auth
jira: https://projects.engineering.redhat.com/browse/BST-475
2019-10-10 13:01:24 +00:00
Yu Ming Zhu
ab37e28d4d hub: add AllowedKrbRealms option and (add|remove)UserKrbPrincipal API 2019-10-10 16:37:56 +02:00
Mike McLean
a8fb6c952d rollback errors in multiCall
Fixes: https://pagure.io/koji/issue/1357
2019-05-06 10:23:15 -04:00