GNUGradyn
GNUGradyn
CC#
Created by GNUGradyn on 5/14/2024 in #help
Send already hashed password to backend instead of raw password with asp.net identity
Hello. I am trying to build the backend for an app that handles sensitive mental health data. The data is already end-to-end encrypted. The client generates a DEK to encrypt the data with, derives a KEK from the password, and encrypts the DEK with the KEK and submits that to the backend. The project was originally not going to be end-to-end encrypted, so I already implemented the typical username/password flow. The problem is sending the raw password to the backend would allow us to create the KEK and use it to decrypt the DEK and access the users data. I want it to be completely impossible for me to see the users data, so my server needs to never see the users password. Thanks in advance
43 replies
CC#
Created by GNUGradyn on 10/27/2023 in #help
❔ What to use instead of keycloak for built-in auth?
I'm working on the backend for my app. The app was originally going to be a web app, so currently for auth im using keycloak. Trouble is, the login screen has a "skip" button to use the app offline. I want this to work even if the user is not connected to the internet, so the login screen needs to actually be part of the app. I've successfully implemented this by using the password grant auth flow for signing in, and using the keycloak admin API behind my API for things like verifying email and changing passwords. Problem is this is getting increasingly jank. For example, I can't figure out any way to implement 2FA and the "change password" flow works by trying to issue a token with the "current password" the user provided, and then changing the password via the admin API if it succeeds I know about IdentityServer4 but it sounds like its abandoned. Security needs to be really good because my application stores very sensitive user info
7 replies
CC#
Created by GNUGradyn on 4/7/2023 in #help
❔ Appease "Property is uninitialized" without setting a default value? Possibly make it required?
16 replies
CC#
Created by GNUGradyn on 1/6/2023 in #help
✅ Does `FileSystemWatcher` work on linux? (Trying to monitor for files being added or renamed)
Hi. Im trying to monitor a directory for any files being added to it or renamed. I found FileSystemWatcher but the platform support is unclear. I suspect it does not work on linux because many of the events don't make sense on linux (e.g. how would LastWrite work when files arent locked on linux) Does this work on linux? if not what should I use instead?
29 replies
CC#
Created by GNUGradyn on 12/1/2022 in #help
❔ Rendering Jinja template in C sharp
Hello, I have a TON of Jinja templates that were designed for an older version of a microservice that was written in python. I'm trying to update a newer version which is written in C# to support these templates. Rather then rewrite the hundreds of templates to use a C# native templating engine, I'd like to somehow create a wrapper. A couple ideas I had: - Make a console renderer for jinja in Python - Compile Jinja with IronPython and just use that What is the best way to go about this? If there is an existing solution that would obviously be preferrable but the only one I could find was from 2013
2 replies
CC#
Created by GNUGradyn on 11/6/2022 in #help
Cannot parse custom emoji string into Emoji object
Hi, I am trying to react with a custom emoji as shown below
await socketMessage.AddReactionAsync(Emoji.Parse(":Goatcutie:"));
await socketMessage.AddReactionAsync(Emoji.Parse(":Goatcutie:"));
I am getting the following error
System.FormatException: String is not emoji name or unicode!
at Discord.Emoji.Parse(String emojiStr)
at Goatbot.Modules.Goats.OnMessageAsync(SocketMessage socketMessage) in D:\code\Goatbot\GoatBot\Modules\Goats.cs:line 26
at Discord.EventExtensions.InvokeAsync[T](AsyncEvent`1 eventHandler, T arg)
at Discord.WebSocket.DiscordSocketClient.TimeoutWrap(String name, Func`1 action)
System.FormatException: String is not emoji name or unicode!
at Discord.Emoji.Parse(String emojiStr)
at Goatbot.Modules.Goats.OnMessageAsync(SocketMessage socketMessage) in D:\code\Goatbot\GoatBot\Modules\Goats.cs:line 26
at Discord.EventExtensions.InvokeAsync[T](AsyncEvent`1 eventHandler, T arg)
at Discord.WebSocket.DiscordSocketClient.TimeoutWrap(String name, Func`1 action)
just doing :Goatcutie: yields the same result. the bot is in the same server as the emoji
1 replies
CC#
Created by GNUGradyn on 11/2/2022 in #help
DotCover shows class with no methods is 0% covered
8 replies
CC#
Created by GNUGradyn on 9/5/2022 in #help
How do I check if a list in an IConfiguration has any values [Answered]
I am trying to do this
if (_config.GetValue<bool>("AutoRegisterSlashCommands:Dev") && _config.GetSection("DevServers").Get<ulong[]>().Any())
if (_config.GetValue<bool>("AutoRegisterSlashCommands:Dev") && _config.GetSection("DevServers").Get<ulong[]>().Any())
However this throws an ArgumentNullException if the configuration section is an empty list
7 replies