Commit graph

3668 commits

Author SHA1 Message Date
Kevin Morris
a2d08e441e
fix(docker): run pre-commit run -a once
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-11 17:59:45 -07:00
Kevin Morris
6ad24fc950
Merge branch 'fix-docker-test' 2022-09-11 15:57:08 -07:00
renovate
69d6724749
fix(deps): update dependency redis to v4 2022-09-10 05:25:06 +00:00
renovate
307d944cf1
fix(deps): update dependency protobuf to v4 2022-09-10 03:25:08 +00:00
renovate
3de17311cf
fix(deps): update dependency bleach to v5 2022-09-10 00:25:02 +00:00
renovate
7ad22d8143
fix(deps): update dependency bcrypt to v4 2022-09-07 14:24:55 +00:00
renovate
6ab9663b76
fix(deps): update dependency authlib to v1 2022-09-07 06:25:25 +00:00
renovate
486f8bd61c
fix(deps): update dependency aiofiles to v22 2022-09-07 04:24:53 +00:00
renovate
a39f34d695
chore(deps): update dependency pytest to v7 2022-09-07 03:25:30 +00:00
renovate
bb310bdf65
fix(deps): update dependency uvicorn to ^0.18.0 2022-09-07 02:24:55 +00:00
renovate
a73af3e76d
fix(deps): update dependency hypercorn to ^0.14.0 2022-09-07 01:25:03 +00:00
renovate
a981ae4052
fix(deps): update dependency httpx to ^0.23.0 2022-09-07 00:25:32 +00:00
renovate
cdc7bd618c
fix(deps): update dependency email-validator to v1.2.1 2022-09-06 23:24:49 +00:00
renovate
b38e765dfe
fix(deps): update dependency aiofiles to ^0.8.0 2022-09-06 22:24:52 +00:00
renovate
655402a509
chore(deps): update dependency pytest-asyncio to ^0.19.0 2022-09-06 10:25:02 +00:00
renovate
a84d115fa1
chore(deps): add renovate.json 2022-09-06 08:24:03 +00:00
Leonidas Spyropoulos
310c469ba8
fix: run pre-commit checks instead of flake8 and isort
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-09-06 08:07:05 +01:00
Kevin Morris
25e05830a6
test: test that /packages/{name} produces the package's description
This commit fixes two of our tests in test_templates.py to go along
with our new template modifications, as well as a new test in
test_packages_routes.py which constructs two packages belonging
to the same package base, then tests that viewing their pages
produces their independent descriptions.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-05 19:50:41 -07:00
Kevin Morris
0388b12896
fix: package description on /packages/{name} view
...What in the world happened here. We were literally just populating
`pkg` based on `pkgbase.packages.first()`. We should have been focusing
on the package passed by the context, which is always available when
`show_package_details` is true.

Closes #384

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-05 19:25:32 -07:00
Kevin Morris
83ddbd220f
test: get /requests displays all requests, including those without a User
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-05 02:56:48 -07:00
Kevin Morris
a629098b92
fix: conditional display on Request's 'Filed by' field
Since we support requests which have no associated user, we must
support the case where we are displaying such a request.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-05 02:55:20 -07:00
Kevin Morris
7fed5742b8
fix: display requests for TUs which no longer have an associated User
Closes #387

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-05 02:43:23 -07:00
Kevin Morris
6435c2b1f1
upgrade: bump to version v6.1.2
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-02 15:28:02 -07:00
Kevin Morris
b8a4ce4ceb
fix: include maint/comaint state in pkgbase post's error context
Closes #386

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-02 15:12:41 -07:00
Kevin Morris
8a3a7e31ac
upgrade: bump version to v6.1.1
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-31 22:01:54 -07:00
Kevin Morris
929bb756a8
ci(lint): add .pre-commit cache for pre-commit
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-23 02:32:35 -07:00
Kevin Morris
fbb3e052fe
ci: use cache/virtualenv for test dependencies
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-23 02:19:16 -07:00
Kevin Morris
57c0409958
style: set flake8's max-line-length=88
In accordance with black's defined style, we now expect a maximum
of 88 columns for any one particular line.

This change fixes remaining violations of 88 columns in the codebase
(not many), and introduces the modified flake8 configuration.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-22 23:44:56 -07:00
Joakim Saario
ce5dbf0eeb
docs(contributing): Update Coding Style 2022-08-22 22:42:10 +02:00
Joakim Saario
de5538a40f
ci(lint): Use pre-commit 2022-08-22 22:42:10 +02:00
Joakim Saario
505eb90479
chore: Add .git-blame-ignore-revs file
The idea is to exclude commits that only contains formatting so that it's
easier to backtrack actual code changes with `git blame`.
2022-08-22 22:41:58 +02:00
Joakim Saario
9c6c13b78a
style: Run pre-commit 2022-08-22 22:40:45 +02:00
Joakim Saario
b47882b114
chore(pre-commit) Use hooks from official repositories
The reason behind this is to make checking and formatting consistent between
contributors and CI. It is also easier to incorporate new hooks, since many
tools already provides pre-commit hooks

In addition this commit also adds `black` and `autoflake` along with a few
other useful hooks from the `pre-commit-hooks` repository.
2022-08-22 22:37:32 +02:00
Kevin Morris
08d485206c
feature: allow co-maintainers to disown their pkg
Derived off of original work done by Leonidas Spyropoulos
at https://gitlab.archlinux.org/archlinux/aurweb/-/merge_requests/503

This revision of that original work finishes off the inconsistencies
mentioned in the original MR and adds a small bit of testing for more
regression checks.

Fixes: #360

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-19 18:00:29 -07:00
Kevin Morris
ab2956eef7
feat: add pytest unit of independent user unflagging
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-18 16:02:03 -07:00
Kevin Morris
93b4cec932
Merge branch 'show-unflag-link-to-flagger' 2022-08-18 16:01:38 -07:00
Kevin Morris
fd4aaed208
fix: use max-age for all cookie expirations
in addition, remove cookie expiration for AURREMEMBER --
we don't really care about a session time for this cookie, it merely
acts as a flag given out on login to remember what the user selected

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-18 15:15:40 -07:00
Kevin Morris
8e43932aa6
fix(doc): re-add Max-Age to list of secure cookie attributes
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-18 14:57:42 -07:00
Kevin Morris
4303086c0e
Merged branch 'sameorigin-lax'
Closes #351

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-18 14:47:24 -07:00
Joakim Saario
f10732960c
fix: Use SameSite=Lax on cookies 2022-08-18 23:42:33 +02:00
Kevin Morris
fb1fb2ef3b
feat: documentation for web authentication (login, verification)
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-17 09:59:56 -07:00
Leon Möller
33bf5df236 fix: show unflag link to flagger
While the flagger is allowed to unflag a package, the link to do so is
hidden from them. Fix by adding the flagger to the unflag list.

Fix #380
2022-08-16 13:19:15 +00:00
Kevin Morris
15d016eb70
fix: secure access to comment edits to user who owns the comment
Found along with the previous commit to be a security hole in our
implementation. This commit resolves an issue regarding comment editing.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-15 23:30:34 -07:00
Kevin Morris
7a52da5587
fix: guard POST keywords & allow co-maintainers to see keyword form
This addresses a severe security issue, which is omitted from this
git message for obscurity purposes.

Otherwise, it allows co-maintainers to see the keyword form when
viewing a package they co-maintain.

Closes #378

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-15 23:30:15 -07:00
Kevin Morris
7b047578fd
fix: correct kwarg name for approved users of creds.has_credential
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-15 19:34:18 -07:00
Kevin Morris
801df832e5
fix(rpc): correct URLPath in package results
This was incorrectly using the particular Package record's name
to format options.snapshot_uri in order to produce URLPath.

It should, instead, use the PackageBase record's name, which
this commit resolves.

Bug reported by thomy2000

Closes #382

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-15 10:06:44 -07:00
Kevin Morris
edacde48e5
Merge branch 'paginate-comments' 2022-08-14 19:50:21 -07:00
Kevin Morris
b4e0aea2b7
Merged bugfixes
Brings in: 9497f6e671
Closes #512

Thanks, jelle!

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-14 19:25:49 -07:00
Jelle van der Waa
9497f6e671
fix(aurweb): resolve exception in ratelimit
Redis's get() method can return None which makes an RPC request error
out:

  File "/srv/http/aurweb/aurweb/ratelimit.py", line 103, in check_ratelimit
    requests = int(requests.decode())
AttributeError: 'NoneType' object has no attribute 'decode'
2022-08-14 15:43:13 +02:00
Kevin Morris
4565aa38cf
update: Swedish translations
Pulled from Transifex on 08/12/2022 - 08/13/2022.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-13 23:51:49 -07:00