This file is responsible for serving the manifest.xml.
It contains the function that handles the GET request for the discovery API.
Home
APIs/controllers/discoveryController.js
APIs/controllers/echoController.js
This file is responsible for handling the requests of the echo api. It contains the functions:
- echo_get : The handler of the GET request in the echo API.
- echo_post : The handler of the POST request in the echo API.
- Source:
APIs/controllers/institutionsController.js
This file is responsible for handling the requests of the institutions api. It contains the functions:
- institutions_get : The handler of the GET request in the institutions API.
- institutions_post : The handler of the POST request in the institutions API.
APIs/routes.js
In this file the proper functions are registered to the methods of each API.
- Source:
app.js
connector/auth.js
In this file is written the core functionality for authenticating the incoming requests. It contains the function:
- authenticate : The main function that used to authenticate the incoming requests.
- Source:
connector/db.js
In this file are written the queries to the database. It contains the functions:
- cert_hash_exist : Given a certificate hash, returns the number of records maching the certificate hash.
- rsa_hash_exist : Given a RSA hash, returns the number of records maching the RSA hash.
- get_rsa_key_from_hash : Given a RSA hash, returns the macthed RSA keys or empty Array.
- get_heis_from_rsa_hash : Given a RSA hash, returns an Array with the HEI-IDs or empty Array.
- get_heis_from_cert_hash : Given a certificate hash, returns an Array with the HEI-IDs or empty Array.
- insert_request_id : Inserts the request_id in the database.
- request_id_exist : Checks if the request id exists in the database.
- Source:
connector/helpers/auth_helper.js
This file is a helper for the auth.js file. It contains the functions:
- sha_256_digest : This function is used to create the SHA-256 of the request body in base64 encoding.
- get_keyid_from_header : This function is used to extract the keyID from the http-signature header.
- Source:
connector/helpers/respond_helper.js
This file is a helper for the respond.js and the method_not_allowed.js files. It contains the functions:
- create_x_request_sign_header : This function is used to create the x-request-signature header.
- create_digest_header : This function is used to create the digest header.
connector/method_not_allowed.js
In this file is written the handler for the incoming requests that use inappropriate method. It contains the function:
- method_not_allowed : The use of this function is used to create the response to the methods that are not allowed.
- Source:
connector/respond.js
This file is responsible for constucting the response of the server. It contains the function:
- respond : The use of this function is used to create the response for the incoming requests.
- Source:
updater/downloader.js
This file is responsible for fetching and maintaining a catalogue copy from the registry, localy. It contains the functions:
- create_backup : Creates a backup of the catalogue.xml.
- catalogue_exists : Checks if the catalogue.xml exists.
- get_from_backup : If the catalogue.xml does not exist get data from catalogue
- get_catalogue : Fetches the catalogue from the regisrty.
- Source:
updater/logger.js
This file is responsible for creating a logger object, that is used to keep log files. It contains the functions:
- create_logger : Creates the logger object.
- Source:
updater/updater.js
This file is responsible for keeping the database up-to-date, based on the last fetched catalogue from the registry. It contains the functions:
- clear_db : Clears the database collections.
- createDB : Used to update the database.
- init_db : This function is used to invoke the update process every INTERVAL seconds.
- Source: