openhim-core
Version:
The OpenHIM core application that provides logging and routing of http requests
50 lines (38 loc) • 1.38 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CertificateModel = exports.KeystoreModel = exports.CertificateModelAPI = exports.KeystoreModelAPI = void 0;
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 = _config.connectionAPI.model('Keystore', KeystoreSchema);
exports.KeystoreModelAPI = KeystoreModelAPI;
const CertificateModelAPI = _config.connectionAPI.model('Certificate', CertificateSchema);
exports.CertificateModelAPI = CertificateModelAPI;
const KeystoreModel = _config.connectionDefault.model('Keystore', KeystoreSchema);
exports.KeystoreModel = KeystoreModel;
const CertificateModel = _config.connectionDefault.model('Certificate', CertificateSchema);
exports.CertificateModel = CertificateModel;
//# sourceMappingURL=keystore.js.map