Add default user properties

This commit is contained in:
Ritchie Martori 2013-07-01 17:01:26 -07:00
parent 643877b677
commit c14ef9af8c
1 changed files with 32 additions and 1 deletions

View File

@ -4,10 +4,41 @@
var Model = require('../asteroid').Model;
/**
* Default User properties.
*/
var properties = {
id: {type: String, required: true},
realm: {type: String},
username: {type: String, required: true},
// password: {type: String, transient: true}, // Transient property
hash: {type: String}, // Hash code calculated from sha256(realm, username, password, salt, macKey)
salt: {type: String},
macKey: {type: String}, // HMAC to calculate the hash code
email: String,
emailVerified: Boolean,
credentials: [
'UserCredential' // User credentials, private or public, such as private/public keys, Kerberos tickets, oAuth tokens, facebook, google, github ids
],
challenges: [
'Challenge' // Security questions/answers
],
// https://en.wikipedia.org/wiki/Multi-factor_authentication
/*
factors: [
'AuthenticationFactor'
],
*/
status: String,
created: Date,
lastUpdated: Date
}
/**
* Extends from the built in `asteroid.Model` type.
*/
var User = module.exports = Model.extend('user');
var User = module.exports = Model.extend('user', properties);