From 95b7858c8f83b7e1bdfd244dd5a34b094a5570dd Mon Sep 17 00:00:00 2001 From: Matthew Fettig Date: Fri, 30 May 2014 13:00:41 -0700 Subject: [PATCH] [CHORE] require specific entity types --- src/js/ripple/blob.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/js/ripple/blob.js b/src/js/ripple/blob.js index e0332a21..db9428fe 100644 --- a/src/js/ripple/blob.js +++ b/src/js/ripple/blob.js @@ -53,6 +53,12 @@ var identityFields = [ 'birthplace' ]; +var entityTypes = [ + 'individual', + 'organization', + 'corporation' +] + var addressFields = [ 'contact', 'line1', @@ -691,7 +697,13 @@ Identity.prototype.set = function (pointer, key, value, fn) { } } } - } + } + + //validate entity type + } else if (pointer === 'entityType') { + if (entityTypes.indexOf(value) === -1) { + return fn(new Error("invalid entity type")); + } } this.validate(function(err, res){