Use a controller instead of writing to the .well-known directory

Created on 25 February 2023, over 1 year ago
Updated 15 March 2023, over 1 year ago

Hi,

Thanks for the module. I was thinking to install it to verify myself, but I'm personally not a fan of the current approach.
My request is basically an overhaul of the code for two main reasons:

- not having to write to a file (basically giving the web server write access)
- multiple users support

We do this in https://www.drupal.org/project/nodeinfo/ β†’ for instance; see the routing file https://git.drupalcode.org/project/nodeinfo/-/blob/1.0.x/nodeinfo.routin... and a controller which returns the response https://git.drupalcode.org/project/nodeinfo/-/blob/1.0.x/src/Controller/...

For multiple user support, I would move the setting to the user level: I would go for a dedicated route like user/x/nostr where people can enter the name and key which will be included in the response. I would store the content (name and key) in a dedicated table (not config or state or entity, that doesn't seem like the best approach). It makes the input less prone to errors too since users don't have to know anything about json formatting.

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium swentel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024