riok / Kreya

Kreya is a GUI client for gRPC and REST APIs with innovative features for environments, authorizations and more.
https://kreya.app
279 stars 5 forks source link

Resolving some Windows environment variables. #242

Open AFract opened 5 days ago

AFract commented 5 days ago

Hello,

Under Windows, to authenticate to a certain service, I need to send the windows network username. I would like to be able to resolve it as it's returned for example when calling the .Net "Environment.UserName" property (I know Kreya is in .Net so you can easily figure how it's computed).

Is it possible to do this in Kreya with {{ }} syntax ? I didn't find it in documentation if it's already supported, sorry.

Of course I could store it hard-coded in a Kreya environment variable, but it's not convenient for a shared Kreya project between several users.

Thank you

ni507 commented 5 days ago

Hello and thank you for your report.

At the moment it is only possible to use environment variables prefixed with KREYA_ENV_ as documented here.

Does this meet your needs?

AFract commented 5 days ago

For me it does not meet at all my question. Or could you please provide me a working example for Environment.UserName ?

ni507 commented 5 days ago

Okay, at the moment it's not possible to access an environment variable directly (e.g. UserName). You would have to create a new environment variable like KREYA_ENV_UserName and can access it with {{ env.UserName }}.

Since this may not be what you want, I have added it to our backlog that it is possible to access the environment directly with something like {{ system.env.UserName }}.