misk
misk
CC#
Created by misk on 3/2/2024 in #help
CLI tool with access to connection strings?
So, I have a normal web API with auth setup. There are different roles, and you can authenticate with a bearer token, standard stuff. I also have a CLI tool used by system admins, that is able to use the API - it just asks the CLI user for a username/pw and authenticates with the API and saves the bearer and refresh tokens to be reused for a while. The issue now is that I would like the CLI to be able to access some services/databases without having to go through the API. And I cannot really figure out a good/secure way of doing this. Unlike the API token, the connection strings will not expire so I do not want to save them anywhere on the CLI computer. So what would be a good way of doing this?
My ideas (and why i dont like it) - Let the API expose the functionality that the CLI wants to perform, and just call the API instead of going directly from CLI to database/service. (I don't want to burden the API with both the extra code and the performance load that this will do) - Return the connection strings from an API endpoint, in some encrypted format that can be saved safely to disk by the CLI and reused, preferably with some sort of expiry time (i have no idea how)
23 replies
CC#
Created by misk on 3/28/2023 in #help
❔ Blazor server app, base url / base page to set environment
Hi 🙂 I have a Blazor Server app, where I would like to use some dynamic baseurl. Say instead of mywebsite.com/users I would like it to be mywebsite.com/{Environment}/users so that I can see which environments users I am looking at. Basically I would like to have that Environment path always filled, and if you hit the mywebsite.com directly I would the redirect it to mywebsite.com/production as an example. How would I set that up? It seems like a weird thing to handle in the razor pages with something like @page /{Environment}/users on all my pages including having to handle the logic of switching/using the correct environment on all pages.
2 replies