[GitHub] couchdb-fauxton pull request: QueryButtons component now passed cl...

2016-03-22 Thread benkeen
Github user benkeen commented on the pull request:

https://github.com/apache/couchdb-fauxton/pull/664#issuecomment-200130949
  
Merged as aa52e40d432ecaeeaf04e31ed2597efd6d51078c


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fauxton pull request: QueryButtons component now passed cl...

2016-03-22 Thread benkeen
Github user benkeen closed the pull request at:

https://github.com/apache/couchdb-fauxton/pull/664


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fauxton pull request: Update Views

2016-03-22 Thread benkeen
Github user benkeen closed the pull request at:

https://github.com/apache/couchdb-fauxton/pull/651


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fauxton pull request: Update Views

2016-03-22 Thread benkeen
Github user benkeen commented on the pull request:

https://github.com/apache/couchdb-fauxton/pull/651#issuecomment-200130632
  
Merged as 3ff6ff622bf22bc019a585b8285e03af94ec0650


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric pull request: Support raw view collation

2016-03-22 Thread kocolosk
Github user kocolosk commented on the pull request:

https://github.com/apache/couchdb-fabric/pull/43#issuecomment-200117536
  
LGTM, nice work.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-epi pull request: Don't rely on timer:sleep after up...

2016-03-22 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb-couch-epi/pull/18

Don't rely on timer:sleep after update in tests

To fix currently broken build we do not use timer:sleep/1 after update/2.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-couch-epi 
wait-for-update-in-tests

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-couch-epi/pull/18.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #18






---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request: Refactor rename on delete

2016-03-22 Thread iilyak
Github user iilyak commented on the pull request:

https://github.com/apache/couchdb-couch/pull/141#issuecomment-200048303
  
Don't get me wrong I like this work a lot. Let's just add tests and be done 
with it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request: Refactor rename on delete

2016-03-22 Thread iilyak
Github user iilyak commented on the pull request:

https://github.com/apache/couchdb-couch/pull/141#issuecomment-200047680
  
> @eiri 
https://github.com/cloudant/couchdb-couch/pull/11#issuecomment-199885171
To be honest I don't find your version much clearer on what it is doing or 
more idiomatic than mine foldl. It might be jiffy faster, but we are talking 
about traversing 5-6 elements list...

The point was not about performance but to improve readability by 
eliminating magic numbers.

> I guess we can refactor that tokenizer into its own function, though it's 
not like it's going to be used outside of deleted_filename. So what exactly is 
the gain of a hair splitting here?

Extracting black magic into a function so it is easier to find and fix 
later.  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request: Refactor rename on delete

2016-03-22 Thread iilyak
Github user iilyak commented on the pull request:

https://github.com/apache/couchdb-couch/pull/141#issuecomment-200032564
  
@eiri: I tried to understand what the tokenizer do and it was quite hard. I 
had a doubt that it does work as intended in case of none clustered database. 
Therefore I added the tests and discover that it indeed doesn't pass. It might 
be possible that my test cases are wrong though. I'm ok with existent 
implementation as long as you would add tests make them pass and factor out the 
tokenizer into a function. I do agree with you that it is quite hard to make it 
easier to understand because it is special case upon another special case. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric pull request: Support raw view collation

2016-03-22 Thread kocolosk
Github user kocolosk commented on a diff in the pull request:

https://github.com/apache/couchdb-fabric/pull/43#discussion_r57057309
  
--- Diff: src/fabric_view_map.erl ---
@@ -149,15 +161,15 @@ handle_message(complete, Worker, State) ->
 Counters = fabric_dict:update_counter(Worker, 1, 
State#collector.counters),
 fabric_view:maybe_send_row(State#collector{counters = Counters}).
 
-merge_row(fwd, undefined, Row, Rows) ->
+merge_row(fwd, undefined, Row, Rows, SortFun) ->
 lists:merge(fun(#view_row{key=KeyA, id=IdA}, #view_row{key=KeyB, 
id=IdB}) ->
-couch_ejson_compare:less_json_ids({KeyA, IdA}, {KeyB, IdB})
+SortFun({KeyA, IdA}, {KeyB, IdB})
 end, [Row], Rows);
-merge_row(rev, undefined, Row, Rows) ->
+merge_row(rev, undefined, Row, Rows, SortFun) ->
 lists:merge(fun(#view_row{key=KeyA, id=IdA}, #view_row{key=KeyB, 
id=IdB}) ->
-couch_ejson_compare:less_json_ids({KeyB, IdB}, {KeyA, IdA})
+SortFun({KeyB, IdB}, {KeyA, IdA})
 end, [Row], Rows);
-merge_row(_, KeyDict, Row, Rows) ->
+merge_row(_, KeyDict, Row, Rows, _) ->
--- End diff --

No I think this is right, albeit woefully documented. The purpose of 
`KeyDict` is to capture the original order of the keys posted by the user and 
ensure that we respond in the same order. The values in the KeyDict are integer 
positions computed from the user request per `fabric_view:keydict/1`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fauxton pull request: Webpack

2016-03-22 Thread benkeen
Github user benkeen commented on the pull request:

https://github.com/apache/couchdb-fauxton/pull/641#issuecomment-10523
  
This is great, Garren. Let's merge this sucker. +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation pull request: Heartbeat applies to eventsour...

2016-03-22 Thread michaelwheeler
GitHub user michaelwheeler opened a pull request:

https://github.com/apache/couchdb-documentation/pull/44

Heartbeat applies to eventsource feed as well.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/michaelwheeler/couchdb-documentation patch-1

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-documentation/pull/44.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #44


commit 43da1229daef5c583950d0530aec3f7774660049
Author: Michael Wheeler 
Date:   2016-03-22T19:16:47Z

Heartbeat applies to eventsource feed as well.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-chttpd pull request: Fix CORS max_age configuration parame...

2016-03-22 Thread eiri
GitHub user eiri opened a pull request:

https://github.com/apache/couchdb-chttpd/pull/110

Fix CORS max_age configuration parameter

Header `"Access-Control-Max-Age"` used by a browser to define for how long 
to keep preflight request's response cached.

This fix makes this parameter configurable through config section `[cors]`, 
attribute `max_age`.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-chttpd fix-cors-max_age

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-chttpd/pull/110.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #110






---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric pull request: Support raw view collation

2016-03-22 Thread mikewallace1979
Github user mikewallace1979 commented on the pull request:

https://github.com/apache/couchdb-fabric/pull/43#issuecomment-199950499
  
This LGTM but (given I screwed something up last time I touched collation) 
it'd be handy if someone like @davisp or @kocolosk could take a look.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request: Refactor rename on delete

2016-03-22 Thread iilyak
Github user iilyak commented on the pull request:

https://github.com/apache/couchdb-couch/pull/141#issuecomment-199915574
  
@eiri: There are no tests for none clustered dbs.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-chttpd pull request: 2973 log user

2016-03-22 Thread kxepal
Github user kxepal commented on the pull request:

https://github.com/apache/couchdb-chttpd/pull/109#issuecomment-199914422
  
+1 url encoding then. That's better than json as you can simply copy-paste 
the name to url and get the doc, it's still readable for ASCII names and quite 
easy to convert into UTF-8 string if need.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-chttpd pull request: 2973 log user

2016-03-22 Thread rnewson
Github user rnewson commented on the pull request:

https://github.com/apache/couchdb-chttpd/pull/109#issuecomment-199843431
  
we could apply url encoding before logging it. That way administrators can 
decode to the real value but we don't have to worry about any unicode trickery.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-chttpd pull request: 2973 log user

2016-03-22 Thread kxepal
Github user kxepal commented on the pull request:

