-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
special characters in channel names cause error #656
Comments
My work around is to base 64 encode the user data for the channel name. |
We need to document this once fixed. |
As part of this, we need to canonicalize the set of valid chars for document ids and channel names, since the former are often consumed in the later. The charset also needs to be URL safe, as the REST GET/PUT/DELETE for a specific document includes the doc id as part of the URL. |
Is it possible to URL encode special characters for document ids?
|
It was also pointed out by a forum user that email addresses can't safely be used as channel names because they allow a lot of characters that aren't allowed in channels. At a minimum, if we added This limited character set is my fault, but honestly I can't remember why i was so restrictive about it. The only problem I can think of with an arbitrary character set would be losing the ability to concatenate channel names in a plain string, since there wouldn't be any delimiter you could put between them; but I don't think we ever do that since a JSON array is such an obvious way to express that. |
My work around was to base64 encode the channel names, although difficult
|
IMHO the allowed channel names should be all UTF-8 strings, otherwise sync functions fill with BS. |
Or is it UTF-16? Whatever it is we should strive for unsurprising. |
I am running into this again. I really do think the allowed set of channel names should be all unicode strings. The PR looks trivial. |
For the immediate term, we can make the only character not allowed in channel names be |
Questions:
|
There's another ticket that proposes using the Does this change expose us to any type of injection attack when the channel name gets used as part of a view query (e.g. when it's included as part of the startkey in a channel backfill request)? |
View query keys are any string, so that should be fine. I think reserving the ! and * names is fine, but they are valid today. I think |
Basically, channel names should be subject to the same restrictions as view keys, (none) but for the short term we have to keep the comma restriction in there until we deprecate the current clients query format |
I guess I should clarify. So I guess my concern isn't whether these should be allowed, but the underlying implication of creating channels based on user data. App developers who don't want users to be able to make documents public will need to ensure they aren't allowing docs to be assigned to channel |
I think we decided that we wouldn't want to do channel namespaces using special character prefixes, because we want to allow user data as channel names. I got bit by this again trying to use Stack Overflow api data tags as channel names, but some questions are tagged |
What are the currently allowed characters in channel names? (pre #1293, since it hasn't been merged) Specifically are |
Based on my test, '-' is allowed but not ':'. |
Agree with @pasin . However the docs for 1.2 don't show this http://developer.couchbase.com/documentation/mobile/1.2/develop/guides/sync-gateway/channels/index.html |
this is a bug when you are trying to generate channel names from user data.
The text was updated successfully, but these errors were encountered: