Skip to content

Commit

Permalink
Datastore namespace fix
Browse files Browse the repository at this point in the history
datastore: fix namespace isolation
  • Loading branch information
idoshamun authored and stephenplusplus committed Apr 7, 2016
1 parent 34d0e3d commit fc111c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Anand Suresh <anandsuresh@gmail.com>
Brett Bergmann <me@brettbergmann.com>
Burcu Dogan <jbd@google.com>
Hector Rovira <hrovira@gmail.com>
Ido Shamun <idoesh1@gmail.com>
Johan Euphrosine <proppy@google.com>
Marco Ziccardi <marco.ziccard@gmail.com>
Patrick Costello <pcostell@google.com>
Expand Down
2 changes: 1 addition & 1 deletion lib/datastore/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ function keyFromKeyProto(keyProto) {
};

if (keyProto.partitionId && keyProto.partitionId.namespaceId) {
keyOptions.namespaceId = keyProto.partitionId.namespaceId;
keyOptions.namespace = keyProto.partitionId.namespaceId;
}

keyProto.path.forEach(function(path, index) {
Expand Down
4 changes: 2 additions & 2 deletions test/datastore/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ describe('entity', function() {

it('should set the namespace', function(done) {
entity.Key = function(keyOptions) {
assert.strictEqual(keyOptions.namespaceId, NAMESPACE);
assert.strictEqual(keyOptions.namespace, NAMESPACE);
done();
};

Expand All @@ -581,7 +581,7 @@ describe('entity', function() {
it('should create a proper Key', function(done) {
entity.Key = function(keyOptions) {
assert.deepEqual(keyOptions, {
namespaceId: NAMESPACE,
namespace: NAMESPACE,
path: [
'Kind',
111,
Expand Down

0 comments on commit fc111c1

Please sign in to comment.