https://github.com/apache/couchdb-chttpd/pull/109#issuecomment-199840399
  
@iilyak I would prefer json or url encoded way. Both are fine to notice 
tricky bits, but each is useful for further copy-paste into some script to work 
with it and both provides more-or-less readable close to real variants of 
username. Plain ASCII ones will remain plain ASCII ones.

However, that could be not very friendly for the end users (admins/devops) 
to work with such kind of data. Need to think about and call for more opinions 
around. For instance, what tools ElasticSearch could provide to work with such 
kind of encoded usernames?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-chttpd pull request: 2973 log user

2016-03-22 Thread iilyak
Github user iilyak commented on the pull request:

https://github.com/apache/couchdb-chttpd/pull/109#issuecomment-199838409
  
@kxepal: Should we log `hex(base64(name))` instead then? Even ASCII could 
have `\a` or `\r` which could brake the log lines. It such a pity that we 
historically do not validate user names.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb pull request: Introduce couch_tests application to share s...

2016-03-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/couchdb/pull/396


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb pull request: Introduce couch_tests application to share s...

2016-03-22 Thread kxepal
Github user kxepal commented on the pull request:

https://github.com/apache/couchdb/pull/396#issuecomment-199798812
  
+1 if green (hope it green). Good work!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb pull request: Introduce couch_tests application to share s...

2016-03-22 Thread eiri
Github user eiri commented on the pull request:

https://github.com/apache/couchdb/pull/396#issuecomment-199798325
  
+1

Just let travis to finish before merging, so we'll be sure it's happy too.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (COUCHDB-2971) Provide cardinality estimate (COUNT DISTINCT) as builtin reducer

2016-03-22 Thread Adam Kocoloski (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-2971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15206287#comment-15206287
 ] 

Adam Kocoloski commented on COUCHDB-2971:
-

Ah, I hadn't even noticed the NIF option. Looks like it was added after the 
initial release by a third party, which probably explains why it's 
undocumented. Perhaps worth reaching out to the maintainer to see if they 
recommend it.

I haven't kept pace with all of the long-running NIF issues as Erlang releases 
have evolved, but I'd hope that an infrequent invocation of the cardinality 
estimation function running for < 5 ms wouldn't be an issue.

> Provide cardinality estimate (COUNT DISTINCT) as builtin reducer
> 
>
> Key: COUCHDB-2971
> URL: https://issues.apache.org/jira/browse/COUCHDB-2971
> Project: CouchDB
>  Issue Type: Improvement
>Reporter: Adam Kocoloski
>
> We’ve seen a number of applications now where a user needs to count the 
> number of unique keys in a view. Currently the recommended approach is to add 
> a trivial reduce function and then count the number of rows in a _list 
> function or client-side application code, but of course that doesn’t scale 
> nicely.
> It seems that in a majority of these cases all that’s required is an 
> approximation of the number of distinct entries, which brings us into the 
> space of hash sets, linear probabilistic counters, and the ever-popular 
> “HyperLogLog” algorithm. Taking HLL specifically, this seems like quite a 
> nice candidate for a builtin reduce. The size of the data structure is 
> independent of the number of input elements and individual HLL filters can be 
> unioned together. There’s already what seems to be a good MIT-licensed 
> implementation on GitHub:
> https://github.com/GameAnalytics/hyper
> One caveat is that this reducer would not work for group_level reductions; 
> it’d only give the correct result for the exact key. I don’t think that 
> should preclude us from evaluating it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] couchdb-chttpd pull request: 2973 log user

2016-03-22 Thread kxepal
Github user kxepal commented on the pull request:

https://github.com/apache/couchdb-chttpd/pull/109#issuecomment-199795675
  
>>Oh yes, user names "null" and "undefined" will cause a lot of fun.

> Would you recommend changing "undefined" -> "null"?

