You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 27, 2021. It is now read-only.
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:
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.
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 freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
The text was updated successfully, but these errors were encountered: