Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.okta.env file is actually a bash #69

Open
ruXlab opened this issue Nov 21, 2020 · 6 comments
Open

.okta.env file is actually a bash #69

ruXlab opened this issue Nov 21, 2020 · 6 comments

Comments

@ruXlab
Copy link

ruXlab commented Nov 21, 2020

Hello!

I'm not sure was intentional but okta apps create generates effectively sh-like file.
.env is key-value file format is very popular and has support pretty much in any language and docker

Expected behaviour

.env file is produced with format like:

KEY=VALUE

Current behaviour

.okta.env has format like:

export KEY=VALUE

Workarond

The generated file can be converted to .env by stipping export bit with simple command:

sed -i 's/^export //' .okta.env

Okta CLI version: 0.7.1-1f9781e

@mraible
Copy link
Contributor

mraible commented Nov 21, 2020

The current way sets environment variables if you run source .okta.env. If you changed to just KEY=VALUE, you'd have to have something that reads this file and converts this to environment variables. This looks interesting for Java apps: https://github.com/cdimascio/java-dotenv.

@mraible
Copy link
Contributor

mraible commented Mar 12, 2021

Part of me feels we should emit okta.bat with set instead of export for Windows. Particularly for Windows + Java users.

On the .NET side, it seems our .NET blog posts don't use environment variables. Instead, they rely on values in files. Maybe .NET is just not as sophisticated as Java. 😜

@bdemers
Copy link
Contributor

bdemers commented Mar 24, 2021

💯
I wish something like dotenv would be standard across all frameworks/libraries/langs

@mraible
Copy link
Contributor

mraible commented Mar 24, 2021

Here's another dotenv library that might work for Spring Boot. https://github.com/paulschwarz/spring-dotenv

@bdemers
Copy link
Contributor

bdemers commented Mar 24, 2021

I'm just not sure we could/should make that a requirement to use the cli.

@mraible
Copy link
Contributor

mraible commented Mar 24, 2021

Agreed. Could be something to try in a future post though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants