Skip to content

Commit

Permalink
Release 6.2.10 (#196)
Browse files Browse the repository at this point in the history
* set core release version 6.2.10

* changelog and readme typo
[skip ci]

* [service] upgrade passport-ldapauth

* add docker service and docs for ldap idp and move auth documentation to its own file

* [service] update engines versions in package.json
[skip ci]
  • Loading branch information
restjohn authored Mar 4, 2024
1 parent a973f41 commit 09c0b79
Show file tree
Hide file tree
Showing 16 changed files with 320 additions and 376 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ pnpm-debug.log
scratch/
*.scratch/
*.scratch.*
/docker/auth-idp/ldap/config/*
/docker/auth-idp/ldap/db/*
# this line must be last
!.gitkeep
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ MAGE adheres to [Semantic Versioning](http://semver.org/).
the `options` entry. See the related bug fix below.

#### Features
* Admins can now configure different placename search services in settings.
* Layer file download - The _Layer_ admin web page now includes a button to
download layer files when applicable. This currently works only for
GeoPackage layers.
Expand All @@ -26,7 +27,14 @@ MAGE adheres to [Semantic Versioning](http://semver.org/).
* The web app and service incorrectly used a `settings.options` sub-document on
SAML configurations to read and write some entries that should be in the
`settings` entry.
* Admin user search could crash the server when sending certain characters.
* Feed item timestamps appeared as epoch milliseconds rather than formatted dates.
* Many third-party dependencies were quite outdated or superfluous.
* Fortify static code analysis had findings that were addressed.
* GeoPackage and CSV exports had several null reference bugs.
* Some TypeScript DTS files for plain JS files were incorrect or incomplete.
* The ready event for app startup was emitting before the HTTP server was actually listening.
* The service configuration did not allow a port value of `0`, which prompts the HTTP server to pick a random open port. This helps with testing.

## [6.2.9](https://github.com/ngageoint/mage-server/releases/tag/6.2.9)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ npm run build
After building the core packages, install them as dependencies in the `instance` package.
```bash
cd instance
npm i --omit=dev ../service ../web-app ../plugins/nga-msi
npm i --omit dev ../service ../web-app ../plugins/nga-msi
```
The project's root [`package.json`](./package.json) provides some convenience script entries to install, build, and run
the MAGE server components, however, those are deprecated and will likely go away after migrating to NPM 7+'s
Expand Down
38 changes: 38 additions & 0 deletions docker/auth-idp/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
services:

mage-idp-saml:
container_name: mage-idp-saml
image: kristophjunge/test-saml-idp
Expand All @@ -14,3 +15,40 @@ services:
source: ./saml/authsources.php
target: /var/www/simplesamlphp/config/authsources.php

mage-idp-ldap:
container_name: mage-idp-ldap
image: osixia/openldap:1.5.0
environment:
- "LDAP_ORGANISATION=World's Greatest Detectives Inc."
- "LDAP_DOMAIN=wgd.com"
- "LDAP_ADMIN_PASSWORD=i found something"
ports:
- 389:389
- 636:636
volumes:
- type: bind
source: ./ldap/db
target: /var/lib/ldap
- type: bind
source: ./ldap/config
target: /etc/ldap/slapd.d
networks:
- ldap.mage.net

mage-idp-ldap-ui:
container_name: mage-idp-ldap-ui
image: osixia/phpldapadmin:latest
depends_on:
- mage-idp-ldap
environment:
- PHPLDAPADMIN_LDAP_HOSTS=mage-idp-ldap
ports:
- 6480:80
- 6443:443
networks:
- ldap.mage.net

networks:
ldap.mage.net:
driver: bridge

Empty file.
Empty file.
20 changes: 0 additions & 20 deletions docs/admin.md

This file was deleted.

128 changes: 128 additions & 0 deletions docs/admin/auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# MAGE Authentication and Identity Providers

To configure authentication settings and identity providers
1. Click the gear icon in the upper right of the MAGE web app to load the _Admin_ page.
1. Click, the _Settings_ tab in the tab strip on the left of the page.
1. Click the _Authentication_ tab near the top of the main content pane. This tab should be selected by default.
1. Click any of the accordion headings to expand the section for the authentication you want to configure, or
click the _New Authentication_ button to add a new authentication identity provider.

## Local

## OAuth 2.0

Here is an example of using Google's OAuth 2.0 [endpoints](https://developers.google.com/identity/gsi/web/guides/overview) to authenticate MAGE
users. This setup is very similar to Google OpenID Connect authentication.

Obtain your _Client Identifier_ and _Client Secret_ from Google's [API Console](https://console.cloud.google.com/apis/credentials/oauthclient).
Additionally on that page, ensure you register the correct callback URL, e.g., `https://mage.example.com/auth/oauth/callback`

On the MAGE Admin page, click the _Settings_ tab.

_Authorization URL_ - `https://accounts.google.com/o/oauth2/v2/auth`
_Token URL_ - `https://oauth2.googleapis.com/token`
_User Profile URL_ - `https://www.googleapis.com/oauth2/v3/userinfo`
_Scopes_ - `profile,email,openid`

Click the _Advanced_ section header to expand the advanced settings panel.
_Profile ID Property_ - `sub`
_Display Name Property_ - `name`

## LDAP

You can setup MAGE to authenticate users with an LDAP server. For development
testing, the [`auth-idp`](../docker/auth-idp/docker-compose.yml) Compose file
uses the [osixia/openldap](https://github.com/osixia/docker-openldap) and
[osixia/phpLDAPAdmin](https://github.com/osixia/docker-phpLDAPAdmin) images
for LDAP services. Start the `mage-idp-ldap` and `mage-idp-ldap-ui` LDAP
services with the following commands.
```bash
cd docker/auth-idp
docker compose up -d mage-idp-ldap mage-idp-ldap-ui
```
You can interact with the LDAP admin UI by browsing to https://localhost:6443.
You'll need to by-pass your browser's warning about a self-signed certificate.
Click the _Login_ link on the left pane. The root user name and password for
the LDAP server are `cn=admin,dc=wgd,dc=com` and `i found something`,
respectively.

You can then use the phpLDAPAdmin UI to setup a simple group structure.
1. Click the _dc=wgd,dc=com_ root node in the tree view on the left of the page.
1. In the main pane, click _Create a child entry_.
1. Select the _Generic: Posix Group_ template.
1. Enter a name for the group in the _Group_ field, e.g., `Field Agents`.
1. Click the _Create Object_ button, then click the _Commit_ button on the next page.
1. Click the root node again in the tree view.
1. Click _Create a child entry_ in the main pane.
1. Select the _Generic: Organizational Unit_ template.
1. Enter a name in the _Organizational Unit_ field, e.g., `Field Agents`.
1. Click the _Create Object_ button, then click the _Commit_ button on the next page.
1. The main pane should now display the organization unit you just created.
1. Click _Create a child entry_ in the main pane.
1. Select the _Generic: User Account_ template.
1. Fill the form fields, e.g.,

| | |
| ---: | --- |
| _First Name_ | `Bruce`|
| _Last Name_ | `Wayne` |
| _Common Name_ | `Batman` |
| _User ID_ | `batman` |
| _Password_ | `i heart alfred` |
| _GID Number_ | `Field Agents` |

1. Click the _Create Object_ button, then click the _Commit_ button on the next page.
You now have a simple group structure and user account in your LDAP database.

Now that you have an LDAP database with a user account, you can configure LDAP
authentication in MAGE. This assumes you're running a MAGE server on
http://localhost:4242.
1. Open the MAGE web app in your browser.
1. Click the gear icon in the top right to load the _Admin_ page.
1. Click the _Settings_ tab in the vertical tab strip on the left.
1. The _Authentication_ tab in the main pane should already be active. Click
the tab if not.
1. Click the _New Authentication_ button.
1. Enter a title for the authentication IDP, e.g. `Test LDAP`.
1. Click the _Next_ button.
1. Select `LDAP` from the _Choose a type_ drop-down.
1. Click the _Next_ button.
1. Fill the fields on the _Settings_ step as follows.
| | |
| ---: | ---|
| **_Server_** |
| _URL_ | `ldap://localhost:389` |
| **_Authentication_** |
| _Bind DN_ | `cn=admin,dc=wgd,dc=com` |
| _Bind Credentials_ | `i found something` |
| **_User Search_** |
| _Search Base_ | `ou=Field Agents,dc=wgd,dc=com` |
| _Search Filter_ | `(uid={{username}})` |
| _Search Scope_ | `one` |
| **_Advanced_** |
| _Profile ID Property_ | `uid |
| _Display Name Property_ | `cn` |
1. Click the _Next_ button.
1. Adjust the color settings to your preference.
1. Click the _Next_ button.
1. Review the settings and click the _Save_ button.
1. Open a new private browser tab or window and load your MAGE server web app.
1. The sign-in page should display a button labeled _SIGN IN WITH LOCAL LDAP_
under two text fields.
1. In the _Local LDAP Username_ text field, enter `batman`.
1. In the _Local LDAP Password_ text field, enter `i heart alfred`.
1. Click the _SIGN IN WITH LOCAL LDAP_ button.
1. The page will most likely display a dialog that states the account needs
admin approval.
1. In the browser tab with your MAGE admin page, click the _Users_ tab in the
tab strip on the left.
1. Click the _Inactive_ search facet near the top left of the main pane. The
user list should contain the _Batman_ user with a green _Activate_ button.
1. Click the _Activate_ button next to the _Batman_ user.
1. Return to the private browser tab where you initially signed in with the
LDAP account.
1. Ensure the LDAP username and password fields are still filled, then click
the _SIGN IN WITH LOCAL LDAP_ button.
1. The app may prompt for a device UID if your settings dictate. Enter the
device UID.
1. You are now authenticated with your LDAP account.
2 changes: 1 addition & 1 deletion instance/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngageoint/mage.dev-instance",
"version": "6.2.10-beta.3",
"version": "6.2.10",
"description": "Assemble a MAGE Server deployment from the core service, the web-app, and selected plugins. This is primarily a development tool because the dependencies point to relative directories instead of production packages. This can however serve as a starting point to create a production MAGE instance package.json.",
"scripts": {
"start": "npm run start:dev-env",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@ngageoint/mage.project",
"description": "This is the root package definition for the mage-server monorepo.",
"private": true,
"version": "6.2.10-beta.3",
"version": "6.2.10",
"files": [],
"scripts": {
"postinstall": "npm-run-all service:ci web-app:ci image.service:ci nga-msi:ci",
Expand Down
Loading

0 comments on commit 09c0b79

Please sign in to comment.