Open mdeuser opened 7 years ago
I would change the REGEX, that should be enough. https://github.com/apache/incubator-openwhisk/blob/d86c415a1d9a4eaa2061eac3a6ce99f24ba390f9/common/scala/src/main/scala/whisk/core/entity/EntityPath.scala#L193
The controller does not create subjects. And if one attempts to do so via wskadmin
, it will be rejected for the reasons noted above.
Is that regex used when
_
as the namespace (i.e. controller uses the auth key to look up the namespace)_
as the first characterOther related changes:
All _
namespaces are resolved early in the controller and will be rejected if the namespace is therefore not conforming. And using an explicit leading underscore in a name should not match routes in the controller either. TDD FTW.
As a quick note: wskadmin
will happily create the namespace, the Controller will only fail on usage of that created namespace.
It should not:
> wskadmin user create _guest
Failed to create subject ({"error":"illegal_docid","reason":"Only reserved document ids may start with underscore."})
because the subject is the primary index and hence fails the invariant couch/cloudant assert.
You probably mean creating a namespace vs a subject? In which case, yes. We should shut that down.
When creating an action (or any other entity) in a namespace having a name that has a
_
as the leading character, the controller encounters the following error when saving the entity document in cloudantAs shown, the cloudant document id is based off of the entity's fully qualified name - which starts with the namespace name; in this example, the namespace is
_xyz
. According to https://console.bluemix.net/docs/services/Cloudant/api/document.html#documents cloudant document_id
values may not have a leading_
character, resulting in the cloudant request failure.Possible solutions:
_
characters_
character in the_id
field