Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
DaoDaoNoCode committed Feb 16, 2023
1 parent e3a5eaa commit 2cb51ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/SDK.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ See the [k8s pass through API](../backend/src/routes/api/k8s/pass-through.ts) he

### Pass Through Impersonate User Dev Mode

In order to check regular user permissions without disabling the rest of the backend functionality in `dev mode`, you can add the `DEV_IMPERSONATE_USER` environment variable to your local setup with a valid k8s username in your cluster. This will bypass the regular pass-through flow and will add that specific headers to the calls. The steps to impersonate another user are listed as follows:
In order to check regular user permissions without disabling the rest of the backend functionality in `dev mode`, you can add the `DEV_IMPERSONATE_USER` and `DEV_IMPERSONATE_PASSWORD` environment variables to your local setup with valid k8s username and password in your cluster. This will bypass the regular pass-through flow and will add that specific headers to the calls. The steps to impersonate another user are listed as follows:

1. Create a new env variable in your `.env.local` file with this format `DEV_IMPERSONATE_USER=<username>`
1. Create a new env variable in your `.env.local` file with this format `DEV_IMPERSONATE_USER=<username>` and `DEV_IMPERSONATE_PASSWORD=<password>`
2. Run the dev server for ODH dashboard. If you don't know how to run a local dev server, please refer to [CONTRIBUTING](../CONTRIBUTING.md)
3. Click on the username on the top right corner to open the dropdown menu, and choose `Start impersonate`, then the page will refresh and you will be impersonating as the user you set up in step 1
4. To stop impersonating, click on the `Stop impersonate` button in the header toolbar

If you cannot enter impersonating mode, you may check your username and password in the local env file to see if they are set correctly.

## Patches

Patches are based on [jsonpatch](https://jsonpatch.com/). For those who are unaware of the details let's do a quick breakdown on how they work. When making a `k8sPatchResource` call, it will ask for `Patches[]`. A `Patch` is just simply a straight forward operation on the existing resource.
Expand Down

0 comments on commit 2cb51ba

Please sign in to comment.