Add more info to the models
This commit is contained in:
parent
a228ade1b1
commit
72020f8b62
|
@ -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
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// Device registration
|
||||
// See Device registration
|
||||
var InstallationSchema = {
|
||||
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue