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
|
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 = {
|
var InstallationSchema = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,7 +4,6 @@ var RoleSchema = {
|
||||||
name: {type: String, required: true},
|
name: {type: String, required: true},
|
||||||
roles: [String], // A role can be an aggregate of other roles
|
roles: [String], // A role can be an aggregate of other roles
|
||||||
users: [String], // A role contains a list of users
|
users: [String], // A role contains a list of users
|
||||||
acls: [],
|
|
||||||
|
|
||||||
created: Date,
|
created: Date,
|
||||||
lastUpdated: 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
|
// User model
|
||||||
var UserSchema = {
|
var UserSchema = {
|
||||||
id: {type: String, required: true},
|
id: {type: String, required: true},
|
||||||
realm: {type: String},
|
realm: {type: String},
|
||||||
username: {type: String, required: true},
|
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)
|
hash: {type: String}, // Hash code calculated from sha256(realm, username, password, salt, macKey)
|
||||||
salt: {type: String},
|
salt: {type: String},
|
||||||
macKey: {type: String}, // HMAC to calculate the hash code
|
macKey: {type: String}, // HMAC to calculate the hash code
|
||||||
|
@ -15,6 +28,12 @@ var UserSchema = {
|
||||||
challenges: [
|
challenges: [
|
||||||
'Challenge' // Security questions/answers
|
'Challenge' // Security questions/answers
|
||||||
],
|
],
|
||||||
|
// https://en.wikipedia.org/wiki/Multi-factor_authentication
|
||||||
|
/*
|
||||||
|
factors: [
|
||||||
|
'AuthenticationFactor'
|
||||||
|
],
|
||||||
|
*/
|
||||||
status: String,
|
status: String,
|
||||||
created: Date,
|
created: Date,
|
||||||
lastUpdated: Date
|
lastUpdated: Date
|
||||||
|
|
Loading…
Reference in New Issue