Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
84d86f4
Minimal portal implementation
guimard Dec 5, 2025
6ac174b
Add LDAP authentication, user database, and password modules
guimard Dec 7, 2025
f6aea00
ci: trigger workflow on push only, not on PR
guimard Dec 7, 2025
c4b49da
Add DBI (SQL) authentication, user database, and password modules
guimard Dec 7, 2025
4a28c56
Add SSL and Kerberos authentication modules
guimard Dec 7, 2025
4654ba7
Add OIDC provider and client modules
guimard Dec 7, 2025
1cca8b0
ci: separate lint job from build-and-test
guimard Dec 7, 2025
6a6bf86
Add SAML IdP and SP modules
guimard Dec 7, 2025
093898c
Fix CI test failures
guimard Dec 7, 2025
4954fad
Fix CI
guimard Dec 7, 2025
a3daf37
Add CAS IdP and SP modules
guimard Dec 7, 2025
a71e9bf
Proxy tests
guimard Dec 8, 2025
33111fb
start:dbi => use DB for everything
guimard Dec 8, 2025
f4bc699
lint
guimard Dec 8, 2025
be6fff9
Add interoperability tests between JS and Perl
guimard Dec 8, 2025
fc5b920
Render lasso.js dependency optional
guimard Dec 8, 2025
0120379
Fix CI
guimard Dec 8, 2025
d8ad7d8
Fix CI
guimard Dec 8, 2025
959117c
Implement SAML SOAP logout
guimard Dec 8, 2025
6b0dcb6
prettier
guimard Dec 8, 2025
74c2600
Fix CI
guimard Dec 8, 2025
6c57b01
Fix CI
guimard Dec 8, 2025
079a1a8
Parallelize tests
guimard Dec 8, 2025
d347b3e
Fix test (logouts)
guimard Dec 8, 2025
01860e7
Security: address CodeQL remarks
guimard Dec 8, 2025
eddb299
Fix CodeQL: prevent prototype pollution in handler grant()
guimard Dec 8, 2025
3c2f0dd
Add global rate-limiting (optioonal)
guimard Dec 8, 2025
fe370c1
Rate limiting and URL redirect validation
guimard Dec 8, 2025
4a81725
Fix CodeQL alert: validate dynamic method call in handler
guimard Dec 8, 2025
dd18ae8
2FA TOTP
guimard Dec 8, 2025
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
163 changes: 160 additions & 3 deletions .github/workflows/buildandtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,187 @@ permissions:

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Use Node.js 22.x
uses: actions/setup-node@v3
with:
node-version: 22.x

- name: Install ldap-utils, PostgreSQL client and liblasso
run: sudo apt-get update && sudo apt-get install -y liblasso3-dev libxml2-dev libxmlsec1-dev libglib2.0-dev

- name: Install dependencies
run: npm ci || npm i

- name: Lint
run: npm run lint

- name: Format check
run: npm run format:check

build-and-test:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [22.x, 20.x]

services:
ldap:
image: osixia/openldap:1.5.0
ports:
- 3890:389
env:
LDAP_ORGANISATION: "Example Inc"
LDAP_DOMAIN: "example.com"
LDAP_ADMIN_PASSWORD: "admin"
LDAP_CONFIG_PASSWORD: "config"
LDAP_READONLY_USER: "false"
options: >-
--health-cmd "ldapsearch -x -H ldap://localhost -b dc=example,dc=com -D cn=admin,dc=example,dc=com -w admin"
--health-interval 10s
--health-timeout 5s
--health-retries 10

postgres:
image: postgres:16
ports:
- 5432:5432
env:
POSTGRES_USER: llng
POSTGRES_PASSWORD: llng
POSTGRES_DB: llng_test
options: >-
--health-cmd "pg_isready -U llng"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- run: npm --version

- name: Install ldap-utils, PostgreSQL client and liblasso
run: sudo apt-get update && sudo apt-get install -y ldap-utils postgresql-client liblasso3-dev libxml2-dev libxmlsec1-dev libglib2.0-dev

