Comments (2)
The docs recommend that people create an access rule that allows anonymous writes to "up*" topics, so that you can use the matrix gateway and other UnifiedPush services, while still having auth-default-access: deny-all
from ntfy.
Now that I'm thinking more, it would probably be best to create some token that is unique to the UP topic and subscribing user, and pass that as the authentication token (instead of one specific to only the user). Then, at topic write-time, the service can check to see if the user is still subscribed to the UP topic, and deny/allow based on that. This would naturally expire stale authorizations.
This would require changes to both the authorization pathway in the go server, and proper calculation of those credentials:
- A new service provided to authenticated users that returns an encoding of (a) their username and (b) the hash of (their username, a server-wide secret string, and the UP topic name).
- The mobile apps should, at UP subscribe time, query the server for this token, appropriately embed it in the UP subscriber URL, and then pass it to the client app.
- The authentication chain in the server should check for this kind of token in URLs, and (a) confirm the hashes match, and (b) confirm the user is actually subscribed to the named topic.
Then, anyone with that secret token will be able to post to that topic name as long as the user is subscribed to it. Only constant additional state is required to be tracked by any parties. Similarly, only constant time is required to validate this. Unsubscribing and resubscribing the service will generate a new UP topic name, making the old token worthless (unless the up topic name happens to be reused by the same username, which is unlikely). As long as the server is updated to provide (1) and (3) first (which can be done without breaking backwards-compatibility), clients can gradually roll out support for (2), gracefully improving service. We could simultaneously change the up
prefix at this point, and keep the unconditional write-access to that for a while until everyone has transitioned.
Would patches that implement this be welcome? (Unfortunately, it would be a while before I could get to this. In particular I am probably going to try to debug #1035 first)
from ntfy.
Related Issues (20)
- Add apple shortcuts to documentation HOT 5
- Segfault on publish (installed with nix) HOT 2
- base-url isn't respected HOT 1
- Load server configuration from server.yaml
- iOS app: clear all notifications does nothing
- clear=true does nothing
- Why canβt new notifications be displayed when the screen is locked? (Android) HOT 1
- Webapp doesn't allow subscribing when ntfy is not running on a dedicated sub-domain
- LineageOS delays notification, despite io.heckel.ntfy.MESSAGE_RECEIVED intent being sent HOT 3
- Use different distributor for ntfy (Android)
- provide a systemd unit file to run the ntfy server as a systemd service HOT 3
- [FR] last activity timestamp
- Add an option to display max priority notifications full screen
- auth-file settings ignored HOT 3
- Nagging notifications
- Any plans for a tvos port?
- Proxy connections HOT 2
- Rate-Topics can be used to DoS individual (public) topics HOT 1
- Panic in .handleAccountSubscriptionAdd, .. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ntfy.