Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0ecdd00
Corrections and additions to the authentication documentation section…
techcobweb Sep 26, 2024
c6a7836
further adjustments to the authentication explanation
techcobweb Sep 26, 2024
690cbd5
further adjustments to the authentication explanation
techcobweb Sep 26, 2024
8c333d4
further adjustments to the authentication explanation
techcobweb Sep 26, 2024
190bc53
Merge pull request #832 from galasa-dev/mcobbett-auth-updates
jt-nti Sep 26, 2024
ba5af02
Added usage instructions for mac users to use the homebrew installer …
techcobweb Sep 27, 2024
fa23eb3
Merge pull request #835 from galasa-dev/mcobbett-homebrew-usage-instr…
jt-nti Sep 27, 2024
6a23138
Remove outdated helm install information around accessing ecosystem s…
eamansour Oct 4, 2024
cf1c956
Fix rendering text with angled brackets
eamansour Oct 4, 2024
4c9ae15
Merge pull request #837 from eamansour/em-update-helm-instructions
jt-nti Oct 10, 2024
ff1baa9
Update vscode tasks
jt-nti Oct 11, 2024
bda33e0
Merge pull request #838 from jt-nti/devcontainer-host
jt-nti Oct 11, 2024
3c358ea
Add CPS property cache
jt-nti Oct 24, 2024
4baddee
Merge pull request #839 from jt-nti/1889-rest-cache
jt-nti Oct 24, 2024
35c2bce
docs: Add docs on rotating encryption keys and managing secrets
eamansour Nov 1, 2024
40f91db
docs: Add manual steps to rotate encryption keys and move encryption …
eamansour Nov 1, 2024
12c582a
docs: Remove duplicate prerequisites
eamansour Nov 4, 2024
34a6845
docs: Replace rotate-encryption-keys link to main branch with to-be-r…
eamansour Nov 5, 2024
c88826f
review: Replace mentions of 'CREDS' with 'credentials store'
eamansour Nov 5, 2024
ce6f6c7
fix: Replace links to specific released helm chart versions with link…
eamansour Nov 25, 2024
459c25e
Merge pull request #840 from eamansour/iss1467-encryption-docs
jt-nti Nov 29, 2024
a523edc
Merge branch 'next' of github.com:galasa-dev/galasa.dev into jade-0.3…
jadecarino Dec 5, 2024
ea18afe
correcting javadoc urls
jadecarino Dec 5, 2024
62bccf9
updating docker image locations for galasa-isolated
jadecarino Dec 5, 2024
ba43199
updating example simbank versions to 0.38.0 now version is being kept…
jadecarino Dec 5, 2024
6e6a6e4
Merge pull request #843 from galasa-dev/jade-0.38.0-updates
jt-nti Dec 5, 2024
bf8c4ad
Update docs for 0.38.0 release
jt-nti Dec 5, 2024
8b5870e
Merge pull request #842 from jt-nti/prepare-0.38.0
jt-nti Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"label": "Serve (Development)",
"type": "shell",
"command": "npm run develop",
"command": "npm run develop -- --host 0.0.0.0",
"group": {
"kind": "build"
},
Expand All @@ -16,7 +16,7 @@
{
"label": "Serve",
"type": "shell",
"command": "npm run build && npm run serve",
"command": "npm run build && npm run serve -- --host 0.0.0.0",
"group": {
"kind": "build"
},
Expand Down
10 changes: 6 additions & 4 deletions src/data/nav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@
- title: Configuring authentication
path: /docs/ecosystem/ecosystem-authentication
- title: Configuring an Ecosystem using resource files
path: /docs/ecosystem/cps-yaml
- title: Updating credentials in an Ecosystem
path: /docs/ecosystem/ecosystem-update-creds
path: /docs/ecosystem/resources-yaml
- title: Managing credentials in an Ecosystem
path: /docs/ecosystem/ecosystem-manage-creds
- title: Managing configuration properties
path: /docs/ecosystem/ecosystem-manage-cps
path: /docs/ecosystem/ecosystem-manage-cps
- title: Managing Ecosystem encryption keys
path: /docs/ecosystem/ecosystem-managing-encryption-keys
- title: Managing tests in a Galasa Ecosystem
path: /docs/manage-ecosystem
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ The following versions of the Galasa CLI are available to download for different

Complete the following steps to install Galasa for using the command line:

On Mac:

1. On a Mac, the `homebrew` tool can be used to install the `galasactl` tool. Or you can follow the Unix instructions
2. Connect `homebrew` to the 'tap' it can use: `brew tap galasa-dev/tap`
3. Then you have a choice. Either install the latest version fo the `galasactl` tool, or install a specific version.
1. To install the latest version of `galasactl`:
`brew install --no-quarantine galasactl`
2. To install a specific version of `galasactl` (version 0.38.0 for example):
`brew install --no-quarantine [email protected]`
Note: You can check to see what versions are available using this:
`brew tap-info galasa-dev/tap --json` and look in the `"cask_tokens"` part of the json file.

On Mac or Unix:

1. Find out the architecture of your machine by typing the command `uname -m` into your terminal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ Note: The example uses port `8080` but you can use a different port.
docker load -i isolated.tar
```

The following confirmation message is received: _Loaded image: icr.io/galasadev/galasa-distribution:main_.
The following confirmation message is received: _Loaded image: ghcr.io/galasa-dev/galasa-isolated:main_.

2. Run the container by using the following command:
```
docker run -d -p 8080:80 --name galasa icr.io/galasadev/galasa-distribution:main
docker run -d -p 8080:80 --name galasa ghcr.io/galasa-dev/galasa-isolated:main
```

3. Go to `http:\\localhost:8080` to view the running container.
Expand Down
47 changes: 38 additions & 9 deletions src/markdown-pages/docs/ecosystem/ecosystem-authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ path: "/docs/ecosystem/ecosystem-authentication"
title: "Configuring authentication"
---

Before interacting with a Galasa Ecosystem using the Galasa command line tool (galasactl), you must be authenticated with it. Galasa uses personal access tokens to authenticate users who want to interact with a Galasa Ecosystem provided by the `GALASA_BOOTSTRAP` environment variable or through the `--bootstrap` flag.
Before interacting with a Galasa Ecosystem using the Galasa command line tool (`galasactl`), you must be authenticated with it. Any `galasactl` command which connects to a remote Galasa service needs to know the address of that service. A URL can be configured in the `GALASA_BOOTSTRAP` environment variable or it can be set on a per-command basis using the `--bootstrap` flag.

Once the `galasactl` tool knows which Galasa service to contact, it needs to be configured to be able to authenticate to that service.
To do that, the Galasa Web UI must be used to allocate a personal access token, which can be passed to the `galasactl` to be used.

Personal access tokens are stored in the `GALASA_TOKEN` property in the `galasactl.properties` file in your Galasa home folder. The `galasactl.properties` file is created when you run the `galasa local init` command. Setting the `GALASA_TOKEN` property in this file with a valid token value allows the galasactl tool to access and communicate with an Ecosystem on behalf of the user.
A personal access tokens is stored in the `GALASA_TOKEN` property in the `galasactl.properties` file in your Galasa home folder, or in the `GALASA_TOKEN` environment variable. The `galasactl.properties` file is created when you run the `galasa local init` command. Setting the `GALASA_TOKEN` property in this file with a valid token value allows the galasactl tool to access and communicate with an Ecosystem on behalf of the user.


If you have [installed your Galasa Ecosystem](../ecosystem/ecosystem-installing-k8s) by using the Galasa Ecosystem Helm chart that is provided with Galasa, you will have access to the Galasa Web UI. To get a value for the `GALASA_TOKEN` property, log into the Galasa Web UI and request a personal access token which can be copied into the `GALASA_TOKEN` property. The instructions on how to do this are displayed in a dialog box in the Galasa Web UI. You can choose to set the token as an environmental variable but the value would not persist across terminals, so is only valid for that session.
If you have [installed your Galasa Ecosystem](../ecosystem/ecosystem-installing-k8s) by using the Galasa Ecosystem Helm chart that is provided with Galasa, you will have access to the Galasa Web UI. To get a value for the `GALASA_TOKEN` property, log into the Galasa Web UI and request a personal access token (using the 'My Settings' page) which can be copied into the `GALASA_TOKEN` property. The instructions on how to do this are displayed in a dialog box in the Galasa Web UI. You can choose to set the token as an environmental variable but the value would not persist across terminals, so is only valid for that session.

## Authentication architecture

Expand All @@ -18,10 +19,13 @@ The following diagram shows the architecture for the authentication process:
![Galasa ecosystem architecture:](ecosystem-cluster-auth.svg)


When a user logs into the Galasa Web UI via their browser, the Web UI contacts the Galasa API server which in turn talks to a Dex server, providing it with the user ID. The Dex server talks to an identity provider, for example GitHub or LDAP, to authenticate that user. If the user is successfully authenticated, the provider returns an access token to the Dex server which sends that token to Galasa API server. The token is then sent to the Galasa Web UI where it is visible to the user. The user can then configure that token into the galasactl command line tool by updating the `GALASA_TOKEN` property in the `galasactl.properties` file. The user can then be authenticated each time the galasactl tool is used to log into a Galasa Ecosystem.
When a user logs into the Galasa Web UI via their browser, the Web UI contacts the Galasa API server which in turn talks to a Dex server, providing it with the user ID. The Dex server talks to an identity provider, for example GitHub or LDAP, to authenticate that user. If the user is successfully authenticated, Dex returns a bearer token to the Galasa API server, which in turn passes the token to the Galasa Web UI. The bearer token is then stored in a cookie by the web browser, to be used in further interactions with the Galasa Web UI until the user logs out of the web application, or the token expires.

Once logged-in to the Web UI, the user can then create a new access token token (using the 'My Settings' page). This provides a secret access token which must be copied from the Web UI panel and made available to the `galasactl` command line tool. The access token can be placed in the `GALASA_TOKEN` property in the `galasactl.properties` file, or the `GALASA_TOKEN` environment variable.

On a successful login, a `bearer-token.json` file is created in the Galasa home directory. This file contains a bearer token that galasactl uses to authenticate requests when communicating with a Galasa Ecosystem. If the bearer token expires, galasactl automatically attempts to re-authenticate with the Galasa Ecosystem using the properties in the `galasactl.properties` file within the Galasa home directory.
The `galasactl` tool will login implicitly when it needs to contact the remote Galasa service. Or the login state can be explicitly controlled using the `galasactl auth login` and `galasactl auth logout` commands.

On a successful login using the `galasactl` tool, the `GALASA_TOKEN` will be used to create a new temporary bearer token, which is stored in the `bearer-tokens` folder in the Galasa home directory. This file contains a bearer token that galasactl uses to authenticate requests when communicating with a Galasa Ecosystem. If the bearer token expires, galasactl automatically attempts to re-authenticate with the Galasa Ecosystem using the configured `GALASA_TOKEN`.


### Logging in to a Galasa Ecosystem using the auth login command
Expand All @@ -31,7 +35,7 @@ You can log in to a Galasa Ecosystem explicitly by using the `galasactl auth log

### Logging out of a Galasa Ecosystem using the auth logout command

To log out of a Galasa Ecosystem using galasactl, you can use the `galasactl auth logout` command. If you run a galasactl command that interacts with an Ecosystem while logged out, galasactl will attempt to automatically log in using the properties in your `galasactl.properties` file within your Galasa home directory.
To log out of a Galasa Ecosystem using galasactl, you can use the `galasactl auth logout` command. If you run a galasactl command that interacts with an Ecosystem while logged out, galasactl will attempt to automatically log again in using the configured `GALASA_TOKEN`.


### Listing personal access tokens
Expand All @@ -51,6 +55,21 @@ Total:2

The returned token list is sorted in creation date order, with the earliest creation date first. The description information matches the description that is provided by the user when creating a new access token from the Galasa Web UI.

You can also get tokens for a specific user

```
> galasactl auth tokens get --user [email protected]
tokenid created(YYYY/MM/DD) user description
09823128318238 2024-02-03 [email protected] Ecosystem1 access

Total:1
```

If you are unsure which user id you are currently using, you can find out with this command:
```
> galasactl users get --id me
id: [email protected]
```

### Revoking personal access tokens

Expand All @@ -59,10 +78,20 @@ If a user moves to a new role, or loses a laptop with their personal access toke
You can retrieve a list of available personal access tokens that have been created, along with their token IDs, by running the `galasactl auth tokens get` command, as described in the previous section.


Run the following command to revoke a personal access token with the token ID `myId`:
Run the following command to revoke a personal access token with the token ID `myId` substituted for the numeric value visible from the `galasactl auth tokens get` command.

```
galasactl auth tokens delete --tokenid {myId}
```

For example:
```
galasactl auth tokens delete --tokenid myId
> galasactl auth tokens get --user [email protected]
tokenid created(YYYY/MM/DD) user description
09823128318238 2024-02-03 [email protected] Ecosystem1 access

Total: 1
> galasactl auth tokens delete --tokenid 09823128318238
```

*Note:* The `galasactl auth tokens delete` command revokes personal access tokens that a user creates through the Galasa Web UI. When a user runs a CLI command that talks to the Ecosystem, the CLI uses the personal access token to get a JSON Web Token (JWT). A JWT is a separate, temporary token that identifies a user and is used in galasactl commands to talk to the API server. JWTs cannot be revoked, but they do expire, so a user can continue to run CLI commands after revoking their personal access token until their JWT expires. You can remove the JWT that is stored on a user's machine instead of having to wait for the JWT to expire, by running the `galasactl auth logout` command on that machine.
Expand Down
Loading
Loading