<div dir="ltr">It seems as though we should be cleansing all the keys.... since we never know what queries we might want to make in the future.  </div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 24, 2016 at 12:04 PM Katherine Cox-Buday <<a href="mailto:katherine.cox-buday@canonical.com">katherine.cox-buday@canonical.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
As I have only just discovered the need to cleanse mongo data, I can't say for sure, but it looks like we may have been cleansing things in the parts of Juju that need it. William may know more.<br>
<br>
If not, I imagine a small upgrade step would make short work of any problems.<br>
<br>
roger peppe <<a href="mailto:roger.peppe@canonical.com" target="_blank">roger.peppe@canonical.com</a>> writes:<br>
<br>
> This is useful, thanks.<br>
><br>
> Note that's it's not necessary to cleanse *all* keys that go into Mongo,<br>
> just the ones that might be used in queries.<br>
><br>
> But one thought... what about keys that already contain full-width<br>
> dollar and dot?<br>
><br>
>   cheers,<br>
>     rog.<br>
><br>
> On 23 June 2016 at 21:09, Katherine Cox-Buday<br>
> <<a href="mailto:katherine.cox-buday@canonical.com" target="_blank">katherine.cox-buday@canonical.com</a>> wrote:<br>
>> Hey all,<br>
>><br>
>> William gave me a good review and it came up that I wasn't cleansing<br>
>> some of<br>
>> the data being placed in Mongo. I wasn't aware this had to be done,<br>
>> and<br>
>> after talking to a few other folks it became apparent that maybe not<br>
>> many<br>
>> people know we should be doing this.<br>
>><br>
>> At any rate, William also pointed me to some existing code which did<br>
>> this.<br>
>> I've pulled it out into the mongo/utils package for general<br>
>> consumption. The<br>
>> comments do a pretty good job of elucidating why this is necessary.<br>
>><br>
>> <a href="https://github.com/juju/juju/blob/master/mongo/utils/data_cleansing.go" rel="noreferrer" target="_blank">https://github.com/juju/juju/blob/master/mongo/utils/data_cleansing.go</a><br>
>><br>
>> -<br>
>> Katherine<br>
>><br>
>> --<br>
>> Juju-dev mailing list<br>
>> <a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a><br>
>> Modify settings or unsubscribe at:<br>
>> <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
>><br>
<br>
--<br>
Katherine<br>
<br>
--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
</blockquote></div>