Commit graph

833 commits

Author SHA1 Message Date
Tomas Kopecek
ba2e1e520b basic security checks with bandit
Fixes: https://pagure.io/koji/issue/3042
2021-10-20 15:20:14 +02:00
Ken Dreyer
0747714f6e document convertFault method
Update the convertFault docstring to describe how the method converts
faults, the "fault" parameter type, and possible return values.
2021-10-12 14:27:39 -04:00
Tomas Kopecek
b8d486e637 Release notes 1.26.1
Fixes: https://pagure.io/koji/issue/3052
2021-09-29 11:06:19 +02:00
Tomas Kopecek
a626d818a2 fix typo 2021-09-15 12:43:06 +02:00
Patrick Uiterwijk
af25fc2e24 Support packages that are head-signed
This supports packages which do not have the RPMv3 signature scheme
(over the full RPM header+payload), but instead only have signatures
over the header (v4 scheme).
For the v4 scheme, the signature is only stored in SIGTAG_RSA (or
SIGTAG_DSA).

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2021-09-15 12:43:06 +02:00
Tomas Kopecek
7a4b17005a expose force_auth in config 2021-09-14 13:26:11 +02:00
Tomas Kopecek
1e5f0ef745 Release notes 1.26
Fixes: https://pagure.io/koji/issue/2983
2021-08-23 11:09:41 +02:00
Yu Ming Zhu
bc272c0532 [doc][defining_hub_policies] update the doc 2021-08-18 09:47:10 +00:00
Yu Ming Zhu
cdbebd963d [hub] add non-host evalPolicy API 2021-08-16 17:55:26 +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
a3f19e0f12 more reasonable parameter name, and more doc strs 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
258831d7e6 Revert "PR#2978: Don't take new tasks if we've 0.0 capacity available"
This reverts commit 5e9ca9366a, reversing
changes made to 59879c6e2c.
2021-08-16 13:34:54 +02:00
Tomas Kopecek
a537521ecd Don't take new tasks if we've 0.0 capacity available
If I've just started buildArch task with weight 1.5 on builder with 1.5
capacity, it can pick another one, as it is not over the builder's
capacity. This is wrong as there is no real capacity behind.
2021-08-11 12:43:12 +02: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
Tomas Kopecek
bdb9f91890 Release notes 1.25.1
Fixes: https://pagure.io/koji/issue/2920
2021-07-01 08:58:46 +02:00
Tomas Kopecek
d53c3f88fa lib: return taskLabel for unknown tasks
"malformed task" has been returned for everything unknown, but external
plugins can create completely valid tasks which we can't parse without
those plugins. In such case we want to return at least method/arch info.

Related: https://pagure.io/koji/issue/2904
2021-06-09 14:44:04 +02:00
Jana Cupova
9541c2a173 importlib instead of imp
Fixes: https://pagure.io/koji/issue/2822
2021-06-02 11:19:33 +02:00
Tomas Kopecek
3598562883 Release notes 1.25
Fixes: https://pagure.io/koji/issue/2845
2021-05-20 12:59:39 +02:00
Jana Cupova
de008b5f27 Add kerberos debug message
Fixes: https://pagure.io/koji/issue/2063
2021-05-03 13:41:35 +02:00
Tomas Kopecek
6e3553459f lib: is_conn_error catch more exceptions
Related: https://pagure.io/koji/issue/2789
2021-04-28 13:34:40 +02:00
Tomas Kopecek
ef3e2cd04b lib: use parse_task_params for taskLabel
Fixes: https://pagure.io/koji/issue/2519
2021-04-26 14:43:20 +02:00
Tomas Kopecek
290e1ddf31 lib: more portable BadStatusLine checking
Fixes: https://pagure.io/koji/issue/2789
2021-04-13 13:26:10 +02:00
Tomas Kopecek
68bf8c6179 PR#2779: 1.24.1 release notes
Merges #2779
https://pagure.io/koji/pull-request/2779

Fixes: #2778
https://pagure.io/koji/issue/2778
koji 1.24.1 release notes
2021-04-12 13:25:13 +02:00
Tomas Kopecek
a7c769fd41 lib: set sinfo=None for failed ssl_login
Fixes: https://pagure.io/koji/issue/2793
2021-03-31 13:54:08 +02:00
Tomas Kopecek
32929a7916 lib: missing default values in read_config
e.g. self.opts.get('max_retries', 30) will return wrong value if there
is None as a default value.

