diff --git a/lib/models/acl.js b/lib/models/acl.js index 07a941c0..6b3f6d46 100644 --- a/lib/models/acl.js +++ b/lib/models/acl.js @@ -29,4 +29,15 @@ URL/Route level permissions Map to oAuth 2.0 scopes -*/ \ No newline at end of file +*/ + +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 +} \ No newline at end of file diff --git a/lib/models/installation.js b/lib/models/installation.js index 37e8bd0d..03d1b0ed 100644 --- a/lib/models/installation.js +++ b/lib/models/installation.js @@ -1,4 +1,4 @@ -// Device registration +// See Device registration var InstallationSchema = { }; diff --git a/lib/models/role.js b/lib/models/role.js index a04ad962..0bd17dae 100644 --- a/lib/models/role.js +++ b/lib/models/role.js @@ -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 diff --git a/lib/models/user.js b/lib/models/user.js index ec63821a..545e772c 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -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