riok/Kreya

Resolving some Windows environment variables.

AFract opened this issue · 3 comments

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

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?

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

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 }}.