Skip to content

Commit

Permalink
Adds new documentation (INTO-CPS-Association#803)
Browse files Browse the repository at this point in the history
  - Updates admin documentation for docker installation,
    OAuth2 authorization, independent packages.
  - Updates user docs for HTTP mode of lib microservice.
  - Adds documentation for three new examples.

---------
Co-authored-by: Asti <[email protected]>
  • Loading branch information
prasadtalasila authored Jun 5, 2024
1 parent 5cd60ee commit 89c9125
Show file tree
Hide file tree
Showing 56 changed files with 1,050 additions and 732 deletions.
17 changes: 3 additions & 14 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ This brings up the containers, without the AuthMS authentication.
- Currently the _email_ fields for each user in
_dtaas.toml_ are not in use, and are not necessary
to fill in. These emails must be configured manually
for each user in the docker/conf.local or
docker/conf.server files and the _traefik-forward-auth_
for each user in the
deploy/docker/conf.server files and the _traefik-forward-auth_
container must be restarted. This is done as follows:

- Go to the _docker_ directory
Expand All @@ -94,13 +94,6 @@ This brings up the containers, without the AuthMS authentication.
cd <DTaaS>/docker
```

- Add two lines to the `conf.local` file

```txt
rule.onlyu4.action=allow
rule.onlyu4.rule=PathPrefix(`/user4`)
```

- Add three lines to the `conf.server` file

```txt
Expand All @@ -109,16 +102,12 @@ rule.onlyu3.rule=PathPrefix(`/user3`)
rule.onlyu3.whitelist = [email protected]
```

Run the appropritate command for a server/local installation:
Run the command for these changes to take effect:

```bash
docker compose -f compose.server.yml --env-file .env up -d --force-recreate traefik-forward-auth
```

```bash
docker compose -f compose.local.yml --env-file .env up -d --force-recreate traefik-forward-auth
```

The new users are now added to the DTaaS
instance, with authorization enabled.

Expand Down
19 changes: 0 additions & 19 deletions deploy/config/client/env.trial.js

This file was deleted.

1 change: 0 additions & 1 deletion deploy/config/gateway/auth

This file was deleted.

35 changes: 0 additions & 35 deletions deploy/config/gateway/fileConfig.local.yml

This file was deleted.

48 changes: 0 additions & 48 deletions deploy/config/gateway/fileConfig.trial.yml

This file was deleted.

61 changes: 0 additions & 61 deletions deploy/config/gateway/fileConfig.yml

This file was deleted.

20 changes: 0 additions & 20 deletions deploy/config/gateway/traefik.yml

This file was deleted.

17 changes: 3 additions & 14 deletions docs/admin/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ This brings up the containers, without the AuthMS authentication.
- Currently the _email_ fields for each user in
_dtaas.toml_ are not in use, and are not necessary
to fill in. These emails must be configured manually
for each user in the docker/conf.local or
docker/conf.server files and the _traefik-forward-auth_
for each user in the
deploy/docker/conf.server files and the _traefik-forward-auth_
container must be restarted. This is done as follows:

- Go to the _docker_ directory
Expand All @@ -91,13 +91,6 @@ This brings up the containers, without the AuthMS authentication.
cd <DTaaS>/deploy/docker
```

- Add two lines to the `conf.local` file

```txt
rule.onlyu4.action=allow
rule.onlyu4.rule=PathPrefix(`/user4`)
```

- Add three lines to the `conf.server` file

```txt
Expand All @@ -106,16 +99,12 @@ rule.onlyu3.rule=PathPrefix(`/user3`)
rule.onlyu3.whitelist = [email protected]
```

Run the appropritate command for a server/local installation:
Run the appropritate command for a server installation:

```bash
docker compose -f compose.server.yml --env-file .env up -d --force-recreate traefik-forward-auth
```

```bash
docker compose -f compose.local.yml --env-file .env up -d --force-recreate traefik-forward-auth
```

The new users are now added to the DTaaS
instance, with authorization enabled.

Expand Down
29 changes: 6 additions & 23 deletions docs/admin/client/auth.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# OAuth for React Client

<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
!!! failure
Add screenshots from dtaas-digitaltwin.com demo.
<!-- markdownlint-enable MD046 -->

To enable user authorization on DTaaS React client website, you will use
the OAuth authorization protocol, specifically the PKCE authorization flow.
Here are the steps to get started:
Expand Down Expand Up @@ -40,12 +34,16 @@ Here are the steps to get started:
- During the creation of the OAuth application on GitLab, you need to specify
the scope. Choose openid, profile, read_user, read_repository, and api scopes.

![Creation of Client OAuth Application](client-oauth-name.png)

**5. Application ID:**

- After successfully creating the OAuth application, GitLab generates
an application ID. This is a long string of HEX values that you will need for
your configuration files.

![Scopes for Client OAuth Application](client-oauth-scopes.png)

**6. Required Information from OAuth Application:**

- You will need the following information from the OAuth application
Expand All @@ -58,26 +56,11 @@ Here are the steps to get started:
|Callback URL|REACT_APP_REDIRECT_URI|[https://foo.com/Library](https://foo.com/Library)|
|Scopes|REACT_APP_GITLAB_SCOPES|openid, profile, read_user, read_repository, api|

![Summary for Client OAuth Application](client-oauth-id.png)

**7. Create User Accounts:**

Create user accounts in gitlab for all the usernames chosen during
installation. The _trial_ installation script comes with two default
usernames - _user1_ and _user2_. For all other installation scenarios,
accounts with specific usernames need to be created on gitlab.

## Development Environment

There needs to be a valid callback and logout URLs for development and testing
purposes. You can use the same oauth application id for both development, testing
and deployment scenarios. Only the callback and logout URLs change. It is possible
to register multiple callback URLs in one oauth application. In order to use oauth
for development and testing on developer computer (localhost), you need to add the
following to oauth callback URL.

```txt
DTaaS application URL: http://localhost:4000
Callback URL: http://localhost:4000/Library
Logout URL: http://localhost:4000
```

The port 4000 is the default port for running the client website.
Binary file added docs/admin/client/client-oauth-id.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/admin/client/client-oauth-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/admin/client/client-oauth-scopes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 89c9125

Please sign in to comment.