UNPKG

openhim-core

Version:

The OpenHIM core application that provides logging and routing of http requests

42 lines (35 loc) 1.3 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.CertificateModel = exports.KeystoreModel = exports.CertificateModelAPI = exports.KeystoreModelAPI = undefined; var _mongoose = require('mongoose'); var _config = require('../config'); const certificate = { country: String, state: String, locality: String, organization: String, organizationUnit: String, commonName: String, emailAddress: String, validity: { start: Date, end: Date }, data: String, fingerprint: String }; const CertificateSchema = new _mongoose.Schema(certificate); const KeystoreSchema = new _mongoose.Schema({ key: String, passphrase: String, cert: certificate, ca: [certificate] }); // Model for storing the server key and cert as well as trusted certificates const KeystoreModelAPI = exports.KeystoreModelAPI = _config.connectionAPI.model('Keystore', KeystoreSchema); const CertificateModelAPI = exports.CertificateModelAPI = _config.connectionAPI.model('Certificate', CertificateSchema); const KeystoreModel = exports.KeystoreModel = _config.connectionDefault.model('Keystore', KeystoreSchema); const CertificateModel = exports.CertificateModel = _config.connectionDefault.model('Certificate', CertificateSchema); //# sourceMappingURL=keystore.js.map