<commit_before>mongoose = require 'mongoose'
Schema   = mongoose.Schema
ObjectId = Schema.ObjectId

sshKeySchema = new Schema
  box: ObjectId
  name: {type: String, unique: true}
  key: {type: String, unique: true}

sshKeySchema.statics.extract_name = (key) ->
  return false if (!key? or key.length < 1)
  (key.trim().match /(?:ssh-rsa|ssh-dss)\s+[^\s]+\s*(.*)$/m)[1]

module.exports = mongoose.model 'SSHKey', sshKeySchema<commit_msg>make sshkey name/keys non unique - need compound key<commit_after>mongoose = require 'mongoose'
Schema   = mongoose.Schema
ObjectId = Schema.ObjectId

sshKeySchema = new Schema
  box: ObjectId
  name: {type: String}
  key: {type: String}

sshKeySchema.statics.extract_name = (key) ->
  return false if (!key? or key.length < 1)
  (key.trim().match /(?:ssh-rsa|ssh-dss)\s+[^\s]+\s*(.*)$/m)[1]

module.exports = mongoose.model 'SSHKey', sshKeySchema
{'fraction_non_alphanumeric': 0.16534541336353342, 'fraction_numerical': 0.004530011325028313, 'mean_word_length': 4.490683229813665, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1329634', 'n_tokens_mistral': 333, 'n_tokens_neox': 327, 'n_words': 76}