User namespaces
By default, all user data in Carbon Engine is stored together. For most installations, this is appropriate.
However, in some installations there may be multiple brands all using the same Carbon Engine cluster. These brands may have user IDs that conflict, such that user ID "123" for brand A is a different user to user ID "123" for brand B.
In this case, it's necessary to use Carbon Engine's user namespacing feature.
A user namespace may be specified by including a X-User-Namespace HTTP header with the API request.
X-User-Namespace: acme
If the X-User-Namespace header is not specified, the default user namespace will be used.
When a user namespace is specified, all requests which get and set user data are constrained to the namespace. For example, loading transactions for user ID "123" in the default namespace, and then querying transactions for user ID "123" in the "acme" namespace will return no results.
User namespace names may consist of alphanumeric characters, as well as the dash, underscore, and period. They may be up to 32 characters in length. They are case sensitive.
The default user namespace may be disabled by setting the COGO_REQUIRE_USER_NAMESPACE environment variable to
true. This will cause a 400 error if a user-related endpoint is called without a valid X-User-Namespace
header set. By default, this setting is set to false, which allows use of the default user namespace and/or custom user namespaces.