summaryrefslogtreecommitdiff
path: root/src/couch
Commit message (Collapse)AuthorAgeFilesLines
* feat(couchjs): add support for SpiderMonkey 86Jan Lehnardt2021-03-175-4/+821
|
* Show process status in active_tasksRobert Newson2021-02-091-1/+10
| | | | | This allows users to verify that compaction processes are suspended outside of any configured strict_window.
* Fix PUT of multipart/related attachments support for Transfer-Encoding: ↵Bessenyei Balázs Donát2021-02-031-1/+2
| | | | | | | chunked (#3360) Transfer-Encoding: chunked causes the server to wait indefinitely, then issue a a 500 error when the client finally hangs up, when PUTing a multipart/related document + attachments. This commit fixes that issue by adding proper handling for chunked multipart/related requests.
* Allow gzipped requests to _session (#3323)Bessenyei Balázs Donát2021-01-122-2/+3
| | | | | All endpoints but _session support gzip encoding and there's no practical reason for that. This commit enables gzip decoding on compressed requests to _session.
* Use `req_body` field if presentILYA Khlopotov2020-11-161-2/+5
| | | | | | | When we call `couch_httpd:json_body/1` we can have `req_body` already set. In this case we should return the field as is without any attempt to decompress or decode it. This PR brings the approach we use in `chttpd` into `couch_httpd`.
* Add test for splitting filter batchesPaul J. Davis2020-11-061-0/+55
|
* Retry filter_docs sequentially if the patch exceeds couchjs stackRobert Newson2020-11-061-1/+13
| | | | | | | | | | | | | | A document with lots of conflicts can blow up couchjs if the user calls _changes with a javascript filter and with `style=all_docs` as this option causes up to fetch all the conflicts. All leaf revisions of the document are then passed in a single call to ddoc_prompt, which can fail if there's a lot of them. In that event, we simply try them sequentially and assemble the response from each call. Should be backported to 3.x
* Remove JS tests + support for harness (#3197)Joan Touzet2020-10-0718-2730/+4
|
* Optimizations for reading reduce viewsPaul J. Davis2020-09-301-1/+6
| | | | | These are a few micro optimizations to avoid unnecessary work when reading from a single reduce function during a view read.
* Merge branch master into prototype/fdb-layerPaul J. Davis2020-09-1625-595/+2296
|\
| * fix race condition (#3150)Tony Sun2020-09-141-0/+9
| | | | | | | | | | | | | | This fixes a94e693f32672e4613bce0d80d0b9660f85275ea because a race condition exisited where the 'DOWN' message could be received before the compactor pid is spawned. Adding a synchronous call to get the compactor pid guarantees that the couch_db_updater process handling of finish_compaction has occurred.
| * fixup: Build couch_js for redhat linuxjiangph2020-08-201-2/+2
| | | | | | | | | | | | When building couch_js in RHEL, there is one error occurring with "undefined reference to symbol '_ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3'". This commit is to adjust binding library to address this issue.
| * Validate shard specific query params on db create requestEric Avdey2020-08-131-0/+12
| |
| * Report if FIPS mode is enabledreport-fips-featureRobert Newson2020-06-051-0/+10
| | | | | | | | | | This will only report "fips" in the welcome message if FIPS mode was enabled at boot (i.e, in vm.args).
| * feat(auth): Allow a custom JWT claim for rolesmauroporras2020-06-041-1/+1
| |
| * 2906 couchjs sm version (#2911)Simon Klassen2020-05-304-4/+4
| | | | | | | | | | | | | | | | | | | | Closes #2906 * Added a suffix to the first line of couchjs with the (static) version number compiled * Update rebar.config.script * In couchjs -h replaced the link to jira with a link to github Co-authored-by: simon.klassen <simon.klassen> Co-authored-by: Jan Lehnardt <jan@apache.org
| * allow configurability of JWT claims that require a valueRobert Newson2020-05-182-5/+16
| | | | | | | | | | | | | | e.g; [jwt] required_claims = {iss, "https://example.com/issuer"}
| * Drop os_mon from dependenciesJoan Touzet2020-04-282-2/+0
| |
| * Suppress offsetof gcc warnings for SM60Joan Touzet2020-04-281-1/+1
| | | | | | | | | | | | Mozilla did this years ago: https://hg.mozilla.org/mozilla-central/rev/41d9d32ab5a7
| * Fix new JS test caseJoan Touzet2020-04-271-2/+3
| |
| * Replace broken u-escape sequencesPaul J. Davis2020-04-271-2/+104
| |
| * Incorporate changes from #2786Joan Touzet2020-04-278-597/+238
| |
| * First pass at SpiderMonkey 68 supportJoan Touzet2020-04-279-29/+2092
| |
| * Fix couchjs utf8 conversions (#2786)Paul J. Davis2020-04-187-569/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove unused string conversion functions * Set UTF-8 encoding when compiling scripts * Encode JavaScript strings as UTF-8 for printing * Check that only strings are passed to print * Use builtin UTF-8 conversions in http.cpp * Add tests for couchjs UTF-8 support * Remove custom UTF-8 conversion functions We're now using 100% built-in functionality of SpiderMonkey to handle all UTF-8 conversions. * Report error messages at global scope Previously we weren't reporting any uncaught exceptions or compilation errors. This changes that to print any compilation errors or any uncaught exceptions with stack traces. The previous implementation of `couch_error` was attempting to call `String.replace` on the `stack` member string of the thrown exception. This likely never worked and attempting to fix I was unable to properly invoke the `String.replace` function. This changes the implementation to use the builtin stack formatting method instead. * Modernize sources to minimize changes for 68 These are a handful of changes that modernize various aspects of the couchjs 60 source files. Behaviorally they're all benign but will shorten the diff required for adding support for SpiderMonkey 68. Co-authored-by: Joan Touzet <wohali@apache.org>
| * Do not copy the #server.lru field to async openersPaul J. Davis2020-03-311-1/+4
| | | | | | | | | | | | This copy slowed down the `erlang:spawn_link/3` call considerably. Measurements in the wild showed the cost of that `spawn_link/3` going from roughly 8 uS to 800 uS.
| * Enhance valid claims checks to detect binaries, etcRobert Newson2020-03-301-1/+7
| |
| * Remove enhanced alg checkRobert Newson2020-03-301-5/+1
| | | | | | | | | | This mechanism is replaced by the much stronger tying of verification algorithm to the key directly in the server config.
| * Ensure shards are created with db optionsRussell Branca2020-03-251-0/+5
| |
| * Rename the claim used for roles to be more CouchDB specific.Alexander Trauzzi2020-03-241-1/+1
| |
| * Add support for roles to be obtained from JWTs. (#2694)Alexander Trauzzi2020-03-241-1/+2
| | | | | | Add support for roles to be obtained from JWTs
| * throw Reason directly so we send good http error responsesRobert Newson2020-03-221-1/+1
| |
| * Create in-memory cache of JWT keysRobert Newson2020-03-221-14/+1
| | | | | | | | | | Decoding RSA and EC keys is a little expensive and we don't want to do it for every single request. Add a cache that is invalidated on config change.
| * support RSA for JWT authRobert Newson2020-03-221-4/+17
| |
| * no need to deduplicate this listRobert Newson2020-03-221-1/+1
| |
| * Feature - Add JWT support (#2648)Alexander Trauzzi2020-03-191-0/+26
| | | | | | | | | | | | Add JWT Authentication Handler Co-authored-by: Robert Newson <rnewson@apache.org> Co-authored-by: Joan Touzet <wohali@users.noreply.github.com>
| * Set cookie domain when DELETE'ingcookie-domain-deleteRobert Newson2020-03-122-2/+14
| | | | | | | | Closes #2655
* | Read attachment data outside the transactionNick Vatamaniuc2020-09-151-2/+18
| | | | | | | | | | | | | | | | | | | | Previously the data was read from the parser in the transaction. If the transaction had to retry, for example, because of a conflict, the parser would have been drained and exited resulting the request failing with a 500 "mp_parser noproc" error. Since FDB cannot handle transactions larger than 10MB opt to read the attachment data into memory first, before the transaction starts.
* | fixup: Build couch_js for redhat linuxjiangph2020-08-061-1/+1
| | | | | | | | | | | | When building couch_js in RHEL, there is one error occurring with "undefined reference to symbol '_ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3'". This commit is to adjust binding library to address this issue.
* | Add format_status/2 callback in gen_server implementationsILYA Khlopotov2020-07-308-11/+91
| |
* | Add native encryption supportRobert Newson2020-04-271-103/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new application, aegis, is introduced to provide strong at-rest protection of CouchDB data (where possible). Currently we encrypt the following values (if enabled): 1. Document content 2. Attachment content 3. Index values Things not encrypted: 1. _all_docs 2. _changes 3. doc id 4. doc rev 5. Index keys 6. All other metadata Co-Authored-By: Eric Avdey <eiri@apache.org> Co-Authored-By: Robert Samuel Newson <rnewson@apache.org>
* | Report the chttpd_auth authentication db in session infoJay Doane2020-04-251-1/+2
| | | | | | | | | | | | | | Currently, GET `/_session` reports the `authentication_db` of the obsolete admin port 5986. This updates it to report the actual db used for authentication, provided it is configured. Otherwise, it omits `authentication_db` entirely from session info.
* | Merge keys from rebar.configILYA Khlopotov2020-04-142-1/+8
| | | | | | | | | | | | | | | | | | This change allows creation of local `src/couch/rebar.config` and `rebar.config` files to set additional configuration options. This is useful for: - disabling deprecation warnings `{nowarn_deprecated_function, MFAs}` - control debugging in eunit tests - `DEBUG` - `{eunit_compile_opts, [{d, DEBUG, true}]}` - `NODEBUG` - `{eunit_compile_opts, [{d, NODEBUG, true}]}`
* | Start running chttpd eunit testsNick Vatamaniuc2020-04-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable running all chttpd tests. Some fixes needed for this to happen are: * Some tests were not valid (checking shard maps, etc) and were deleted * Some tests were disabled either because functionality is not implemented yet or simply to minimize the diff between 3.x and this branch for when we have to rebase * Some applications used for index querying had to be started explicitly * Mock updated to use new version of modules instead of old ones
* | remove mango native procGarren Smith2020-04-061-1/+0
| |
* | Don't advertise unimplemented featuresJay Doane2020-03-281-6/+0
| | | | | | | | | | | | | | | | | | | | | | Removes the following features from the welcome message: - reshard - partitioned - pluggable-storage-engines - scheduler Although `scheduler` at least will presumably be returned once that feature is complete.
* | Implement AES KW algorithm*couch-keywrapRobert Newson2020-03-261-0/+103
| | | | | | | | | | | | For use by the native couchdb at-rest encryption feature. * From NIST Special Publication 800-38F.
* | Add 410 status code to stats_descriptionsNick Vatamaniuc2020-03-021-0/+4
| | | | | | | | | | We started to emit that in CouchDB 4.x for temporary views and possibly other endpoints.
* | Convert versionstamps to binariesPaul J. Davis2020-03-021-1/+1
| | | | | | | | | | Versionstamp sequences should always be binaries when retrieved from a rev info map.
* | Track the size of data stored in a databasePaul J. Davis2020-03-021-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This tracks the number of bytes that would be required to store the contents of a database as flat files on disk. Currently the following items are tracked: * Doc ids * Revisions * Doc body as JSON * Attachment names * Attachment type * Attachment length * Attachment md5s * Attachment headers * Local doc id * Local doc revision * Local doc bodies
* | Remove attachment headers fieldPaul J. Davis2020-03-021-17/+7
| | | | | | | | | | I accidentally ported part of the old couch_att test suite into an actual "feature" that's not actually accessible through any API.