You are browsing as a guest. Sign up (or log in) to start making projects!

5h 9m 55s logged

hello again, its a me, a random space birb that is here to tell you that I completly forgot about the ratelimiting stuff. BUUT, I added the admin methods and UserFlags to be able to set… flags. not much rodeo this time.

had to think how i wanted the audit logs to work for the admin stuff. I first though about just having a bool saying “ah yeah admin” but meh, I think its better to have also an “actor_id”, the who did it user id, and boom. In the user side handlers for the audit log I just return the typical plain response of “yeah this was changed” (not sql joins, cheaper [?]) but in the admin side, I return the actor_id with some other things like the user login of the actor AND the user login of the user that was changed (cause why not!? its jsut another join statement in sql). Works wonderfully and even better now because before I had setup the user audit log to fetch AAAL the entries form the db and pee pee poo poo no, now that i have my paginated stuff, no way!

SOO, the admin methods are just the typical ones, see what the user has changed or an admin changed from an user via its audit logs, the oauth applications and authorizations management and that’s it. I will probably also add a way to know globally what the heck is being changed but idk about that, seems a big sql query (that is tiny but very costly in db terms) and I frankly want to avoid that… and even more avoid using redis because i hate it and that SOMEHOW i have better some beautiful organized code vs the first version of this backend where I used the typical DB+redis aaand it was ugly. i hate that.

I also added the UserFlags to be able to set flags like “is the user an admin?” or “is this user allowed to manage its oauth applications?” and so on. Pretty cool.

BUUT as always, I had to C&P some code (almost all of it) from past handlers to make the admin handlers work lol. I would really want to make a central place to put all the common handler code but meh. IT WORKS! and that’s what matters.

THe next things are just making the ratelimiting WHICCHC probably will be only inside the instance the user is reaching and that’s it. I would like to have global ratelimiting using the IP of the user or its account id but that would (i think) require redis… I really need to think about this because someone with a crappy toaster can make explode my poor baby vps.

ps. god do I really take that much time doing stuff? god i am slow at coding. i am bad goddamit.

that’s it. shallllll you see my shiitty api docs with the admin stuff and admin auditlogs becuase why not:

0
2

Comments 0

No comments yet. Be the first!