Skip to content
Snippets Groups Projects
Commit e23dfe2e authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Update doc for proxy query

parent eb243527
No related branches found
No related tags found
No related merge requests found
Pipeline #5374 failed
docs/assets/proxy-download.png

47.6 KiB

docs/assets/proxy-map.png

52.9 KiB

# Query proxy
## Features
This proxy provides an interface between the data portal, which use cookies and JWT token as authentication means, and the server hosting map services and dataset related files which only understands basic authentication.
The proxy plays a role in to functionalities of the portal:
- the display of data on the map
- the download of the data under different output formats
Depending on the dataset's license, those services/files might be in open access or restricted access. Our goal is to display to a particular user exactly what it's accesses are allowing him to see.
Though, in order for the map to work properly and to always be able to display the full data on the portal, it has been decided that WMS would always be opened even if the user doesn't have access to the dataset.
## Dependencies
The dependencies of the proxy are:
- `Elasticsearch`: used to verify whether a dataset is in open access or not, and if the user has access to the MVT layer pour the /map endpoints
- `Legacy auth Middleware`: used to verify if the user has access to the service of the requested layer
- `MapServer`: which expose the WMS and MVT services
- the server hosting static files
## Endpoints
It provides the following endpoints:
- `/map`: which proxy requests for the map feature, the sub-routes are:
- `/wms`: which proxy requests to the WMS service
- `/mvt`: which proxy requests to the MVT service
- `/ign`: which proxy requests to the IGN ortho layer adding the API key
- `/download`: which proxy requests for the download feature, the sub-routes are
- `/wms`
- `/wfs`
- `/ws`
- `/kml`
- `/wcs`
- `/files`
- `/catalogue`
## Implementation
This proxy has been written in [Node.js](https://nodejs.org/) using the framework [Express](https://expressjs.com/) and the [http-proxy](https://github.com/http-party/node-http-proxy) node module to proxy requests.
The following diagram explains the logic implemented behind /map:
![Proxy map diagram sequence](../../assets/proxy-map.png)
The following diagram sequence explains what is happening behind the `/download` endpoint.
![Proxy download diagram sequence](../../assets/proxy-download.png)
# Web mapping services
## Features
This service is the unique entrypoint of the map in the portal toward the geographical services of the datasets hosted on our platform. It proxifies two services:
* `WMS`
* `MVT`
Depending on the dataset's license, those services might be in open access or restricted access. Our goal is to display to a particular user exactly what it's access are allowing him to see. It wasn't possible to add the authentication pieces as the map services are expecting it (basic auth) directly from the web application this is why we created this proxy.
In order for the map to work properly and to always be able to display the full data on the portal, it has been decided that WMS would always be opened even if the user doesn't have access to the dataset.
## Dependencies
This proxy has two dependencies:
* `Elasticsearch`: used to verify whether the user has access to the requested service and for the specified layer
* `MapServer`: which expose the WMS and MVT services
## Endpoints
It provides two endpoints:
* `/wms`: which proxy request to the WMS service
* `/mvt`: which proxy request to the MVT service
## Implementation
This proxy has been written in [Node.js](https://nodejs.org/) and based on [http-proxy](https://github.com/http-party/node-http-proxy) node module.
...@@ -113,7 +113,7 @@ M1 | Legacy AUTH | Facilitating the interaction between the Web Portal Authentic ...@@ -113,7 +113,7 @@ M1 | Legacy AUTH | Facilitating the interaction between the Web Portal Authentic
ID | Name | Usage | Lang | Repo | Doc | Deps ID | Name | Usage | Lang | Repo | Doc | Deps
--- | --- | --- | --- | --- | --- | --- --- | --- | --- | --- | --- | --- | ---
P1 | Web Mapping Services| Proxying requests that the Web Portal performs against the cartographic Web Services (WMS, MVT) hosted by data.grandlyon.com's Core macro-component | TypeScript | [Link](https://forge.grandlyon.com/web-et-numerique/web-et-numerique-internet/data.grandlyon.com/web-portal/components/proxies/web-mapping-services) | [Link](../components/proxies/web-mapping-services.md) | A1, C4 P1 | Web Mapping Services| Proxying requests that the Web Portal performs against the cartographic Web Services (WMS, MVT) hosted by data.grandlyon.com's Core macro-component | TypeScript | [Link](https://forge.grandlyon.com/web-et-numerique/web-et-numerique-internet/data.grandlyon.com/web-portal/components/proxies/query) | [Link](../components/proxies/query.md) | A1, C4
......
...@@ -4,7 +4,7 @@ site_author: Métropole de Lyon ...@@ -4,7 +4,7 @@ site_author: Métropole de Lyon
theme: theme:
name: null name: null
custom_dir: 'custom-material-theme' custom_dir: "custom-material-theme"
language: en language: en
palette: palette:
primary: dark-blue primary: dark-blue
...@@ -20,69 +20,69 @@ theme: ...@@ -20,69 +20,69 @@ theme:
extra_css: [extra.css] extra_css: [extra.css]
markdown_extensions: markdown_extensions:
- plantuml_markdown: - plantuml_markdown:
server: http://www.plantuml.com/plantuml server: http://www.plantuml.com/plantuml
nav: nav:
- Home: index.md - Home: index.md
- Overview: overview/index.md - Overview: overview/index.md
- Architecture: architecture/index.md - Architecture: architecture/index.md
- Components: - Components:
- Core Components: - Core Components:
- Legacy AUTH: components/core/legacy-auth.md - Legacy AUTH: components/core/legacy-auth.md
- Custom apps: - Custom apps:
- Web App: - Web App:
- Overview: components/custom-apps/web-app/overview.md - Overview: components/custom-apps/web-app/overview.md
- Homepage: components/custom-apps/web-app/homepage.md - Homepage: components/custom-apps/web-app/homepage.md
- Changelog: components/custom-apps/web-app/changelog.md - Changelog: components/custom-apps/web-app/changelog.md
- Feedback: components/custom-apps/web-app/feedback.md - Feedback: components/custom-apps/web-app/feedback.md
- Reuses: components/custom-apps/web-app/reuses.md - Reuses: components/custom-apps/web-app/reuses.md
- Partners: components/custom-apps/web-app/partners.md - Partners: components/custom-apps/web-app/partners.md
- Credits: components/custom-apps/web-app/credits.md - Credits: components/custom-apps/web-app/credits.md
- Static pages: components/custom-apps/web-app/static-pages.md - Static pages: components/custom-apps/web-app/static-pages.md
- Dataset: - Dataset:
- Data: components/custom-apps/web-app/dataset/data.md - Data: components/custom-apps/web-app/dataset/data.md
- Information: components/custom-apps/web-app/dataset/info.md - Information: components/custom-apps/web-app/dataset/info.md
- API & Downloads: components/custom-apps/web-app/dataset/resources.md - API & Downloads: components/custom-apps/web-app/dataset/resources.md
- Header: components/custom-apps/web-app/header.md - Header: components/custom-apps/web-app/header.md
- Footer: components/custom-apps/web-app/footer.md - Footer: components/custom-apps/web-app/footer.md
- Drafts: components/custom-apps/web-app/drafts.md - Drafts: components/custom-apps/web-app/drafts.md
- Side Menu: components/custom-apps/web-app/side-menu.md - Side Menu: components/custom-apps/web-app/side-menu.md
- User management: components/custom-apps/web-app/user-management.md - User management: components/custom-apps/web-app/user-management.md
- Contact: components/custom-apps/web-app/contact.md - Contact: components/custom-apps/web-app/contact.md
- Search: components/custom-apps/web-app/search.md - Search: components/custom-apps/web-app/search.md
- Admin GUI: components/custom-apps/admin-gui.md - Admin GUI: components/custom-apps/admin-gui.md
- Off-the-shelf applications: - Off-the-shelf applications:
- API Gateway: components/off-the-shelf-apps/api-gateway.md - API Gateway: components/off-the-shelf-apps/api-gateway.md
- Headless CMS: components/off-the-shelf-apps/cms.md - Headless CMS: components/off-the-shelf-apps/cms.md
- Search Engine: components/off-the-shelf-apps/elasticsearch.md - Search Engine: components/off-the-shelf-apps/elasticsearch.md
- Middlewares: - Middlewares:
- Legacy AUTH: components/middlewares/legacy-auth.md - Legacy AUTH: components/middlewares/legacy-auth.md
- Proxies: - Proxies:
- Web mapping services: components/proxies/web-mapping-services.md - Web mapping services: components/proxies/query.md
- Miscellaneous: - Miscellaneous:
- Maintenance page: components/miscellaneous/maintenance-page.md - Maintenance page: components/miscellaneous/maintenance-page.md
- Indexers: - Indexers:
- Metadata and Data: components/indexers/metadata-and-data.md - Metadata and Data: components/indexers/metadata-and-data.md
- Editorial Content: components/indexers/editorial-content.md - Editorial Content: components/indexers/editorial-content.md
- Services: - Services:
- Authentication: components/services/authentication.md - Authentication: components/services/authentication.md
- Changelog: components/services/changelog.md - Changelog: components/services/changelog.md
- Credits: components/services/credits.md - Credits: components/services/credits.md
- Reuses: components/services/reuses.md - Reuses: components/services/reuses.md
- CSV Catalog Downloader: components/services/csv-catalog-downloader.md - CSV Catalog Downloader: components/services/csv-catalog-downloader.md
- Mailer: components/services/mailer.md - Mailer: components/services/mailer.md
- Media Library: components/services/media-library.md - Media Library: components/services/media-library.md
- Organizations: components/services/organizations.md - Organizations: components/services/organizations.md
- Resources helper: components/services/resources-helper.md - Resources helper: components/services/resources-helper.md
- Social media share helper: components/services/social-media-share-helper.md - Social media share helper: components/services/social-media-share-helper.md
- Tools: - Tools:
- Minio master-slave mirror: components/tools/minio-master-slave-mirror.md - Minio master-slave mirror: components/tools/minio-master-slave-mirror.md
- Administration: administration/admin-tools.md - Administration: administration/admin-tools.md
- Deployment: - Deployment:
- 2019 deployment of the first public beta version: deployment/beta-deployment.md - 2019 deployment of the first public beta version: deployment/beta-deployment.md
- Monitoring: monitoring/monitoring.md - Monitoring: monitoring/monitoring.md
- Other: - Other:
- Security: miscellaneous/security.md - Security: miscellaneous/security.md
- NestJS-based micro-services: miscellaneous/nestjs-micro-services.md - NestJS-based micro-services: miscellaneous/nestjs-micro-services.md
- Accessibility: miscellaneous/accessibility.md - Accessibility: miscellaneous/accessibility.md
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment