Skip to content
This repository was archived by the owner on Apr 27, 2021. It is now read-only.

Unable to set CloudEntity KindNames prefixed by [public] or [private] as per documentation #11

Open
jcollomosse opened this issue Apr 23, 2014 · 1 comment

Comments

@jcollomosse
Copy link

When constructing a CloudEntity on the Android client side, the Kind Name is passed as a String to the constructor e.g..

new CloudEntity("myKindName")

However looking at the source it is clear the kindnames are restricted to those parsable via Regex "\w" i.e. alphanumerics and the underscore.

public CloudEntity(String kindName) {
if (kindName == null || !kindName.matches("\w+")) {
throw new IllegalArgumentException("Illegal kind name: " + kindName);
}
this.kindName = kindName;
}

This presents a problem because the documentation states that the KindName can be prefixed by Strings such as "[public]" or "[private]" as a means of access control - see:

https://cloud.google.com/developers/articles/mobile-backend-starter-api-reference#acfce

And indeed the code for the Backend does show such prefixes being used for access control.

So, it appears that it is impossible to create a Cloud Entity to make use of this facility. This must be a bug specifically over-constrained validation check in the CloudEntity constructor. FYi I did ask a stackoverflow question about this.

http://stackoverflow.com/questions/23228241/access-scope-using-kind-name-on-google-cloud-android-mobile-backend-starter

@jhender
Copy link

jhender commented Jul 11, 2014

I tested out doing without the \w+ regex validation and hit another error where the new generated kindname of "user:asfh23483..." is also invalid probably due to the semi colon. Sign. Is there a fix for this issue? This should be a basic requirement and yet so many error.s

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants