-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add auth indication #199
Comments
We could annotate the http methods in some way, but it wouldn't be a good idea to do so for the auto-generated request objects. I'm not sure what typedoc label would work best tho: https://tsdoc.org/pages/tags/public/ |
Yes, I meant the http routes. It doesn't have to be a real annotation. Could just be |
How about I think there are a few routes that don't use auth at all. |
Yeah for those routes without auth we simply don't add a annotation. So It should also be documented what each annotation means in that http file |
I'd be good with either of those. |
It doesn't necessarily need to be an annotation, it could also be a sentence. Something like Requires authentication. or Requires moderator privileges. or Requires administrator privileges. that is just placed at the end of the TSDoc comment |
Well it doesn't matter to me as long as it can easily be parsed. (The above solution doesn't seem like that though) |
In the Lemmy code you can see that an endpoint requires auth if the handler method takes param So it would be great if this could be generated from the Rust code, but its probably not possible due to lack of tooling. |
With 0.19 now its not obvious which endpoints need authentication and which not. Maybe we should annotate that information in the JSDoc. This is especially useful for my openapi spec. As I can parse this JSDoc and auto add which endpoints need auth or not.
The text was updated successfully, but these errors were encountered: