This is the server code for the citizenship appointment service.
The client code can be found in this repository: AusDTO/citizenship-appointment-client
- Java 8
A number of environment variables must be set to run the application
SERVICE_ADDRESS_APPOINTMENT_TYPE
: HTTP(S) endpoint for thesvcAppointmentType
SOAP serviceSERVICE_ADDRESS_CALENDAR
: HTTP(S) endpoint for thesvcCalendar
SOAP serviceSERVICE_ADDRESS_CUSTOMER
: HTTP(S) endpoint for thesvcCustomer
SOAP serviceSERVICE_ADDRESS_PROCESS
: HTTP(S) endpoint for thesvcProcess
SOAP serviceSERVICE_ADDRESS_SERVICE
: HTTP(S) endpoint for thesvcService
SOAP serviceSERVICE_ADDRESS_UNIT
: HTTP(S) endpoint for thesvcUnit
SOAP serviceSERVICE_ADDRESS_USER
: HTTP(S) endpoint for thesvcAppUser
SOAP service
At least one set of API user credentials must be supplied. x
is a sequential number starting from 1
.
USER_USERNAME_x
: Username of API userx
USER_PASSWORD_x
: Password of API userx
USER_ID_x
: ID of API userx
These environment variables are used for the Apple Wallet implementation:
WALLET_PASS_TYPE_IDENTIFIER
: Use the same value supplied when setting up your Pass Type ID. It should start withpass.
, e.g.pass.com.apple.devpubs.example
WALLET_TEAM_IDENTIFIER
: Your iOS developer account team identifier, e.g.,A93A5CM278
WALLET_PRIVATE_KEY_P12_BASE64
: The Base64 encoded contents of a PKCS #12 file containing your Pass Type ID private key and certificate. See below for instructions on how to obtain this.WALLET_PRIVATE_KEY_PASSPHRASE
: The passphrase required to access the contents of the PKCS #12 file containing your Pass Type ID private key and certificate.WALLET_PUSH_NOTIFICATIONS_ENABLED
: Optional. Set tofalse
to prevent the application from connecting to the APNs service. This can be useful for suppressing connecting failure exceptions when running unit tests with dummy values. If this value is missing or has any value other thanfalse
(case insensitive), the application will attempt to connect to APNs on startup.
To obtain the value for WALLET_PRIVATE_KEY_P12_BASE64, export your Pass Type ID certificate and corresponding private key as a .p12
file.
The password you supply when you export should be set as the WALLET_PRIVATE_KEY_PASSPHRASE
environment variable.
Run this command to extract the value to set as the WALLET_PRIVATE_KEY_P12_BASE64
environment variable, where export.p12
is the name of the .p12
file you exported:
base64 -i export.p12 -o -
On Mac OS you can optionally pipe the output of this command to pbcopy
to add the result to your clipboard.
If you need dummy values for unit testing purposes, you may use the values from the test class au.gov.dto.dibp.appointments.wallet.PassBuilderTest
.
SESSION_JWT_ENCRYPTION_KEY_BASE64
: 256-bit Base64 encoded encryption and signature key for storing the user's security context in a cookieSECURITY_ADMIN_PASSWORD
: Password for the read-only monitoring endpointsANALYTICS_TRACKING_ID
: Analytics tracking ID, optionalPUBLIC_KEY_FINGERPRINT_BASE64_1
andPUBLIC_KEY_FINGERPRINT_BASE64_2
: Base64 encoded SHA-256 fingerprints of the Subject Public Key Information (SPKI) in the public key certificate and the backup certificate signature request for the public host, used for HTTP Public Key Pinning (HPKP), optional, but both must be present to activate HPKPHPKP_REPORT_URI_ENFORCED
: URI for web browsers to send reports on HPKP violations for enforced policies, optionalHPKP_REPORT_URI_REPORT_ONLY
: URI for web browsers to send reports on HPKP violations for report-only policies, optionalCSP_REPORT_URI
: URI for web browsers to send reports on Content Security Policy (CSP) violations, optional
Get fingerprint of public key certificate as a Base64 encoded SHA-265 digest of the DER formatted Subject Public Key Info (SPKI):
openssl x509 -pubkey -inform PEM -in certificate.pem -outform DER | openssl dgst -sha256 -binary | base64
To simply run the application:
./go startApp
You can optionally supply the port number to use as an environment variable:
PORT=8080 ./go run
The port defaults to 8083. Use PORT=0
to select a random port.
To run or debug the application from your IDE, use the Application
class as the entry point.
To run the full build:
./go fullBuild
To run unit tests:
./go test
To run integration tests:
./go integrationTest
To run all tests:
./go allTests
Check dependencies against known publicly disclosed security vulnerabilities published by NIST in NVD Data Feeds:
./go dependencyCheck --info
To view other build tasks:
./go tasks