binwiederhier
c76e39bb0e
Manual updates
2026-02-21 10:36:09 -05:00
binwiederhier
a28d8e7924
Update docs, manual changes
2026-02-20 16:36:41 -05:00
binwiederhier
a4c836b531
Refine
2026-02-20 15:36:12 -05:00
binwiederhier
039d555689
Fix tests
2026-02-20 08:19:25 -05:00
binwiederhier
4cbd80c68e
Use one PG connection, add support for connection params
2026-02-19 22:34:53 -05:00
binwiederhier
305e3fc9af
DB conn to 25
2026-02-19 21:36:09 -05:00
binwiederhier
939b3d1117
Fix lint, make pipeline use psotgres
2026-02-18 21:07:31 -05:00
binwiederhier
2716ede6e1
Extract message cache into message/ package with model/ types
...
Move message cache from server/message_cache.go into a dedicated
message/ package with Store interface, SQLite and PostgreSQL
implementations. Extract shared types into model/ package.
2026-02-18 20:22:44 -05:00
binwiederhier
e3a402ed95
Make user tests work for postgres and sqlite
2026-02-17 20:14:45 -05:00
binwiederhier
1abc1005d0
Re-org
2026-02-17 12:04:51 -05:00
binwiederhier
909c3fe17b
Add Store-level unit tests for SQLite and PostgreSQL backends
...
Add shared test functions in store_test.go covering all Store interface
operations (users, tokens, access control, tiers, billing, stats, etc.)
with per-backend wrappers in store_sqlite_test.go and store_postgres_test.go
following the webpush test pattern.
Fix broken isUniqueConstraintError() which used incorrect interface
assertions instead of string matching for SQLite/PostgreSQL errors.
2026-02-16 22:56:31 -05:00
binwiederhier
07c3e280bf
Refactor user package to Store interface with PostgreSQL support
...
Extract database operations from Manager into a Store interface with
SQLite and PostgreSQL implementations using a shared commonStore.
Split SQLite migrations into store_sqlite_migrations.go, use shared
schema_version table for PostgreSQL, rename user_user/user_tier tables
to "user"/tier, and wire up database-url in CLI commands.
2026-02-16 22:39:54 -05:00
binwiederhier
ceda5ec3d8
Move things in user package
2026-02-16 21:04:15 -05:00
binwiederhier
3d72845c81
Tests for user package
2026-02-16 20:49:17 -05:00
binwiederhier
5244e0be14
Fix tests
2025-08-09 10:04:57 -04:00
binwiederhier
6eb25f68ac
Update password hash docs, add more validation on password hash
2025-08-09 07:34:19 -04:00
binwiederhier
57a51ab2da
Fix tests
2025-08-08 15:16:53 -04:00
binwiederhier
ea338ae4fa
Make it easy to build without Stripe
2025-08-07 16:41:39 +02:00
binwiederhier
c4c4916bc8
Do not allow changing tokens, user role, or delete users
2025-08-04 22:22:59 +02:00
Hunter Kehoe
81463614c9
prevent changing a provisioned user's password
2025-08-03 16:07:24 -06:00
binwiederhier
a1c6dd2085
Comments
2025-07-31 11:28:27 +02:00
binwiederhier
9f987e66fa
Make sure tokens are updated instead of deleted/re-added
2025-07-31 08:36:05 +02:00
binwiederhier
b91ff5f0b5
Move stuff to util.go
2025-07-31 07:33:11 +02:00
binwiederhier
23ec7702fc
Add "auth-tokens"
2025-07-31 07:08:35 +02:00
binwiederhier
07e9670a09
Fix bug in test
2025-07-27 22:33:29 +02:00
binwiederhier
fe545423c5
Change to auth-(users|access), upgrade manually added users to provision users
2025-07-27 12:10:16 +02:00
binwiederhier
f3c67f1d71
Refuse to update manually created users
2025-07-27 11:02:34 +02:00
binwiederhier
141ddb3a51
Comments
2025-07-26 12:20:11 +02:00
binwiederhier
f99801a2e6
Add "ntfy user hash"
2025-07-26 12:14:21 +02:00
binwiederhier
4457e9e26f
Migration
2025-07-26 11:16:33 +02:00
binwiederhier
f59df0f40a
Works
2025-07-21 17:44:00 +02:00
binwiederhier
c0b5151bae
Predefined users
2025-07-10 20:50:29 +02:00
binwiederhier
efef587671
WIP: Predefined users
2025-07-07 22:36:01 +02:00
binwiederhier
9f72eb804d
Computers are fast
2025-05-25 12:32:16 -04:00
binwiederhier
42af71e546
Fix test
2025-05-25 12:27:21 -04:00
binwiederhier
0de1990c01
Increase number of access tokens per user to 60
2025-05-25 12:23:02 -04:00
binwiederhier
4dc3b38c95
Allow adding/changing user with password hash via v1/users API
2025-05-24 09:31:57 -04:00
Tom Hubrecht
44b7c2f198
user: Allow changing the hashed password directly
...
This adds the detection of `NTFY_PASSWORD_HASH` when creating a user or
changing its passsword so that scripts don't have to manipulate the bare
password.
2025-05-21 16:34:14 +02:00
Hunter Kehoe
4111bee0c4
fix linting issue
2024-04-07 21:40:24 -06:00
Hunter Kehoe
e4d22ebd8b
allow + in usernames
2024-04-03 21:58:29 -06:00
binwiederhier
7d755ce604
Add comments and another test to ACL fix
2023-11-18 21:50:01 -05:00
binwiederhier
f64dbcb6b2
Merge branch 'main' into sandman7920/main
2023-11-18 06:28:48 -05:00
binwiederhier
22f48c5ad3
Change mod path
2023-11-16 20:54:58 -05:00
Nikolay Zlatev
1aa82ff06a
FullScenario_Default_DenyAll: add user "john" test case
...
Add new test for user john
The user should have:
"deny" to mytopic_deny*,
"ro" to mytopic_ro*,
"rw" to mytopic*,
"ro" to the rest
2023-10-24 14:02:52 +03:00
Nikolay Zlatev
0ff1f6520a
TestMigrationFrom4: move the longest rule on top
2023-10-24 14:02:04 +03:00
Nikolay Zlatev
ff2a354333
TestMigrationFrom1: move the longest rule on top
2023-10-24 14:00:46 +03:00
Nikolay Zlatev
543709336c
TestManager_UserManagement: move the longest rule on top
2023-10-24 13:59:39 +03:00
Nikolay Zlatev
afd6d2e0ee
Default_DenyAll: move the longest rule on top
2023-10-24 13:57:46 +03:00
Nikolay Zlatev
7a5572ad7c
user.Manager: further improve ACL write/read order
...
For each user, we should test in order `THE_LONGEST_RULE`->`WRITE_PERMISSION`
2023-10-16 09:41:49 +03:00
Nikolay Zlatev
5c9cebf059
user.Manager: fix ACL write, read order
...
This should fix "read-only access to topic *" being applied before "read-write access to topic _PREFIX_*"
Before this if we have:
ntfy access user "mytopic*" rw
ntfy access user "*" ro
read-only access rule was applied first and user couldn't write to
mytopic*
2023-10-13 15:41:17 +03:00