MB-16181: Make server deny creation of reserved collections 74/78074/8
authorJim Walker <jim@couchbase.com>
Fri, 12 May 2017 09:12:20 +0000 (10:12 +0100)
committerDave Rigby <daver@couchbase.com>
Wed, 17 May 2017 10:10:54 +0000 (10:10 +0000)
commit1cc862a65dd4c055f95da489fbc45012b0011add
treef197c7f1644665e16ca4b6a7574e61e44a058b36
parent8b04e6cb81d21d2015cbb3a475b4ff57e5dc7d64
MB-16181: Make server deny creation of reserved collections

The design has always stated that _ and $ would be reserved for
system use. Make sure the server enforces this by checking the
names on incoming manifests.

1. Any _ prefixed collection will cause the Manifest construction to
 throw invalid_argument.

2. Any $ prefixed collection which is not $default will cause the
 Manifest construction to throw invalid_argument.

Change-Id: I1e5daf2ae87cba2a8dbcdda4c9bb0be66e40ffae
Reviewed-on: http://review.couchbase.org/78074
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
src/collections/manifest.cc
src/collections/manifest.h
tests/module_tests/collections/manifest_test.cc