No, I mean that user with name "null" will looks in logs as the anonymous 
user - so you'll never trace him. Same story with "undefined". I don't think 
there is any solution except to quote the name or do something to distinguish 
authed user from anonymous ones.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb pull request: Introduce couch_tests application to share s...

2016-03-22 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb/pull/396

Introduce couch_tests application to share setups

Add new application to share setup/teardown code. 
Currently only supports necessary bits to fix failing test cases.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb introduce-couch_tests_app

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb/pull/396.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #396


commit b1090d69d91470793211e9364a84835b0b320b7f
Author: ILYA Khlopotov 
Date:   2016-03-22T12:28:54Z

Introduce couch_tests application to share setups

commit f2ffe13256556e8816413fe43e8b4195dfad2706
Author: ILYA Khlopotov 
Date:   2016-03-22T12:39:02Z

Use couch_tests apps for EPI callback_tests




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request: Use couch_tests applications for couch...

2016-03-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/couchdb-couch/pull/154


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request: Refactor rename on delete

2016-03-22 Thread eiri
Github user eiri commented on the pull request:

https://github.com/apache/couchdb-couch/pull/141#issuecomment-199787026
  
@iilyak I've addressed all the comments, but rebase killed all the github 
discussions that was happening on the commits and not on the main PR diff, 
really sorry about that.

Is there anything else you don't like in the proposed changes?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-chttpd pull request: 2973 log user

2016-03-22 Thread iilyak
Github user iilyak commented on the pull request:

https://github.com/apache/couchdb-chttpd/pull/109#issuecomment-199785895
  
> @kxepal: Oh yes, user names "null" and "undefined" will cause a lot of 
fun.

Would you recommend changing `"undefined"` -> `"null"`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (COUCHDB-2974) Validate userid per RFC7613 in order to support utf-8 in username

2016-03-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-2974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15206255#comment-15206255
 ] 

ASF GitHub Bot commented on COUCHDB-2974:
-

Github user iilyak commented on the pull request:

https://github.com/apache/couchdb-chttpd/pull/109#issuecomment-199785630
  
