Repository navigation
docs: log in once to a self-hosted k8s-proxy - #983
Merged
Merged
Conversation
The k8s-proxy auth section of the cloud replay page gains "Log in once on your own machine": `keploy login --k8s-proxy-url <ingress>` checks the API key at the proxy and saves the key and the URL in an owner-only ~/.keploy/cred.yaml, so later commands need neither KEPLOY_API_KEY nor KEPLOY_K8S_PROXY_URL. It covers `keploy login --show`, `keploy logout`, the one-time offer to save variables already exported (asked only in a terminal), the precedence (flag, environment, keploy.yml, saved login), and keeps the environment variables for CI. The CLI reference lists the login's --k8s-proxy-url and --show flags, says logout removes a saved login, and counts a saved login among what makes a run self-hosted for the update check. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
keploy login --show now also prints whether k8s-proxy-auth mode is on and what turned it on or off: the --k8s-proxy-auth flag, the KEPLOY_K8S_PROXY_AUTH variable, a k8s-proxy URL (with keploy logout as the way back for a saved one), or keploy.yml's cloud.k8sProxyAuth. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
A command run in a terminal with KEPLOY_API_KEY and KEPLOY_K8S_PROXY_URL exported now offers to save them only once it has finished successfully. The question waits 10 seconds at most, with no answer saving nothing, and never changes the exit code. A run in CI never asks, even when the runner gives it a terminal. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
On Windows the CLI keeps the login in .keploy under HOMEDRIVE+HOMEPATH, or USERPROFILE when those are not set. keploy login uses a saved key without asking, and its key prompt does not show what is typed. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
A run sent to the background of its terminal is never asked, so the question cannot stop it, and an Enter typed while the command ran does not answer it. The key sources of keploy login --k8s-proxy-url include a login already saved. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
A self-hosted run asked to save its login and moved to the background while the question waits (Ctrl-Z, then bg) stops waiting at once and saves nothing, as the CLI now does. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Self-hosted users no longer have to export
KEPLOY_API_KEYandKEPLOY_K8S_PROXY_URLin every shell. The cloud replay page's k8s-proxyauth section gains "Log in once on your own machine":
keploy login --k8s-proxy-url https://<ingress> --api-key <key>checksthe key at the proxy and, only if the proxy accepts it, saves the key and
the URL in
~/.keploy/cred.yaml(on Windows,.keploy\cred.yamlin thehome folder:
%HOMEDRIVE%%HOMEPATH%, else%USERPROFILE%), readable bythe user only (0600; an owner-only ACL on Windows).
A refused login saves nothing.
on;
--k8s-proxy-auth=falseleaves it off for one run, andkeploy logoutremoves the saved login.
keploy login --showprints the key (last 4 characters) and the URL,where each comes from, and whether k8s-proxy-auth mode is on and why, with
no network call.
after it has finished successfully, to save them, remembered per key and
URL. The question waits 10 seconds at most and never changes the exit
code. A run in CI (any CI variable, even with a terminal), without a
terminal, or in the background never asks and never saves; one moved to
the background while the question waits (Ctrl-Z, then
bg) stopswaiting at once and saves nothing; and an Enter typed before the
question does not answer it.
keploy.yml, then thesaved login. CI keeps the environment variables.
The CLI reference lists
keploy login --k8s-proxy-urland--show, sayskeploy logoutremoves a saved login, and counts a saved login among whatmakes a run self-hosted for the update check.
Checks
npx prettier@2.8.8 --checkon both changed files, as the prettifyworkflow runs it: clean.
yarn install --frozen-lockfile, theyarn.lockcheck,yarn buildandthe four verify scripts pass.