Contains REST APIs for managing Question Bank entities.
- Java 21
nbs-mssql
docker containers. See CDC SandboxDATABASE_PASSWORD
,TOKEN_SECRET
environment variables are set or relevant properties set in anapplication-local.yml
Prior to running tests the cdc-sandbox/nbs-mssql/
image must be built. To build this image run the following command
in
the cdc-sandbox
directory.
docker compose build nbs-mssql
To run all tests:
./gradlew question-bank:test
The Question-Bank can be started from the root directory by runninng:
./gradlew :question-bank:bootRun
It assumes that MSSQL Server is running on localhost
. Preconfigured containers are available in
the CDC Sandbox,cdc-sandbox/db
.
The application will listen on port 8095
.
The bootRun
task is configured to allow remote debugging on port 18095
allowing any Java Debugger to attach without
having to restart the application. The debug port can be changed at runtime by setting the debug.port
property.
For example, the debug port can be set to 8181
by executing.
./gradlew -Pdebug.port=8181 :question-bank:bootRun
There are two modes of authentication; one to support the existing NBS 6 authentication and OpenID Connect (OIDC) authentication. NBS 6 authentication is enabled by default.
Uses the JSESSIONID created by the NBS 6 instance to validate if the user has been authenticated by searching for an
entry in the Security_Log
table. If a valid entry exists a token is generated.
Enabled when nbs.security.oidc.enabled
is false
or not present.
The question-bank
service can be configured to act as an OIDC Resource Server by setting nbs.security.oidc.enabled
to true
and providing the nbs.security.oidc.uri
. The JWT passed in the Authentication
header must have a perferred_username
value that matches an active user in
the NBS Auth_User
table.
Name | Default | Description |
---|---|---|
nbs.security.oidc.enabled | Enables OIDC based authentication. | |
nbs.security.oidc.protocol | http |
The protocol used to communicate with the OIDC compatible Identity Provider |
nbs.security.oidc.host | The hostname of the OIDC compatible Identity Provider | |
nbs.security.oidc.base | /realms/nbs-users |
The path to the OIDC endpoints |
nbs.security.oidc.uri | ${nbs.security.oidc.protocol}://${nbs.security.oidc.host}${nbs.security.oidc.base} |
The URI for the OIDC issuer |