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

Generate PUML images as local PNGs #1006

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions .remarkrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"skipLocalhost": true,
"skipUrlPatterns": [
"https://security.stackexchange.com",
"https://github.com/LayerManager/layman/issues/",
"http://www.plantuml.com/plantuml/proxy"
"https://github.com/LayerManager/layman/issues/"
]
}
}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
- pytest 7.4.2 -> 7.4.3
- pytest-rerunfailures 12.0 -> 13.0
- pytest-timeout 2.1.0 -> 2.2.0
- Add development dependency `plantuml/plantuml` for rendering PlantUML diagrams.

## v1.22.3
2023-12-06
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -424,3 +424,6 @@ pull-dev-images:
docker tag layermanager/layman:client-latest layman_client_test
docker pull layermanager/layman:timgen-latest
docker tag layermanager/layman:timgen-latest timgen

render-puml-images:
docker run --rm -it -u $(UID_GID) -v $$(pwd):/src plantuml/plantuml -v /src/**/*.puml
jirik marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions doc/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@
| [jirikcz/micka](https://github.com/LayerManager/docker-micka) | GNU GPL v3 | docker-compose.yml | prod-external | bin | |
| [samtux/micka](https://github.com/samtux/docker-micka) | GNU GPL v3 | jirikcz/micka | prod-external | src | |
| [docker-library/redis](https://github.com/docker-library/redis) | BSD 3-Clause | docker-compose.yml | prod | bin | |
| [plantuml/plantuml](https://hub.docker.com/r/plantuml/plantuml) | GNU GPL v3 | Makefile | dev | bin | render PlantUML images |
Binary file added doc/oauth2/auth-code.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 doc/oauth2/get-current-user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions doc/oauth2/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Although LTC is currently the only OAuth2 client for Layman, there is an intenti

Schema specific for LTC, distinguishing client side and server side of LTC:

![auth-code.puml](http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/LayerManager/layman/master/doc/oauth2/auth-code.puml)
![auth-code.puml](auth-code.png)

### Request Layman REST API
After successful authorization, *client* is able to communicate with Layman REST API. To authenticate using OAuth2, every request to Layman REST API must contain HTTP header `Authorization`.
Expand All @@ -68,13 +68,13 @@ Because access token is known only on server side of LTC and not to client side,

General schema of any request to Layman REST API:

![rest.puml](http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/LayerManager/layman/master/doc/oauth2/rest.puml)
![rest.puml](rest.png)


### Fetch User-Related Metadata
Fetching user-related metadata happens automatically immediately after successful initial authorization by [GET Current User](../rest.md#get-current-user).

![get-current-user.puml](http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/LayerManager/layman/master/doc/oauth2/get-current-user.puml)
![get-current-user.puml](get-current-user.png)

The fetch should happen regularly during end-user session to test if authentication (access token) is still valid.

Expand All @@ -84,7 +84,7 @@ Immediately after the first [fetch of user-related metadata](#fetch-user-related

Username is reserved by [PATCH Current User](../rest.md#patch-current-user). Username can be either generated automatically (this approach is used by LTC) or set manually; this is controlled by `adjust_username` parameter.

![patch-current-user.puml](http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/LayerManager/layman/master/doc/oauth2/patch-current-user.puml)
![patch-current-user.puml](patch-current-user.png)

### Refresh Access Token
During end-user's session, *client* keeps both access tokens and refresh token. When access token expires or it's lifetime is close, *client* should use refresh token to generate new access token at [Token Endpoint](https://tools.ietf.org/html/rfc6749#section-3.2).
Expand All @@ -93,7 +93,7 @@ In case of LTC, refreshing happens automatically on any request to Layman REST A

Schema specific for LTC:

![refresh.puml](http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/LayerManager/layman/master/doc/oauth2/refresh.puml)
![refresh.puml](refresh.png)


## Settings
Expand Down
Binary file added doc/oauth2/patch-current-user.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 doc/oauth2/refresh.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 doc/oauth2/rest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.