Add more info to the models

This commit is contained in:
Raymond Feng 2013-07-01 15:53:10 -07:00
parent a228ade1b1
commit 72020f8b62
4 changed files with 33 additions and 4 deletions

View File

@ -29,4 +29,15 @@ URL/Route level permissions
Map to oAuth 2.0 scopes
*/
*/
var ACLSchema = {
model: String, // The model name
properties: [String], // A list of property names
methods: [String], // A list of methods
roles: [String], // A list of roles
permission: {type: String, enum: ['Allow', 'Deny']}, // Allow/Deny
status: String, // Enabled/disabled
created: Date,
lastUpdated: Date
}

View File

@ -1,4 +1,4 @@
// Device registration
// See Device registration
var InstallationSchema = {
};

View File

@ -4,7 +4,6 @@ var RoleSchema = {
name: {type: String, required: true},
roles: [String], // A role can be an aggregate of other roles
users: [String], // A role contains a list of users
acls: [],
created: Date,
lastUpdated: Date

View File

@ -1,9 +1,22 @@
var ChallengeSchema = {
// id: String,
question: String,
answer: String
};
var Credential = {
// id: String,
provider: String,
protocol: String,
attributes: Object
}
// User model
var UserSchema = {
id: {type: String, required: true},
realm: {type: String},
username: {type: String, required: true},
password: {type: String, transient: true}, // Transient property
// 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
@ -15,6 +28,12 @@ var UserSchema = {
challenges: [
'Challenge' // Security questions/answers
],
// https://en.wikipedia.org/wiki/Multi-factor_authentication
/*
factors: [
'AuthenticationFactor'
],
*/
status: String,
created: Date,
lastUpdated: Date