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

Is the static user fixture a requirement? #26

Open
prewk opened this issue Oct 30, 2020 · 8 comments
Open

Is the static user fixture a requirement? #26

prewk opened this issue Oct 30, 2020 · 8 comments

Comments

@prewk
Copy link

prewk commented Oct 30, 2020

Wouldn't it be sensible to allow environment variables to determine the user, as is common in a CI context?

This solution requires one to commit user credentials into git 😓

@prewk
Copy link
Author

prewk commented Oct 30, 2020

I tried forking and fixing it, but for some weird reason I can't push to my fork! Never happened to me before, so I'm at loss here.. anyway, the solution I was going for was allowing kcLogin to take either the string it's taking today or a UserData object, and then doing a typeof user === 'string' check.

So the signature would change to kcLogin(user: string | UserData): Chainable<KcTokens>;

I don't know enough about Cypress or keycloak to be confident about that solution, however, and the tests in this package just sat around and failed to start so 🤷 hehe..

(Btw, is kcLogin really returning Chainable<KcTokens>..? Is Cypress solving that, because it seems to be missing a return on src/kc-login.ts:6 and src/kc-login.ts:11 but then again, I don't know much about Cypress)

@jdtully
Copy link

jdtully commented Oct 30, 2020

I ran into this problem as well, and separating the credentials from the repo is on my Issues list. It would be nice if the package was updated to work with .env as I DO have Cypress.env working beside for the credentials

@jdtully
Copy link

jdtully commented Nov 24, 2020

Any movement on this?

@bethaniala
Copy link

We're not using this plugin yet, because we would have to store the user credentials in git without encryption. It would be great if we had the flexibility of passing the username and password directly to kcLogin. This way we could store them in env variables or store them encrypted in git and decrypt them before calling kcLogin.

@rm3l
Copy link

rm3l commented Jan 25, 2021

We had similar concerns, so I opened #32 as a new PR before just seeing this open issue :-)

@prewk I thought about the same approach you mentioned to handle both types :-)

Hopefully the PR gets merged soon.

Meanwhile, if anyone wants to give it a try, feel free to point to the fork I created, by updating your package.json file :

"cypress-keycloak-commands": "rm3l/cypress-keycloak-commands#distrib",

@prewk
Copy link
Author

prewk commented Jan 25, 2021

Cool, I can't promise I have the time to try it atm due to stuff but awesome work!

@jdtully
Copy link

jdtully commented May 10, 2021

any movement on this repo?

@prewk
Copy link
Author

prewk commented May 10, 2021

This package is pretty solid: https://github.com/babangsund/cypress-keycloak

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

Successfully merging a pull request may close this issue.

4 participants