2017-02-08 20:52:37 -05:00
|
|
|
'use strict'
|
2016-10-17 19:22:28 -04:00
|
|
|
|
2017-05-13 15:29:00 -04:00
|
|
|
const Mongoose = require('mongoose')
|
|
|
|
|
2016-10-17 19:22:28 -04:00
|
|
|
/**
|
|
|
|
* BruteForce schema
|
|
|
|
*
|
|
|
|
* @type {<Mongoose.Schema>}
|
|
|
|
*/
|
2016-11-20 20:09:50 -05:00
|
|
|
var bruteForceSchema = Mongoose.Schema({
|
2017-02-08 20:52:37 -05:00
|
|
|
_id: { type: String, index: 1 },
|
|
|
|
data: {
|
|
|
|
count: Number,
|
|
|
|
lastRequest: Date,
|
|
|
|
firstRequest: Date
|
|
|
|
},
|
|
|
|
expires: { type: Date, index: { expires: '1d' } }
|
|
|
|
})
|
2016-10-17 19:22:28 -04:00
|
|
|
|
2017-02-08 20:52:37 -05:00
|
|
|
module.exports = Mongoose.model('Bruteforce', bruteForceSchema)
|