@kxepal: I did create a jira ticket 
[COUCHDB-2974](https://issues.apache.org/jira/browse/COUCHDB-2974) to track 
utf-8 support.


> Validate userid per RFC7613 in order to support utf-8 in username
> -
>
> Key: COUCHDB-2974
> URL: https://issues.apache.org/jira/browse/COUCHDB-2974
> Project: CouchDB
>  Issue Type: New Feature
>Reporter: ILYA
>
> Currently utf-8 in userid is not supported. Since it doesn't seem possible to 
> transmit utf-8 in a http header. We use basic auth which is based on headers. 
> There is a new [RFC7617|https://datatracker.ietf.org/doc/rfc7617/] is going 
> to support utf-8. In order to avoid security issues with utf-8 we should 
> either forbid utf-8 in userid or validate it to prohibit certain inputs. 
> There is a proposed [RFC7613|https://datatracker.ietf.org/doc/rfc7613/] which 
> defines what can be in a userid and what shouldn't be there. 
> We need to be aware though that some clients decided to support utf-8 in a 
> non standard way.
> * 
> [httpie|https://github.com/jkbrzt/httpie/blob/25d1e8e418425a208eca285cbe435a5914da542c/httpie/plugins/builtin.py#L29]
>  - enforce utf-8 encoding
> * [curl|https://github.com/jkbrzt/httpie/issues/212#issuecomment-41280312] - 
> relies on the implementation detail of base64 cli tool on *nix's
> * Opera uses UTF-8;
> * IE uses the system's default codepage (which you have no way of knowing, 
> other than it's never UTF-8), and silently mangles characters that don't fit 
> into to it using the Windows ‘guess a random character that looks a bit like 
> the one you wanted or maybe just not’ secret recipe;
>  * Mozilla uses only the lower byte of character codepoints, which has the 
> effect of encoding to ISO-8859-1 and mangling the non-8859-1 characters 
> irretrievably... except when doing XMLHttpRequests, in which case it uses 
> UTF-8;
>  * Safari and Chrome encode to ISO-8859-1, and fail to send the authorization 
> header at all when a non-8859-1 character is used.
> The info about browsers is from http://stackoverflow.com/a/703341



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] couchdb-chttpd pull request: 2973 log user

2016-03-22 Thread iilyak
Github user iilyak commented on the pull request:

https://github.com/apache/couchdb-chttpd/pull/109#issuecomment-199785630
  
@kxepal: I did create a jira ticket 
[COUCHDB-2974](https://issues.apache.org/jira/browse/COUCHDB-2974) to track 
utf-8 support.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Created] (COUCHDB-2974) Validate userid per RFC7613 in order to support utf-8 in username

2016-03-22 Thread ILYA (JIRA)
ILYA created COUCHDB-2974:
-

 Summary: Validate userid per RFC7613 in order to support utf-8 in 
username
 Key: COUCHDB-2974
 URL: https://issues.apache.org/jira/browse/COUCHDB-2974
 Project: CouchDB
  Issue Type: New Feature
Reporter: ILYA


Currently utf-8 in userid is not supported. Since it doesn't seem possible to 
transmit utf-8 in a http header. We use basic auth which is based on headers. 
There is a new [RFC7617|https://datatracker.ietf.org/doc/rfc7617/] is going to 
support utf-8. In order to avoid security issues with utf-8 we should either 
forbid utf-8 in userid or validate it to prohibit certain inputs. There is a 
proposed [RFC7613|https://datatracker.ietf.org/doc/rfc7613/] which defines what 
can be in a userid and what shouldn't be there. 
We need to be aware though that some clients decided to support utf-8 in a non 
standard way.

* 
[httpie|https://github.com/jkbrzt/httpie/blob/25d1e8e418425a208eca285cbe435a5914da542c/httpie/plugins/builtin.py#L29]
 - enforce utf-8 encoding
* [curl|https://github.com/jkbrzt/httpie/issues/212#issuecomment-41280312] - 
relies on the implementation detail of base64 cli tool on *nix's
* Opera uses UTF-8;
* IE uses the system's default codepage (which you have no way of knowing, 
other than it's never UTF-8), and silently mangles characters that don't fit 
into to it using the Windows ‘guess a random character that looks a bit like 
the one you wanted or maybe just not’ secret recipe;
 * Mozilla uses only the lower byte of character codepoints, which has the 
effect of encoding to ISO-8859-1 and mangling the non-8859-1 characters 
irretrievably... except when doing XMLHttpRequests, in which case it uses UTF-8;
 * Safari and Chrome encode to ISO-8859-1, and fail to send the authorization 
header at all when a non-8859-1 character is used.

The info about browsers is from http://stackoverflow.com/a/703341



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] couchdb-chttpd pull request: 2973 log user

2016-03-22 Thread iilyak
Github user iilyak commented on the pull request:

https://github.com/apache/couchdb-chttpd/pull/109#issuecomment-199779143
  
@kxepal Supporting utf-8 is a very valid concern. Do we actually support 
it? It doesn't seem possible to transmit utf-8 in a http header. We use basic 
auth which is based on headers. There is a new 
[RFC7617](https://datatracker.ietf.org/doc/rfc7617/) which is going to support 
utf-8. But currently it is not supported. Therefore I do believe that we 
shouldn't have any utf-8 users in the wild. As utf-8 support is slowly coming 
maybe we should consider userid validation on couch side to sanitize user's 
input before it became a problem. The proposed 
[RFC7613](https://datatracker.ietf.org/doc/rfc7613/?include_text=1) defines 
what can be in a userid and what shouldn't be there. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fauxton pull request: Webpack

2016-03-22 Thread garrensmith
Github user garrensmith commented on a diff in the pull request:

https://github.com/apache/couchdb-fauxton/pull/641#discussion_r56971234
  
--- Diff: .gitignore ---
@@ -36,3 +36,5 @@ test/nightwatch_tests/selenium/*
 *.react.js
 selenium-debug.log
 npm-debug.log
+test/bundle.js
+test/templates.js
--- End diff --

This is a tricky one. If we move them to dist then we cannot have the dev 
server running and run the tests at the same time. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[4/4] couchdb-erlang-tests git commit: Merge remote branch 'github/pr/1'

2016-03-22 Thread iilyak
Merge remote branch 'github/pr/1'

This closes #1

Signed-off-by: ILYA Khlopotov 


Project: http://git-wip-us.apache.org/repos/asf/couchdb-erlang-tests/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/couchdb-erlang-tests/commit/cba29c89
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-erlang-tests/tree/cba29c89
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-erlang-tests/diff/cba29c89

Branch: refs/heads/master
Commit: cba29c894aace569f13e6bf83bc6ef06fd448712
Parents: 2f937ca e561ac6
Author: ILYA Khlopotov 
Authored: Tue Mar 22 04:12:42 2016 -0700
Committer: ILYA Khlopotov 
Committed: Tue Mar 22 04:12:42 2016 -0700

--
 include/couch_tests.hrl|  28 +
 rebar.config   |  20 
 setups/couch_epi_dispatch.erl  |  95 +++
 src/couch_tests.app.src|  18 +++
 src/couch_tests.erl| 228 
 test/couch_tests_app_tests.erl | 102 
 6 files changed, 491 insertions(+)
--




[jira] [Commented] (COUCHDB-2971) Provide cardinality estimate (COUNT DISTINCT) as builtin reducer

2016-03-22 Thread Nick Vatamaniuc (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-2971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15205902#comment-15205902
 ] 

Nick Vatamaniuc commented on COUCHDB-2971:
--

Ah, good point on having a nicer way to specify precision. Yeah otherwise it 
looks kind of hackish. 

Noticed they provide various backends for the registers. One is a C NIF. Tried 
to compile and run their code on Erlang 18 and had to fiddle with it a bit, but 
got it to work and got these results:

https://gist.github.com/nickva/bf19a2b7b537f5051a99

There are some tradeoffs between memory usage, cardinality and union times. 
While C array is interesting, having the cheapest union operation (under 1ms), 
has cardinality estimation time greater than a few milliseconds which might not 
play well with the Erlang schedulers. But if it happens only during the 
finalize stage it could be handled in another way (some thread + queue 
mechanism). Unfortunately it also has a large/constant memory usage for low 
cardinalities.

> Provide cardinality estimate (COUNT DISTINCT) as builtin reducer
> 
>
> Key: COUCHDB-2971
> URL: https://issues.apache.org/jira/browse/COUCHDB-2971
> Project: CouchDB
>  Issue Type: Improvement
>Reporter: Adam Kocoloski
>
> We’ve seen a number of applications now where a user needs to count the 
> number of unique keys in a view. Currently the recommended approach is to add 
> a trivial reduce function and then count the number of rows in a _list 
> function or client-side application code, but of course that doesn’t scale 
> nicely.
> It seems that in a majority of these cases all that’s required is an 
> approximation of the number of distinct entries, which brings us into the 
> space of hash sets, linear probabilistic counters, and the ever-popular 
> “HyperLogLog” algorithm. Taking HLL specifically, this seems like quite a 
> nice candidate for a builtin reduce. The size of the data structure is 
> independent of the number of input elements and individual HLL filters can be 
> unioned together. There’s already what seems to be a good MIT-licensed 
> implementation on GitHub:
> https://github.com/GameAnalytics/hyper
> One caveat is that this reducer would not work for group_level reductions; 
> it’d only give the correct result for the exact key. I don’t think that 
> should preclude us from evaluating it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)