-
Notifications
You must be signed in to change notification settings - Fork 130
Closed
Description
Using the "human-readable" version foo of the prefixed ID s~foo (or e~foo) is allowed in a URI but not in a request payload (and will never be returned in a response since foo gets mapped to s~foo in the response).
This inconsistency can catch user's off-guard and requires custom behavior in to_protobuf()-type methods which essentially always ignore the dataset_id on a PartitionId message and only use the dataset ID in the URI.
Some examples
- Sending a query to
https://www.googleapis.com/datastore/v1beta2/datasets/foo/runQuery
which has RunQueryRequest.partition_id.dataset_id == 'foo' in the payload results in
app s~foo cannot access app foo's data
- Sending a mutation (or a lookup) to one of
https://www.googleapis.com/datastore/v1beta2/datasets/foo/allocateIds
https://www.googleapis.com/datastore/v1beta2/datasets/foo/commit
https://www.googleapis.com/datastore/v1beta2/datasets/foo/lookup
which has Key.partition_id.dataset_id == 'foo' (either directly in a key
or in an Entity) in the payload results in
app s~foo cannot access app foo's data
- Sending a filtered or ancestor query which does not have
RunQueryRequest.partition_id.dataset_idset in the payload but does have
the dataset ID set in either the ancestor key
The query app is 'foo' but ancestor.key app is 'foo'.
or in the __key__ filter
__key__ filter app is foo but query app is s~foo
Metadata
Metadata
Assignees
Labels
No labels