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

Developer Docs for Auth MS #811

Conversation

astitva1905
Copy link
Collaborator

No description provided.

backend services and user workspaces. This document
details the system design of the
DTaaS Auth Microservice which
is responsible for the same.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces

requests of the general form ”Is User X allowed to access /BackendMS/example?”.

If the user’s identity is correctly verified though the GitLab OAuth2
provider AND this user is allowed to access the requested microservice/action, then the Auth MS should respond with a 200 (OK) code and let the
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line length

## Forward Auth Middleware in Traefik

Traefik
allows middlewares to be set for the routes configured into it. These middlewares intercept the route path requests, and perform analysis/modifications
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line length

Traefik
allows middlewares to be set for the routes configured into it. These middlewares intercept the route path requests, and perform analysis/modifications
before sending the requests ahead to the services. Traefik has a ForwardAuth
middleware that delegates authentication to an external service. If the external authentication server responds to the middleware with a 2XX response
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line length


![alt text](design-sequence.jpg)

- Any request made by the user is made on the React website, i.e. the
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lists should be surrounded by blank lines


- Go to the _docker_ directory
- Currently the _email_ fields for each user in
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation for list items at the same level

```bash
cd <DTaaS>/deploy/docker
```
- Go to the _docker_ directory
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation for list items at the same level

rule.onlyu3.rule=PathPrefix(`/user3`)
rule.onlyu3.whitelist = [email protected]
```
- Add three lines to the `conf.server` file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation for list items at the same level


- Go to the _docker_ directory
- Currently the _email_ fields for each user in
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider starting bulleted lists at the beginning of the line

rule.onlyu3.rule=PathPrefix(`/user3`)
rule.onlyu3.whitelist = [email protected]
```
- Add three lines to the `conf.server` file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider starting bulleted lists at the beginning of the line

for each user in the
deploy/docker/conf.server files and the _traefik-forward-auth_
container must be restarted. This is done as follows:
2. This brings up the containers, without the AuthMS authentication.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ordered list item prefix


DTaaS provides an easy way to add
and remove additional users from your
DTaaS instance.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces

DTaaS instance.

All such user management can be
done via the [DTaaS CLI](../cli.md)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces

- Any request made by the user is made on the React website, i.e. the
frontend of the DTaaS software.

- This request then goes through the Traefik gateway. Here it should be
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lists should be surrounded by blank lines

- This request then goes through the Traefik gateway. Here it should be
interrupted by the respective ForwardAuth middleware.

- The middleware asks the Auth MS if this request for the given user
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lists should be surrounded by blank lines


```bash
cd <DTaaS>/deploy/docker
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenced code blocks should be surrounded by blank lines

- Add three lines to the `conf.server` file
```txt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenced code blocks should be surrounded by blank lines

docker compose -f compose.server.yml --env-file .env up -d --force-recreate traefik-forward-auth
```
- Run the appropritate command for a server installation:
```bash
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenced code blocks should be surrounded by blank lines

traefik-forward-auth itself. This is so that after approval, when the user is
taken to REDIRECT URI, this can be handled by the gateway and passed
to the Auth service for token exchange.
We add the ForwardAuth middleware here,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces

```

- The traefik-forward-auth service should be added to the backend services
as a middleware.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces

### User Identity using OAuth2.0

We define some constants that will help with the following discussion:
- CLIENT ID: The OAuth2 Client ID of the Auth MS
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lists should be surrounded by blank lines

cli/DEVELOPER.md Outdated Show resolved Hide resolved
cli/DEVELOPER.md Show resolved Hide resolved
docker/README.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check the urls

docs/developer/oauth/AUTHMS.md Show resolved Hide resolved
docs/developer/oauth/OAUTH2.0.md Outdated Show resolved Hide resolved
Copy link

codeclimate bot commented Jun 16, 2024

Code Climate has analyzed commit 543d612 and detected 0 issues on this pull request.

View more on Code Climate.

@prasadtalasila
Copy link
Contributor

merged via PR #811

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 this pull request may close these issues.

2 participants