T3CHN01200
T3CHN01200
TTCTheo's Typesafe Cult
Created by IcyyDicy on 1/6/2025 in #questions
Architecting a task queue
I would still run some tests first w/ resource utilization and if need be, I'd just throw a worker behind a queue and be done w/ it.
10 replies
TTCTheo's Typesafe Cult
Created by IcyyDicy on 1/6/2025 in #questions
Architecting a task queue
Funny bot
10 replies
TTCTheo's Typesafe Cult
Created by IcyyDicy on 1/6/2025 in #questions
Architecting a task queue
I'll ask the obvious questions: - How many people are you expecting to use this? - Assuming the prior answer isn't "oh god, this is overwhelming", do you know any languages that can use threads? - Is there a reason why you desire this on multiple machines? I ask these questions to get you think if you actually need all this infrastructure. If you can keep all this confined to one binary, it will save you a shit ton of headache.
10 replies
TTCTheo's Typesafe Cult
Created by Lr-Projects on 1/5/2025 in #questions
How to store/design dynamic roles in jwt
That would be my preference too.
17 replies
TTCTheo's Typesafe Cult
Created by Lr-Projects on 1/5/2025 in #questions
How to store/design dynamic roles in jwt
If you can get away with a bunch of questions with a finite number of answers, I would just take all the user's "groups" with their permissions converted to a binary number and bitwise or (|, not ||) them together and have one field named "permissions" in my JWT. In this case, you don't care where the permission came from, you just care that the user has the permission to do X. The advantages to this are that it is small and fast, the disadvantages to this over keeping a list is that you are limited by space (if you are using a sane language with fixed width integers) or you are somehow going to have to finagle a list of multiple integers. It is also less legible. If there is resource access contingent upon the group you are in (think a file system), you either will perform a lookup on the database on every request or you will have to retain a list of group ids and any associated permissions. There is no way around this, but you are going to have to do a database lookup anyways for the resource. I would pack the group permissions the same way though as it will keep the group relatively small. I would probably do this in a dictionary/associative array/hashmap/whatever the data structure is called in your language of choice on the back end so it looks something like this:
{
...
"groupPermissionss": {
"<id-of-group-0>": <permission-flags-for-group-0>,
"<id-of-group-1>": <permission-flags-for-group-1>,
...
},
...
}
{
...
"groupPermissionss": {
"<id-of-group-0>": <permission-flags-for-group-0>,
"<id-of-group-1>": <permission-flags-for-group-1>,
...
},
...
}
17 replies
TTCTheo's Typesafe Cult
Created by Lr-Projects on 1/5/2025 in #questions
How to store/design dynamic roles in jwt
Also, does the service have access to the auth data?
17 replies
TTCTheo's Typesafe Cult
Created by Lr-Projects on 1/5/2025 in #questions
How to store/design dynamic roles in jwt
Is there resource access on these groups or are they just convenient containers for global permissions?
17 replies
TTCTheo's Typesafe Cult
Created by Jaa9 Bravo on 1/3/2025 in #questions
Google drive as file storage
11 replies
TTCTheo's Typesafe Cult
Created by Jaa9 Bravo on 1/3/2025 in #questions
Google drive as file storage
11 replies
TTCTheo's Typesafe Cult
Created by Harshit Raj on 12/30/2024 in #questions
How to restart a game
How about using a state machine and having your startup code be part of your update loop? It only executes under say the startGame state.
7 replies