Skip to content
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

[wip] feat: add mango-based VDU endpoints #1898

Open
wants to merge 232 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
232 commits
Select commit Hold shift + click to select a range
9a671b6
Initial commit
rnewson May 6, 2017
2c3f968
Initial commit
rnewson May 6, 2017
f2e1085
validate nbf
rnewson May 6, 2017
3888d18
Moar Functional
rnewson May 6, 2017
5f93661
unused var
rnewson May 6, 2017
02ecf5b
add more tests
rnewson May 7, 2017
5b9dad7
Add JKWS cache
rnewson May 8, 2017
d7bd8d1
Make typ and alg optional
rnewson May 8, 2017
8077258
use public url
rnewson May 8, 2017
3cb8b7d
98% coverage
rnewson May 8, 2017
e60fa50
kid belongs in the header
rnewson May 9, 2017
a18a2e5
some documentation
rnewson May 9, 2017
69e1ce2
Add stats, don't wipe cache on error
rnewson May 9, 2017
25bfdc3
make jwks simpler, caching can happen elsewhere
rnewson May 9, 2017
31999f4
allow iss to be optional
rnewson May 9, 2017
acbaa37
slightly improve readme
rnewson May 9, 2017
bf7a2ed
expand algorithm support
rnewson May 10, 2017
61f47b3
support P-256 in JWKS
rnewson May 10, 2017
373a367
update alg list
rnewson May 10, 2017
ae0e0f4
return a public key tuple
rnewson May 10, 2017
e0d61d0
test EC
rnewson May 10, 2017
e180555
fix test
rnewson May 10, 2017
e80c3d1
add tests for HS384 and HS512
rnewson May 11, 2017
6cc182d
IAT validation requires it to be a number, any number
rnewson May 11, 2017
e083b22
provide caching of JWKS keys
rnewson May 11, 2017
9d60fa2
add ibrowse as dep
rnewson May 12, 2017
ceeb019
require alg+kid for key lookup
rnewson May 12, 2017
5b31b0d
Improve pubkey not found error handling (#4)
jaydoane May 24, 2017
80d4a64
Improve restart strategy
jaydoane May 30, 2017
094489f
Merge pull request #5 from jaydoane/improve-restart-strategy
rnewson May 30, 2017
b396a1d
Generate rsa private keys and keypairs
jaydoane Jun 8, 2017
d9a718b
Support JWT encoding
jaydoane Jun 8, 2017
280376f
Merge pull request #6 from cloudant/implement-encode
jaydoane Jun 8, 2017
382229e
Ensure error reason is convertable to JSON
rnewson Jun 9, 2017
768732a
Return error from update_cache
rnewson Jun 15, 2017
a3b6661
move error wrapping to decode function
rnewson Jun 15, 2017
f9c1f33
throw errors that chttpd:error_info can understand
rnewson Jun 15, 2017
8100be3
remove dependency on openssl commands
rnewson Jun 15, 2017
c6e58c4
get_keyset needs ssl started
rnewson Jun 16, 2017
53c254f
Remove unnecessary props
jaydoane May 11, 2017
a01cb0f
Make time explicitly in future
jaydoane May 11, 2017
845226c
Merge pull request #3 from jaydoane/simplify-tests
jaydoane Jun 19, 2017
bb1744e
Suppress compiler warnings
jaydoane Jun 21, 2017
3d6c294
Move key cache to epep application
jaydoane Aug 7, 2017
d4f4aee
Merge pull request #10 from cloudant/move-key-cache
jaydoane Aug 8, 2017
8e937f2
Separate tests into dedicated module
jaydoane Aug 11, 2017
b4abcda
Merge pull request #11 from cloudant/separate-test-module
jaydoane Aug 14, 2017
aecd237
[wip] feat: add mango-based VDU endpoints
garbados Feb 3, 2019
99f94e6
Port reduce_false.js and reduce_builtin.js to Elixir (#2541)
leo-pires Feb 13, 2020
8748310
Bump SM to 60 on Centos 8 (#2544)
wohali Feb 13, 2020
ca178f0
Expose `couch_util:decode/2` to support jiffy options
jaydoane Feb 7, 2020
09ac720
Reset if we don't get a view header
Feb 16, 2020
91ecf67
fix: single node state (#2575)
janl Feb 19, 2020
1e37457
feat(breaking): make _all_dbs admin-only by default (#2577)
janl Feb 19, 2020
e0cff2f
Revert "fix: single node state (#2575)"
janl Feb 19, 2020
26f9366
fix: show single node on setup status with single_node=true
janl Feb 19, 2020
2ef656e
Port changes.js test suite into elixir
jjrodrig Feb 20, 2020
93cf4d3
Merge pull request #2586 from jjrodrig/port-elixir-changes
jjrodrig Feb 22, 2020
fb30ac5
Upgrade Credo to 1.2.2
dottorblaster Feb 4, 2020
6a44b32
Disable legacy Credo checks incompatible with Elixir >= 1.9
dottorblaster Feb 4, 2020
949e496
Merge pull request #2518 from dottorblaster/upgrade-credo-to-1.2.0-di…
dottorblaster Feb 27, 2020
65bc5b0
Bump to jiffy 1.0.4
davisp Feb 27, 2020
7a33ca0
Fix mem3_sync_event_listener test
davisp Feb 27, 2020
d163648
Port form_submit.js test to Elixir
dottorblaster Feb 27, 2020
3f76c9f
Mark form_submit JS test as ported in README and inside the test itself
dottorblaster Feb 27, 2020
16ed4b7
Merge pull request #2608 from dottorblaster/port_form_submit_test_to_…
dottorblaster Feb 28, 2020
c6b54d6
doc: link README-DEV in README
janl Feb 29, 2020
0a4afde
Merge pull request #2619 from apache/doc/readme-links
dottorblaster Feb 29, 2020
93d5263
feat: add mac ci (#2622)
janl Mar 2, 2020
86ec2f3
Port _design_docs tests, design_options and design_paths from js to e…
jjrodrig Mar 2, 2020
ec3cf20
Clean up mango test dbs
jaydoane Feb 21, 2020
deca868
Clean up mango test user docs
jaydoane Feb 22, 2020
6ec8c71
Add coverage to Mango eunit tests
jaydoane Feb 26, 2020
db3aa0f
Improve mango markdown
jaydoane Mar 3, 2020
528e02f
move "users_db_security_editable" to the correct location
danbarbarito Mar 9, 2020
d0c30f2
Merge pull request #2645 from danielbarbarito/users-db-security-edita…
rnewson Mar 9, 2020
640e39c
Create LICENSE
rnewson Mar 10, 2020
b00814e
Enable code coverage
jaydoane Mar 11, 2020
c9a9bf0
Upgrade Credo to 1.3.0
dottorblaster Mar 11, 2020
ddeb2d1
Add new rules to .credo.exs
dottorblaster Mar 11, 2020
1794e14
Handle malformed tokens with jiffy 1.x
jaydoane Mar 11, 2020
8c7e825
Merge pull request #2652 from dottorblaster/upgrade-credo-1.3.0
dottorblaster Mar 11, 2020
588eade
Merge pull request #12 from cloudant/handle-malformed-token
jaydoane Mar 11, 2020
27abf0e
Send correct seq values for filtered changes
davisp Mar 11, 2020
f2ddedd
Merge pull request #2654 from apache/fix-filter-changes-feed-rewinds
rnewson Mar 11, 2020
af2eb04
Set cookie domain when DELETE'ing
rnewson Mar 12, 2020
99101dc
Merge pull request #2657 from apache/cookie-domain-delete
rnewson Mar 12, 2020
087f727
merged jwtf into src/jwtf
rnewson Mar 12, 2020
919f75c
add jwtf to release
rnewson Mar 12, 2020
b14ec65
Merge pull request #2658 from apache/import-jwtf
rnewson Mar 12, 2020
39b9cc7
Enhance alg check
rnewson Mar 13, 2020
da7f648
Merge pull request #2661 from apache/jwtf-enhance-alg-check
rnewson Mar 13, 2020
1f54b14
Port elixir proxyauth tests from js to elixir (#2660)
jjrodrig Mar 16, 2020
ff6cef6
Throw if an unknown check is passed to jwtf:decode
rnewson Mar 16, 2020
f7bdc8c
Merge pull request #2668 from apache/jwtf-unknown-checks
rnewson Mar 16, 2020
032934f
Feature - Add JWT support (#2648)
atrauzzi Mar 19, 2020
cb3c772
Port design_docs tests from js to elixir (#2641)
jjrodrig Mar 19, 2020
996587d
Upgrade Credo to 1.3.1
dottorblaster Mar 20, 2020
fc950c5
Merge pull request #2686 from dottorblaster/upgrade-credo-1.3.1
dottorblaster Mar 20, 2020
11dee52
Ignore unused string variable inside utf8 test case
dottorblaster Mar 20, 2020
f8ffde2
Merge pull request #2688 from dottorblaster/fix-utf8-elixir-test-warning
dottorblaster Mar 20, 2020
3248ebc
Port http, method_override and jsonp tests into elixir test suite (#2…
jjrodrig Mar 21, 2020
f6a4f8e
Fix ported to elixir tag
jjrodrig Mar 21, 2020
8074a32
no need to deduplicate this list
rnewson Mar 19, 2020
bb86d04
generate JWT token ourselves
rnewson Mar 19, 2020
5c77ef0
test all variants of jwt hmac
rnewson Mar 19, 2020
db21eda
support RSA for JWT auth
rnewson Mar 19, 2020
623ae9a
add EC tests
rnewson Mar 20, 2020
c1e7c5a
Create in-memory cache of JWT keys
rnewson Mar 20, 2020
dc88e36
throw Reason directly so we send good http error responses
rnewson Mar 20, 2020
16b3c8d
base64 the symmetric jwt keys
rnewson Mar 20, 2020
55f704d
Merge pull request #2687 from apache/jwt-enhancements
rnewson Mar 23, 2020
8a5f48b
Fix missing apexes in test/elixir/README.md
dottorblaster Mar 22, 2020
c38a2c2
Merge pull request #2698 from dottorblaster/fix-missing-apexes
dottorblaster Mar 23, 2020
5c52904
Ensure clean PATH for Windows couchdb.cmd (#2708)
wohali Mar 23, 2020
1890168
Add support for roles to be obtained from JWTs. (#2694)
atrauzzi Mar 24, 2020
3523c81
Rename the claim used for roles to be more CouchDB specific.
atrauzzi Mar 24, 2020
2b95500
Merge pull request #2714 from atrauzzi/jwt-couchdb-specific-roles-claim
rnewson Mar 24, 2020
49dbb6a
Port purge.js into elixir test suite
jjrodrig Mar 22, 2020
e26d99e
Port view_pagination integration test to elixir test suite
dottorblaster Mar 22, 2020
e22b5ab
Merge pull request #2703 from dottorblaster/port-view-pagination-test…
dottorblaster Mar 25, 2020
2247322
Cleanup mem3 shards_db config lookups
chewbranca Mar 20, 2020
7c831f6
Ensure shards are created with db options
chewbranca Mar 20, 2020
9c95667
Add mem3_util:find_dirty_shards function
chewbranca Mar 26, 2020
9ee8244
Merge pull request #2690 from apache/fix-create-db-options
chewbranca Mar 27, 2020
a799b67
Only trust the servers declaration of JWT key type
rnewson Mar 27, 2020
2212c31
Merge pull request #2727 from apache/jwt-kty-check
rnewson Mar 28, 2020
d291847
Remove enhanced alg check
rnewson Mar 30, 2020
1ab4ff3
Enhance valid claims checks to detect binaries, etc
rnewson Mar 30, 2020
6b6ddf0
Verify all presented claims
rnewson Mar 30, 2020
5bc0af1
Merge pull request #2732 from apache/jwt-controls-2
rnewson Mar 31, 2020
4dca84e
Do not copy the #server.lru field to async openers
davisp Mar 31, 2020
42d20da
fix: require_valid_user exception logic
janl Mar 13, 2020
f3a3312
Improve test initialization
jjrodrig Mar 22, 2020
fb9d404
Update Makefile.win to Include locad configs and clean configs in dev…
jjrodrig Mar 19, 2020
54a05e4
allow to run 'javascript' target with other test targets in the same …
jjrodrig Mar 24, 2020
2ed662e
Port view_offset.js to elixir test suite
dottorblaster Mar 26, 2020
2e78beb
Port recreate docs test
jjrodrig Apr 1, 2020
522627e
Integrate emilio - erang linter
iilyak Feb 26, 2019
7f24add
Merge pull request #1944 from cloudant/integrate-emilio
iilyak Apr 15, 2020
f9dc835
Fix couchjs utf8 conversions (#2786)
davisp Apr 18, 2020
975110d
Update README.rst (#2537)
big-r81 Apr 21, 2020
5748ef3
Bump fauxton to v1.2.3 (#2515)
willholley Apr 21, 2020
a8413bc
fix operator issue with empty arrays (#2805)
tonysun83 Apr 21, 2020
440ab26
Replace VM_ARGS with ARGS_FILE which is set as it is in couchdb scrip…
sklassen Apr 22, 2020
f3d5965
fix: use correct logging module name, fixes #2797 (#2798)
janl Apr 22, 2020
f332f43
safer binary_to_term in mango_json_bookmark
rnewson Apr 23, 2020
66e02a2
Merge pull request #2816 from apache/mango-bookmark-master
rnewson Apr 23, 2020
27d1405
First pass at SpiderMonkey 68 support
wohali Apr 15, 2020
e5239b7
Incorporate changes from #2786
wohali Apr 18, 2020
bb43a69
Replace broken u-escape sequences
davisp Apr 21, 2020
e6e6e6b
Fix new JS test case
wohali Apr 27, 2020
55deba0
python black cleanup
wohali Apr 27, 2020
b7ca42d
Ensure python black runs on all .py files (#2827)
wohali Apr 27, 2020
63e2d08
View is partitioned if db and view are partitioned
rnewson Mar 16, 2020
607f4c1
Suppress offsetof gcc warnings for SM60
wohali Apr 28, 2020
44e0f0f
Drop os_mon from dependencies
wohali Apr 28, 2020
ba9fc3c
Add Ubuntu Focal (20.04) + SM68 to Jenkins
wohali Apr 28, 2020
4f3d5ae
Bump docs, fauxton
wohali Apr 29, 2020
ebdfbba
Fix python-black target for Windows
wohali Apr 30, 2020
baba64b
Port replicator db tests to elixir
jjrodrig Apr 26, 2020
69f6b86
Quit test run without checking that couchdb is running
jjrodrig May 2, 2020
0399200
Fix license file
wohali May 17, 2020
4f7d1d9
allow configurability of JWT claims that require a value
rnewson May 14, 2020
4398d3b
Merge pull request #2888 from apache/jwtf-iss-configurability
rnewson May 18, 2020
850cc12
make jwtf_keystore compatible with erlang 19
rnewson May 21, 2020
143ad31
Merge pull request #2899 from apache/jwtf-erlang-19
rnewson May 21, 2020
e245aa0
make jwtf_keystore compatible with erlang 19 for real this time
rnewson May 21, 2020
474cb72
Merge pull request #2900 from apache/jwtf-erlang-19-2
rnewson May 21, 2020
08a0c6b
Port rev_stemming into elixir
jjrodrig May 9, 2020
4e64f5b
move compact and replicate functions into CouchTestCase shared module
jjrodrig May 25, 2020
0be139a
2906 couchjs sm version (#2911)
sklassen May 30, 2020
ab93b15
feat(auth): Allow a custom JWT claim for roles
May 28, 2020
10fae61
Report if FIPS mode is enabled
rnewson Jun 5, 2020
887d740
Merge pull request #2929 from apache/report-fips-feature
rnewson Jun 5, 2020
a7803fb
In replicator, when rescheduling, pick only pending jobs which are no…
nickva Jun 9, 2020
6659dbb
Make restricted partition search parameters return bad request
bessbd Jun 17, 2020
34baa46
fix: send CSP header to make Fauxotn work fully
janl Jun 18, 2020
074789f
Upgrade Credo to 1.4.0
dottorblaster May 18, 2020
4240391
Allow drilldown for search to always be specified as list of lists
bessbd Jun 19, 2020
22dbde2
Merge pull request #2958 from bessbd/allow-drilldown-list-of-lists
rnewson Jun 22, 2020
c155bd5
Tests already ported to elixir
jjrodrig Jun 26, 2020
5c49e0f
Skip tests as temporary views are not supported
jjrodrig Jun 26, 2020
c6940d8
Port reader_acl test into elixir test suite
jjrodrig Jun 28, 2020
eaf6e74
Port view_update_seq.js into elixir
jjrodrig Jun 29, 2020
0eedd8b
fix: set gen_server:call() timeout to infinity on ioq bypass
janl Jul 2, 2020
23b4aa7
Port view_collation_raw.js to elixir
jjrodrig Jul 1, 2020
ce22cbc
Port view_compaction test to elixir
jjrodrig Jul 7, 2020
fc6dbee
New cname for couchdb-vm2, see INFRA-20435 (#2982)
wohali Jul 20, 2020
909357e
port view_sandboxing.js into elixir
jjrodrig Jul 10, 2020
b518f01
port update_documents.js into elixir
jjrodrig Jul 13, 2020
6944605
Port view multi_key tests into elixir
jjrodrig Jul 22, 2020
a817e60
fix: finish_cluster failure due to missing uuid
YC Jul 25, 2020
f011a66
added $keyMapMatch Mango operator
Jul 27, 2020
f43f78a
Windows: provide full path to epmd
wohali Aug 2, 2020
e0cbe1c
Remove wrongly commited file from #2955 (#3070)
wohali Aug 10, 2020
57e3501
Unlink index pid and swallow EXIT message if present
rnewson Aug 10, 2020
c66694f
Merge pull request #3068 from apache/couch_index_server_crash
rnewson Aug 12, 2020
7c9094c
Validate shard specific query params on db create request
eiri Aug 13, 2020
5004f99
Don't crash couch_index_server if the db isn't known yet
Aug 13, 2020
7d9f115
Merge pull request #3075 from apache/couch_index_server_crash2
rnewson Aug 14, 2020
11e8d0d
fixup: Build couch_js for redhat linux
jiangphcn Aug 5, 2020
3091c93
Merge pull request #3056 from apache/build-couchjs-for-redhat-linux
jiangphcn Aug 20, 2020
bdfb129
Handle jiffy returning an iolist when encoding atts_since query string
nickva Aug 20, 2020
7dbd0ad
bypass partition query limit for mango
tonysun83 Aug 26, 2020
3004513
update dev/run formatting to adhere to python format checks
tonysun83 Aug 27, 2020
ac69520
Merge pull request #3105 from apache/fix-partition-query-limit
tonysun83 Aug 28, 2020
c14569c
fix bookmark passing with text indexes
tonysun83 Aug 29, 2020
0c3c4b6
Merge pull request #3116 from apache/fix-explain-text-indexes
tonysun83 Aug 31, 2020
253d64a
Allow to continue to cleanup search index even if there is invalid ddoc
jiangphcn Sep 1, 2020
27eefab
Merge pull request #3118 from apache/dreyfus-cleanup-with-invalid-ddoc
jiangphcn Sep 1, 2020
a57b717
Tag elixir tests into meaningful groups
dottorblaster Aug 31, 2020
d72a5f5
return a clean error if pem_decode fails
rnewson Sep 3, 2020
29a5dea
Merge pull request #3125 from apache/improve_jwtf_keystore_error_hand…
rnewson Sep 3, 2020
e7822a5
Make COPY doc return only one "ok"
bessbd Sep 4, 2020
881f52f
Add option to delay responses until the end
rnewson Sep 4, 2020
c625517
Merge pull request #3129 from apache/delay_response_until_end
rnewson Sep 7, 2020
e4d577b
Handle malformed URLs when stripping URL creds in couch_replicator
nickva Sep 9, 2020
45ddc93
Introduce .asf.yaml file (#3020)
wohali Sep 10, 2020
a94e693
add remonitor code to DOWN message (#3144)
tonysun83 Sep 10, 2020
1c6a738
Fix buffer_response=true (#3145)
rnewson Sep 10, 2020
ac33e85
Port view_conflicts.js, view_errors.js and view_include_docs.js into …
jjrodrig Jul 15, 2020
168d635
fix race condition (#3150)
tonysun83 Sep 14, 2020
6169104
Drop Jenkins ppc64le builds (for now) (#3151)
wohali Sep 15, 2020
3b815a6
Preserve query string rewrite when the request contains a body
jjrodrig Sep 24, 2020
796d714
port rewrite and rewrite_js tests into elixir
jjrodrig Jul 23, 2020
1719500
Add module tag to elixir test cases (#3178)
jiangphcn Sep 30, 2020
fb36cc6
Port show_documents and list_views to Elixir
jjrodrig Sep 29, 2020
f21d601
Complete the port of security_validation tests to Elixir
jjrodrig Sep 29, 2020
de35260
port users_db_security tests to elixir
jjrodrig Oct 3, 2020
9564023
Remove javascript tests from main build process
jjrodrig Oct 5, 2020
90d4cf7
Merge branch 'master' into feat/mango-vdu
wohali Oct 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/mango/src/mango_cursor_text.erl
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@
}).


create(Db, Indexes, Selector, Opts0) ->
create(Db, Indexes, Selector, Opts) ->
Index = case Indexes of
[Index0] ->
Index0;
_ ->
?MANGO_ERROR(multiple_text_indexes)
end,

Opts = unpack_bookmark(couch_db:name(Db), Opts0),
Bookmark = unpack_bookmark(couch_db:name(Db), Opts),

DreyfusLimit = get_dreyfus_limit(),
Limit = erlang:min(DreyfusLimit, couch_util:get_value(limit, Opts, mango_opts:default_limit())),
Expand All @@ -66,7 +66,8 @@ create(Db, Indexes, Selector, Opts0) ->
opts = Opts,
limit = Limit,
skip = Skip,
fields = Fields
fields = Fields,
bookmark = Bookmark
}}.


Expand All @@ -90,7 +91,8 @@ execute(Cursor, UserFun, UserAcc) ->
skip = Skip,
selector = Selector,
opts = Opts,
execution_stats = Stats
execution_stats = Stats,
bookmark = Bookmark
} = Cursor,
Query = mango_selector_text:convert(Selector),
QueryArgs = #index_query_args{
Expand All @@ -104,7 +106,7 @@ execute(Cursor, UserFun, UserAcc) ->
dbname = couch_db:name(Db),
ddocid = ddocid(Idx),
idx_name = mango_idx:name(Idx),
bookmark = get_bookmark(Opts),
bookmark = Bookmark,
limit = Limit,
skip = Skip,
query_args = QueryArgs,
Expand Down Expand Up @@ -282,7 +284,7 @@ pack_bookmark(Bookmark) ->


unpack_bookmark(DbName, Opts) ->
NewBM = case lists:keyfind(bookmark, 1, Opts) of
case lists:keyfind(bookmark, 1, Opts) of
{_, nil} ->
[];
{_, Bin} ->
Expand All @@ -291,8 +293,7 @@ unpack_bookmark(DbName, Opts) ->
catch _:_ ->
?MANGO_ERROR({invalid_bookmark, Bin})
end
end,
lists:keystore(bookmark, 1, Opts, {bookmark, NewBM}).
end.


ddocid(Idx) ->
Expand Down
10 changes: 10 additions & 0 deletions src/mango/test/08-text-limit-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,13 @@ def run_bookmark_sort_check(self, size):
assert json["bookmark"] != bm
bm = json["bookmark"]
assert len(seen_docs) == len(limit_docs.DOCS)

def run_explain_check(self, size):
q = {"age": {"$gt": 0}}
seen_docs = set()
bm = None
results1 = self.db.find(q, limit=size, bookmark=bm, return_raw=True)
assert results1["bookmark"] != bm
bm = results1["bookmark"]
results2 = self.db.find(q, limit=size, bookmark=bm, explain=True)
assert results2["bookmark"] == bm