-
Notifications
You must be signed in to change notification settings - Fork 218
Added /ns_info Endpoint #2261
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
Added /ns_info Endpoint #2261
Conversation
|
Added endpoint /healthcheck ➜ ~ curl -H "Authorization: <>" http://localhost:8089/v1/healthcheck |
|
Added endpoint /account_list Alright, I'm tired, off to bed. ➜ ~ curl -X GET http://localhost:8089/v1/account_list {"accounts":[{"success":true,"accountName":"RoseBot"},{"success":true,"accountName":"Roze"},{"success":true,"accountName":"Roze2"},{"success":true,"accountName":"Roze_"},{"success":true,"accountName":"SarahRose"},{"success":true,"accountName":"spectrum"},{"success":true,"accountName":"thebirdwashere"}],"totalCount":7} |
|
Thanks very much! Planning to review this on Sunday. |
slingamn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for this excellent contribution! I've made a bunch of requests for changes --- you're welcome to work on them yourself, obviously, but if you want me to do them I can do that as well.
To fix the linting issue you can run make gofmt. You can run make test and make irctest locally to check your work, including linting. (irctest requires that you have the Python pytest library installed; you can install it from a typical Linux distribution's package manager, but no worries if you don't want to, these changes here are not covered by irctest anyway.)
|
Thank you :) I'll take a look at these when I have some more time to hammer away at it. |
Switched from GET to POST requests to follow existing documentation/api Removed substring match/filter Using SemVer instead of Ver Switched to utils.IRCv3TimestampFormat Renamed Health_Check endpoint to /status updated API.md
|
Alright, I think I've about covered the updates you've requested. Let me know if anything else needs tweaking. :) |
slingamn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
…on time and account channels to the endpoint. renamed StatusResponse to apiStatusResponse Using utils.IRCv3TimestampFormat for all dates within the api updated API.md with the changes.
|
Thanks for your feedback, I'll try to keep these things in mind moving forward. |
|
Thanks! I'm going to merge this, we can consider readding pagination for account_list later. |
I'm sure this could use a better endpoint name but here is the new endpoint that provides json output similar to /ns INFO
#2260
➜ ~ curl -X POST
-H "Authorization: Bearer <YOUR_TOKEN_HERE>"
-H "Content-Type: application/json"
-d '{"nick":"SarahRose"}'
http://127.0.0.1:8089/v1/ns_info
{"success":true,"accountName":"SarahRose","registeredAt":"Mon, 05 May 2025 05:30:20 UTC","channels":["#test3","#test5","#reports","#admins","#work-day","#announcements","#triggering","#null","#hrt","#welcome"],"channelCount":10}