Kevin Morris
4667993dad
Merge branch 'fix-comaintainer' into pu
2021-12-06 23:45:20 -08:00
Kevin Morris
0447afa2e5
fix(PackageNotification): add missing backref cascade
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-06 23:02:53 -08:00
Kevin Morris
57df6db609
fix(PackageComaintainer): populate backref cascade properly
...
Closes #205
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-06 23:01:04 -08:00
Kevin Morris
27f8603dc5
fix(python): fix ordering of fields in partials/account_form.html
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-04 17:56:02 -08:00
Kevin Morris
cf978e23aa
fix(python): use S argument to decide Suspended
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-04 17:56:02 -08:00
Kevin Morris
0ed752277c
Merge branch 'fix-account-show' into pu
2021-12-04 17:54:36 -08:00
Kevin Morris
8501bba0ac
change(python): rework session timing
...
Previously, we were just relying on the cookie expiration
for sessions to expire. We were not cleaning up Session
records either.
Rework timing to depend on an AURREMEMBER cookie which is
now emitted on login during BasicAuthBackend processing.
If the SID does still have a session but it's expired,
we now delete the session record before returning.
Otherwise, we update the session's LastUpdateTS to
the current time.
In addition, stored the unauthenticated result value
in a variable to reduce redundancy.
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-04 02:16:22 -08:00
Kevin Morris
224a0de784
fix(python): add logged in date field to account/show.html
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-04 01:16:14 -08:00
Kevin Morris
2ea4559b60
fix(python): use correct Status field in account/show.html
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-04 00:54:03 -08:00
Kevin Morris
f8bef16d32
Merge branch 'fix-account-links' into pu
2021-12-04 00:25:57 -08:00
Kevin Morris
973dbf0482
fix(python): use creds to determine account links to display
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-04 00:15:34 -08:00
Kevin Morris
d0fc56d53f
fix(python): redirect when the request user can't edit target user
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-04 00:14:55 -08:00
Kevin Morris
bfa916c7b2
fix(fastapi): fix PGP Key Fingerprint display for account/show.html
...
There's a space between every 4 characters in the fingerprint
in PHP; we were missing it in FastAPI. This commit fixes that
inconsistency.
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-03 23:40:16 -08:00
Kevin Morris
522177e813
Merge branch 'fix-clean-auth-docs' into pu
2021-12-03 18:29:47 -08:00
Kevin Morris
aa717a4ef9
change(fastapi): no longer care about ResetKey collisions
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-03 17:59:02 -08:00
Kevin Morris
b0b5e4c9d1
fix(fastapi): use secrets
module to generate random strings
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-03 17:58:58 -08:00
Steven Guikal
75ad2fb53d
fix(FastAPI): cleanup auth_required decorator
...
Signed-off-by: Steven Guikal <void@fluix.one>
2021-12-03 14:07:47 -05:00
Kevin Morris
81f8c23265
fix(fastapi): log out IntegrityError from failed SID generation
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-02 23:42:13 -08:00
Kevin Morris
806a19b91a
feat(fastapi): render a 500 html response when unique SID generation fails
...
We've seen a bug in the past where unique SID generation fails and
still ends up raising an exception.
This commit reworks how we deal with database exceptions internally,
tries for 36 iterations to set a fresh unique SID, and raises a 500
HTTPException if we were unable to.
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-02 23:26:42 -08:00
Kevin Morris
abfd41f31e
change(fastapi): centralize HTTPException
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-02 23:23:27 -08:00
Kevin Morris
a747548254
Merge branch 'fix-navbar-spacing' into pu
2021-12-02 17:32:19 -08:00
Kevin Morris
e1bf6dd562
fix(fastapi): restore stripped whitespace in archdev-navbar
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-02 17:09:37 -08:00
Steven Guikal
42701514e7
fix(FastAPI): Use HTTPStatus instead of raw number
...
Signed-off-by: Steven Guikal <void@fluix.one>
2021-12-01 21:15:49 +00:00
Kevin Morris
0435c56a41
update test/README.md to be more aligned with the current state
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 12:27:14 -08:00
Kevin Morris
c09784d58f
fix(auth.auth_required): remove unused keyword arguments
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 11:56:44 -08:00
Kevin Morris
112837e0e9
fix(test_auth): cover mismatched referer situation
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 11:53:43 -08:00
Kevin Morris
043ac7fe92
fix(test_aurblup): use correct type hint for tmpdir
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:33:31 -08:00
Kevin Morris
fccd8b63d2
housekeep(fastapi): rewrite test_auth_routes with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:33:30 -08:00
Kevin Morris
7ef3e34386
housekeep(fastapi): rewrite test_accounts_routes with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:33:30 -08:00
Kevin Morris
de0f919077
housekeep(fastapi): rewrite test_ban with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:33:30 -08:00
Kevin Morris
eb396813a8
housekeep(fastapi): rewrite test_package with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:33:29 -08:00
Kevin Morris
5b14ad4065
housekeep(fastapi): rewrite test_user with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:33:28 -08:00
Kevin Morris
140f9b1fb2
housekeep(fastapi): rewrite test_package_dependency with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:23 -08:00
Kevin Morris
05bd6e9076
housekeep(fastapi): rewrite test_package_vote with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:22 -08:00
Kevin Morris
150c944758
housekeep(fastapi): rewrite test_package_group with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:22 -08:00
Kevin Morris
df530d8a73
housekeep(fastapi): rewrite test_package_source with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:22 -08:00
Kevin Morris
171b347dad
housekeep(fastapi): rewrite test_package_base with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:21 -08:00
Kevin Morris
93bc91cce2
housekeep(fastapi): rewrite test_tu_voteinfo with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:21 -08:00
Kevin Morris
ae72817950
housekeep(fastapi): rewrite test_routes with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:21 -08:00
Kevin Morris
ca25595022
housekeep(fastapi): rewrite test_sesion with fixtures
...
Also, added a new test function which tests the IntegrityError
exception.
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:20 -08:00
Kevin Morris
a0e1a1641d
fix(fastapi): support UsersID and User columns in the Session model
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:20 -08:00
Kevin Morris
31a093ba06
housekeep(fastapi): rewrite test_package_relation with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:20 -08:00
Kevin Morris
14d80d756f
housekeep(fastapi): rewrite test_package_comaintainer with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:19 -08:00
Kevin Morris
ff3931e435
housekeep(fastapi): rewrite test_package_notification with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:19 -08:00
Kevin Morris
655b98d19e
housekeep(fastapi): rewrite test_package_license with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:19 -08:00
Kevin Morris
a082de5244
housekeep(fastapi): rewrite test_package_keyword with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:18 -08:00
Kevin Morris
b20ec9925a
housekeep(fastapi): rewrite test_ssh_pub_key with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:18 -08:00
Kevin Morris
91f6591141
housekeep(fastapi): rewrite test_accepted_term with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:18 -08:00
Kevin Morris
d6cb3b9fac
housekeep(fastapi): rewrite test_auth with fixtures
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:30:16 -08:00
Kevin Morris
735c5f57cb
housekeep(fastapi): rewrite test_package_blacklist
...
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-01 00:28:40 -08:00