Fixes: https://pagure.io/koji/issue/2668
2021-03-31 13:51:34 +02:00
Tomas Kopecek
be225d7e3f 1.24.1 release notes
Fixes: https://pagure.io/koji/issue/2778
2021-03-29 13:30:24 +02:00
Mike McLean
c71ebec58a Revert "requests exception"
This reverts commit ff8c13969e.

Fixes https://pagure.io/koji/issue/2786
2021-03-29 11:27:22 +02:00
Tomas Kopecek
3321abbf88 lib: more verbose conn AuthError for ssl/gssapi
Fixes: https://pagure.io/koji/issue/2502
2021-03-29 11:22:06 +02:00
Tomas Kopecek
ebdbb80e02 drop PyOpenSSL usage
We've replaced it with requests library some time ago, this code has no
better sensitivity than requests error checking, so we can drop it
completely.

Fixes: https://pagure.io/koji/issue/2752
2021-03-24 14:43:40 +01:00
Tomas Kopecek
66e6ee322b make flake8 happy 2021-03-18 16:13:29 +01:00
Mike McLean
144dc70010 fix logic 2021-03-18 15:46:16 +01:00
Mike McLean
9cceb6764d rework rmtree a bit 2021-03-18 15:46:16 +01:00
Ken Dreyer
ee16954351 better ssl_login() error message when cert is None
"certification" is hard to understand. Provide a clearer error to users.
2021-02-24 14:20:16 +01:00
Tomas Kopecek
c8b1ba8ad0 Release notes 1.24
Fixes: https://pagure.io/koji/issue/2684
2021-02-17 15:08:56 +01:00
Yu Ming Zhu
3c4ae6e78c fix typo for kojikamid
related: #2693
fixes: #2641
2021-02-17 00:07:11 +00:00
Tomas Kopecek
13f4023bf5 flake8 fixes 2021-02-16 14:43:49 +01:00
Tomas Kopecek
c6e69b4f8b backport py27 compatible file open with encoding
client and builder needs to run on py27 which doesn't support
open(encoding='utf-8')

Related: https://pagure.io/koji/issue/2641
2021-02-16 14:13:03 +01:00
Tomas Kopecek
6ad2bccec3 plugin hooks for repo modification
Fixes: https://pagure.io/koji/issue/2636
2021-02-04 10:44:21 +01:00
Tomas Kopecek
96ae0ecef5 explicit encoding for text file operations
Fixes: https://pagure.io/koji/issue/2641
2021-01-26 13:36:25 +01:00
Tomas Kopecek
79f1e45e74 Release notes 1.23.1 2021-01-18 11:09:07 +01:00
Tomas Kopecek
9d64bafed6 lib: better print with debug_xmlrpc
Fixes: https://pagure.io/koji/issue/2597
2021-01-06 14:38:34 +01:00
Tomas Kopecek
8ff5759b21 lib: better argument checking for eventFromOpts
Fixes: https://pagure.io/koji/issue/2513
2021-01-04 10:43:30 +01:00
lrossett
1c787a323f flake8 fixes 2020-12-14 13:26:00 +01:00
lrossett
ff8c13969e requests exception 2020-12-14 13:26:00 +01:00
Michal Privoznik
66ba134859 Install into /usr/lib rather than /usr/lib64/
In koji-1.22.0-129-g0ef3c751 I've changed the way how
site-packages directory is obtained. What I did not realize back
then is there can be multilib systems which will not search for
packages in /usr/lib64. But 64bit systems do look into /usr/lib.
Therefore, let's pick the location where both systems work.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1894261
Fixes: #2578
https://pagure.io/koji/issue/2578
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2020-11-27 10:00:52 +01:00
Tomas Kopecek
0f56d39487 remove deprecated --ca option
Fixes: https://pagure.io/koji/issue/2192
2020-11-23 11:03:38 +01:00
Tomas Kopecek
2012ae64ec Revert "timezones for py 2.7"
This reverts commit a9108584b7.

Fixes: https://pagure.io/koji/issue/2568
2020-11-02 13:58:04 +01:00
Tomas Kopecek
f1b6cdc401 doc: api docs
Fixes: https://pagure.io/koji/issue/2110
2020-10-23 09:06:23 +02:00
Tomas Kopecek
5e216d9567 Release notes 1.23
Fixes: https://pagure.io/koji/issue/2446
2020-10-22 09:46:29 +02:00