- name: Wait for LDAP to be ready
run: |
for i in {1..30}; do
if ldapsearch -x -H ldap://localhost:3890 -b dc=example,dc=com -D cn=admin,dc=example,dc=com -w admin > /dev/null 2>&1; then
echo "LDAP is ready"
break
fi
echo "Waiting for LDAP... ($i/30)"
sleep 2
done

- name: Setup LDAP test data
run: |
ldapadd -x -H ldap://localhost:3890 -D "cn=admin,dc=example,dc=com" -w admin -f test/ldap-test-data.ldif || true

- name: Setup PostgreSQL test data
run: |
PGPASSWORD=llng psql -h localhost -U llng -d llng_test -f test/postgres-test-data.sql || true

- name: Install dependencies
run: npm ci || npm i

- name: Build
run: npm run build

- name: Test
run: npm run test
env:
LDAP_TEST_URL: ldap://localhost:3890
LDAP_TEST_BASE: dc=example,dc=com
LDAP_TEST_ADMIN_DN: cn=admin,dc=example,dc=com
LDAP_TEST_ADMIN_PASSWORD: admin
POSTGRES_TEST_HOST: localhost
POSTGRES_TEST_PORT: 5432
POSTGRES_TEST_USER: llng
POSTGRES_TEST_PASSWORD: llng
POSTGRES_TEST_DATABASE: llng_test

interop-tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Use Node.js 22.x
uses: actions/setup-node@v3
with:
node-version: 22.x

- name: Install liblasso
run: sudo apt-get update && sudo apt-get install -y liblasso3-dev libxml2-dev libxmlsec1-dev libglib2.0-dev

- name: Install dependencies
run: npm ci || npm i

- name: Build
run: npm run build

- name: Start Perl OP container
run: docker compose -f test/interop/docker-compose.perl-op.yml up -d

- name: Wait for Perl OP to be ready
run: |
for i in {1..30}; do
if curl -s http://localhost:19080/.well-known/openid-configuration > /dev/null 2>&1; then
echo "Perl OP is ready"
break
fi
echo "Waiting for Perl OP... ($i/30)"
sleep 2
done

- name: Test JS RP with Perl OP
run: npx jest test/interop/oidc-perl-op.test.ts --testTimeout=30000

- name: Show Perl OP logs on failure
if: failure()
run: docker logs llng-perl-op 2>&1 | tail -100

- name: Stop Perl OP container
if: always()
run: docker compose -f test/interop/docker-compose.perl-op.yml down

- name: Start Perl RP container
run: docker compose -f test/interop/docker-compose.perl-rp.yml up -d

- name: Wait for Perl RP to be ready
run: |
for i in {1..30}; do
if curl -s http://localhost:19081/ > /dev/null 2>&1; then
echo "Perl RP is ready"
break
fi
echo "Waiting for Perl RP... ($i/30)"
sleep 2
done

- name: Test JS OP with Perl RP
run: npx jest test/interop/oidc-perl-rp.test.ts --testTimeout=30000

- name: Show Perl RP logs on failure
if: failure()
run: docker logs llng-perl-rp 2>&1 | tail -100

- name: Stop Perl RP container
if: always()
run: docker compose -f test/interop/docker-compose.perl-rp.yml down

audit:
runs-on: ubuntu-22.04
Expand Down
35 changes: 35 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Docker Compose for LemonLDAP::NG development with PostgreSQL
#
# Usage:
# docker-compose up -d # Start PostgreSQL
# npm run start:dbi -w @lemonldap-ng/portal # Start portal with PostgreSQL backend
# docker-compose down -v # Stop and remove data
#
# The yadd/lemonldap-ng-pg-database image creates:
# - Database: lemonldapng
# - User: lemonldap / Password: lemonldap
# - Tables: lmconfig, sessions, psessions, samlsessions, oidcsessions, cassessions
#
# The users table for DBI authentication is created by start-dbi.js on first run.

services:
postgres:
image: yadd/lemonldap-ng-pg-database:latest
container_name: llng-postgres
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: postgres
PG_DATABASE: lemonldapng
PG_USER: lemonldap
PG_PASSWORD: lemonldap
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5

volumes:
pgdata:
23 changes: 0 additions & 23 deletions jest.config.js

This file was deleted.

Loading