couchbase 4.2.3 → 4.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. package/deps/couchbase-cxx-client/CMakeLists.txt +54 -4
  2. package/deps/couchbase-cxx-client/README.md +1 -0
  3. package/deps/couchbase-cxx-client/bin/create-search-index +164 -0
  4. package/deps/couchbase-cxx-client/bin/init-cluster +55 -10
  5. package/deps/couchbase-cxx-client/bin/run-unit-tests +62 -6
  6. package/deps/couchbase-cxx-client/bin/travel-sample-index-v6.json +184 -0
  7. package/deps/couchbase-cxx-client/bin/travel-sample-index.json +188 -0
  8. package/deps/couchbase-cxx-client/cmake/Documentation.cmake +0 -1
  9. package/deps/couchbase-cxx-client/cmake/OpenSSL.cmake +98 -3
  10. package/deps/couchbase-cxx-client/cmake/Testing.cmake +8 -0
  11. package/deps/couchbase-cxx-client/cmake/build_config.hxx.in +3 -0
  12. package/deps/couchbase-cxx-client/core/bucket.cxx +183 -152
  13. package/deps/couchbase-cxx-client/core/bucket.hxx +17 -4
  14. package/deps/couchbase-cxx-client/core/cluster.hxx +18 -1
  15. package/deps/couchbase-cxx-client/core/cluster_options.hxx +1 -0
  16. package/deps/couchbase-cxx-client/core/error_context/key_value.cxx +2 -1
  17. package/deps/couchbase-cxx-client/core/error_context/key_value.hxx +10 -12
  18. package/deps/couchbase-cxx-client/core/error_context/search.hxx +1 -1
  19. package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
  20. package/deps/couchbase-cxx-client/core/impl/boolean_field_query.cxx +40 -0
  21. package/deps/couchbase-cxx-client/core/impl/boolean_query.cxx +62 -0
  22. package/deps/couchbase-cxx-client/core/impl/cluster.cxx +1 -0
  23. package/deps/couchbase-cxx-client/core/impl/conjunction_query.cxx +51 -0
  24. package/deps/couchbase-cxx-client/core/impl/date_range.cxx +89 -0
  25. package/deps/couchbase-cxx-client/core/impl/date_range_facet.cxx +54 -0
  26. package/deps/couchbase-cxx-client/core/impl/date_range_facet_result.cxx +64 -0
  27. package/deps/couchbase-cxx-client/core/impl/date_range_query.cxx +125 -0
  28. package/deps/couchbase-cxx-client/core/impl/disjunction_query.cxx +51 -0
  29. package/deps/couchbase-cxx-client/core/impl/encoded_search_facet.hxx +29 -0
  30. package/deps/couchbase-cxx-client/core/impl/encoded_search_query.hxx +29 -0
  31. package/deps/couchbase-cxx-client/core/impl/encoded_search_sort.hxx +29 -0
  32. package/deps/couchbase-cxx-client/core/impl/geo_bounding_box_query.cxx +46 -0
  33. package/deps/couchbase-cxx-client/core/impl/geo_distance_query.cxx +43 -0
  34. package/deps/couchbase-cxx-client/core/impl/geo_polygon_query.cxx +46 -0
  35. package/deps/couchbase-cxx-client/core/impl/internal_date_range_facet_result.cxx +80 -0
  36. package/deps/couchbase-cxx-client/core/impl/internal_date_range_facet_result.hxx +48 -0
  37. package/deps/couchbase-cxx-client/core/impl/internal_numeric_range_facet_result.cxx +80 -0
  38. package/deps/couchbase-cxx-client/core/impl/internal_numeric_range_facet_result.hxx +48 -0
  39. package/deps/couchbase-cxx-client/core/impl/internal_search_error_context.cxx +141 -0
  40. package/deps/couchbase-cxx-client/core/impl/internal_search_error_context.hxx +61 -0
  41. package/deps/couchbase-cxx-client/core/impl/internal_search_meta_data.cxx +60 -0
  42. package/deps/couchbase-cxx-client/core/impl/internal_search_meta_data.hxx +41 -0
  43. package/deps/couchbase-cxx-client/core/impl/internal_search_result.cxx +84 -0
  44. package/deps/couchbase-cxx-client/core/impl/internal_search_result.hxx +43 -0
  45. package/deps/couchbase-cxx-client/core/impl/internal_search_row.cxx +82 -0
  46. package/deps/couchbase-cxx-client/core/impl/internal_search_row.hxx +56 -0
  47. package/deps/couchbase-cxx-client/core/impl/internal_search_row_location.hxx +32 -0
  48. package/deps/couchbase-cxx-client/core/impl/internal_search_row_locations.cxx +137 -0
  49. package/deps/couchbase-cxx-client/core/impl/internal_search_row_locations.hxx +45 -0
  50. package/deps/couchbase-cxx-client/core/impl/internal_term_facet_result.cxx +80 -0
  51. package/deps/couchbase-cxx-client/core/impl/internal_term_facet_result.hxx +48 -0
  52. package/deps/couchbase-cxx-client/core/impl/key_value_error_context.cxx +98 -0
  53. package/deps/couchbase-cxx-client/core/impl/match_all_query.cxx +35 -0
  54. package/deps/couchbase-cxx-client/core/impl/match_none_query.cxx +35 -0
  55. package/deps/couchbase-cxx-client/core/impl/match_phrase_query.cxx +43 -0
  56. package/deps/couchbase-cxx-client/core/impl/match_query.cxx +59 -0
  57. package/deps/couchbase-cxx-client/core/impl/numeric_range.cxx +49 -0
  58. package/deps/couchbase-cxx-client/core/impl/numeric_range_facet.cxx +54 -0
  59. package/deps/couchbase-cxx-client/core/impl/numeric_range_facet_result.cxx +64 -0
  60. package/deps/couchbase-cxx-client/core/impl/numeric_range_query.cxx +56 -0
  61. package/deps/couchbase-cxx-client/core/impl/phrase_query.cxx +42 -0
  62. package/deps/couchbase-cxx-client/core/impl/prefix_query.cxx +40 -0
  63. package/deps/couchbase-cxx-client/core/impl/query_error_context.cxx +75 -0
  64. package/deps/couchbase-cxx-client/core/impl/query_string_query.cxx +37 -0
  65. package/deps/couchbase-cxx-client/core/impl/regexp_query.cxx +40 -0
  66. package/deps/couchbase-cxx-client/core/impl/search.cxx +191 -0
  67. package/deps/couchbase-cxx-client/core/impl/search_error_context.cxx +147 -0
  68. package/deps/couchbase-cxx-client/core/impl/search_meta_data.cxx +46 -0
  69. package/deps/couchbase-cxx-client/core/impl/search_result.cxx +66 -0
  70. package/deps/couchbase-cxx-client/core/impl/search_row.cxx +74 -0
  71. package/deps/couchbase-cxx-client/core/impl/search_row_location.cxx +64 -0
  72. package/deps/couchbase-cxx-client/core/impl/search_row_locations.cxx +66 -0
  73. package/deps/couchbase-cxx-client/core/impl/search_sort_field.cxx +104 -0
  74. package/deps/couchbase-cxx-client/core/impl/search_sort_id.cxx +43 -0
  75. package/deps/couchbase-cxx-client/core/impl/search_sort_score.cxx +43 -0
  76. package/deps/couchbase-cxx-client/core/impl/term_facet.cxx +36 -0
  77. package/deps/couchbase-cxx-client/core/impl/term_facet_result.cxx +64 -0
  78. package/deps/couchbase-cxx-client/core/impl/term_query.cxx +56 -0
  79. package/deps/couchbase-cxx-client/core/impl/term_range_query.cxx +57 -0
  80. package/deps/couchbase-cxx-client/core/impl/wildcard_query.cxx +40 -0
  81. package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +9 -2
  82. package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +54 -37
  83. package/deps/couchbase-cxx-client/core/io/mcbp_session.hxx +4 -3
  84. package/deps/couchbase-cxx-client/core/json_string.hxx +5 -0
  85. package/deps/couchbase-cxx-client/core/meta/version.cxx +18 -4
  86. package/deps/couchbase-cxx-client/core/mozilla_ca_bundle.hxx +39 -0
  87. package/deps/couchbase-cxx-client/core/operations/document_search.cxx +3 -1
  88. package/deps/couchbase-cxx-client/core/operations/document_search.hxx +1 -1
  89. package/deps/couchbase-cxx-client/core/protocol/client_request.hxx +11 -2
  90. package/deps/couchbase-cxx-client/core/protocol/client_response.hxx +1 -0
  91. package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +59 -46
  92. package/deps/couchbase-cxx-client/core/utils/connection_string.hxx +1 -0
  93. package/deps/couchbase-cxx-client/couchbase/analytics_error_context.hxx +1 -1
  94. package/deps/couchbase-cxx-client/couchbase/boolean_field_query.hxx +77 -0
  95. package/deps/couchbase-cxx-client/couchbase/boolean_query.hxx +223 -0
  96. package/deps/couchbase-cxx-client/couchbase/cluster.hxx +39 -0
  97. package/deps/couchbase-cxx-client/couchbase/conjunction_query.hxx +88 -0
  98. package/deps/couchbase-cxx-client/couchbase/date_range.hxx +69 -0
  99. package/deps/couchbase-cxx-client/couchbase/date_range_facet.hxx +56 -0
  100. package/deps/couchbase-cxx-client/couchbase/date_range_facet_result.hxx +55 -0
  101. package/deps/couchbase-cxx-client/couchbase/date_range_query.hxx +265 -0
  102. package/deps/couchbase-cxx-client/couchbase/disjunction_query.hxx +109 -0
  103. package/deps/couchbase-cxx-client/couchbase/doc_id_query.hxx +111 -0
  104. package/deps/couchbase-cxx-client/couchbase/error_context.hxx +17 -8
  105. package/deps/couchbase-cxx-client/couchbase/fmt/analytics_scan_consistency.hxx +52 -0
  106. package/deps/couchbase-cxx-client/{core/topology/error_map_fmt.hxx → couchbase/fmt/key_value_error_map_attribute.hxx} +21 -21
  107. package/deps/couchbase-cxx-client/couchbase/fmt/search_scan_consistency.hxx +49 -0
  108. package/deps/couchbase-cxx-client/couchbase/geo_bounding_box_query.hxx +107 -0
  109. package/deps/couchbase-cxx-client/couchbase/geo_distance_query.hxx +109 -0
  110. package/deps/couchbase-cxx-client/couchbase/geo_point.hxx +32 -0
  111. package/deps/couchbase-cxx-client/couchbase/geo_polygon_query.hxx +85 -0
  112. package/deps/couchbase-cxx-client/couchbase/highlight_style.hxx +45 -0
  113. package/deps/couchbase-cxx-client/couchbase/key_value_error_context.hxx +7 -2
  114. package/deps/couchbase-cxx-client/couchbase/manager_error_context.hxx +1 -1
  115. package/deps/couchbase-cxx-client/couchbase/match_all_query.hxx +43 -0
  116. package/deps/couchbase-cxx-client/couchbase/match_none_query.hxx +43 -0
  117. package/deps/couchbase-cxx-client/couchbase/match_operator.hxx +45 -0
  118. package/deps/couchbase-cxx-client/couchbase/match_phrase_query.hxx +108 -0
  119. package/deps/couchbase-cxx-client/couchbase/match_query.hxx +163 -0
  120. package/deps/couchbase-cxx-client/couchbase/numeric_range.hxx +58 -0
  121. package/deps/couchbase-cxx-client/couchbase/numeric_range_facet.hxx +56 -0
  122. package/deps/couchbase-cxx-client/couchbase/numeric_range_facet_result.hxx +55 -0
  123. package/deps/couchbase-cxx-client/couchbase/numeric_range_query.hxx +143 -0
  124. package/deps/couchbase-cxx-client/couchbase/phrase_query.hxx +93 -0
  125. package/deps/couchbase-cxx-client/couchbase/prefix_query.hxx +82 -0
  126. package/deps/couchbase-cxx-client/couchbase/query_error_context.hxx +3 -1
  127. package/deps/couchbase-cxx-client/couchbase/query_string_query.hxx +72 -0
  128. package/deps/couchbase-cxx-client/couchbase/regexp_query.hxx +82 -0
  129. package/deps/couchbase-cxx-client/couchbase/scope.hxx +39 -0
  130. package/deps/couchbase-cxx-client/couchbase/search_date_range.hxx +68 -0
  131. package/deps/couchbase-cxx-client/couchbase/search_error_context.hxx +138 -0
  132. package/deps/couchbase-cxx-client/couchbase/search_facet.hxx +60 -0
  133. package/deps/couchbase-cxx-client/couchbase/search_facet_result.hxx +50 -0
  134. package/deps/couchbase-cxx-client/couchbase/search_meta_data.hxx +85 -0
  135. package/deps/couchbase-cxx-client/couchbase/search_metrics.hxx +127 -0
  136. package/deps/couchbase-cxx-client/couchbase/search_numeric_range.hxx +69 -0
  137. package/deps/couchbase-cxx-client/couchbase/search_options.hxx +509 -0
  138. package/deps/couchbase-cxx-client/couchbase/search_query.hxx +69 -0
  139. package/deps/couchbase-cxx-client/couchbase/search_result.hxx +77 -0
  140. package/deps/couchbase-cxx-client/couchbase/search_row.hxx +104 -0
  141. package/deps/couchbase-cxx-client/couchbase/search_row_location.hxx +55 -0
  142. package/deps/couchbase-cxx-client/couchbase/search_row_locations.hxx +86 -0
  143. package/deps/couchbase-cxx-client/couchbase/search_scan_consistency.hxx +34 -0
  144. package/deps/couchbase-cxx-client/couchbase/search_sort.hxx +58 -0
  145. package/deps/couchbase-cxx-client/couchbase/search_sort_field.hxx +117 -0
  146. package/deps/couchbase-cxx-client/couchbase/search_sort_field_missing.hxx +26 -0
  147. package/deps/couchbase-cxx-client/couchbase/search_sort_field_mode.hxx +27 -0
  148. package/deps/couchbase-cxx-client/couchbase/search_sort_field_type.hxx +28 -0
  149. package/deps/couchbase-cxx-client/couchbase/search_sort_id.hxx +60 -0
  150. package/deps/couchbase-cxx-client/couchbase/search_sort_score.hxx +60 -0
  151. package/deps/couchbase-cxx-client/couchbase/search_term_range.hxx +51 -0
  152. package/deps/couchbase-cxx-client/couchbase/security_options.hxx +3 -0
  153. package/deps/couchbase-cxx-client/couchbase/subdocument_error_context.hxx +4 -2
  154. package/deps/couchbase-cxx-client/couchbase/term_facet.hxx +48 -0
  155. package/deps/couchbase-cxx-client/couchbase/term_facet_result.hxx +55 -0
  156. package/deps/couchbase-cxx-client/couchbase/term_query.hxx +151 -0
  157. package/deps/couchbase-cxx-client/couchbase/term_range_query.hxx +142 -0
  158. package/deps/couchbase-cxx-client/couchbase/transactions/transaction_options.hxx +1 -1
  159. package/deps/couchbase-cxx-client/couchbase/transactions/transaction_query_options.hxx +2 -1
  160. package/deps/couchbase-cxx-client/couchbase/transactions/transaction_result.hxx +1 -1
  161. package/deps/couchbase-cxx-client/couchbase/transactions.hxx +3 -3
  162. package/deps/couchbase-cxx-client/couchbase/wildcard_query.hxx +83 -0
  163. package/deps/couchbase-cxx-client/docs/Doxyfile.in +1 -1
  164. package/deps/couchbase-cxx-client/docs/cbc-analytics.md +2 -2
  165. package/deps/couchbase-cxx-client/docs/cbc-get.md +3 -2
  166. package/deps/couchbase-cxx-client/docs/cbc-pillowfight.md +7 -2
  167. package/deps/couchbase-cxx-client/docs/cbc-query.md +2 -2
  168. package/deps/couchbase-cxx-client/docs/cbc.md +3 -3
  169. package/deps/couchbase-cxx-client/docs/cli.hxx +5 -5
  170. package/deps/couchbase-cxx-client/docs/mainpage.hxx +42 -5
  171. package/deps/couchbase-cxx-client/test/CMakeLists.txt +1 -0
  172. package/deps/couchbase-cxx-client/test/test_integration_analytics.cxx +28 -6
  173. package/deps/couchbase-cxx-client/test/test_integration_collections.cxx +7 -3
  174. package/deps/couchbase-cxx-client/test/test_integration_connect.cxx +7 -3
  175. package/deps/couchbase-cxx-client/test/test_integration_crud.cxx +13 -3
  176. package/deps/couchbase-cxx-client/test/test_integration_diagnostics.cxx +8 -2
  177. package/deps/couchbase-cxx-client/test/test_integration_durability.cxx +12 -7
  178. package/deps/couchbase-cxx-client/test/test_integration_examples.cxx +283 -11
  179. package/deps/couchbase-cxx-client/test/test_integration_management.cxx +140 -88
  180. package/deps/couchbase-cxx-client/test/test_integration_query.cxx +67 -9
  181. package/deps/couchbase-cxx-client/test/test_integration_range_scan.cxx +12 -12
  182. package/deps/couchbase-cxx-client/test/test_integration_read_replica.cxx +48 -11
  183. package/deps/couchbase-cxx-client/test/test_integration_search.cxx +19 -1
  184. package/deps/couchbase-cxx-client/test/test_integration_subdoc.cxx +60 -9
  185. package/deps/couchbase-cxx-client/test/test_integration_tracer.cxx +3 -0
  186. package/deps/couchbase-cxx-client/test/test_integration_transcoders.cxx +4 -0
  187. package/deps/couchbase-cxx-client/test/test_transaction_examples.cxx +100 -85
  188. package/deps/couchbase-cxx-client/test/test_unit_connection_string.cxx +29 -0
  189. package/deps/couchbase-cxx-client/test/test_unit_search.cxx +427 -0
  190. package/deps/couchbase-cxx-client/test/utils/integration_test_guard.cxx +2 -1
  191. package/deps/couchbase-cxx-client/test/utils/logger.cxx +3 -1
  192. package/deps/couchbase-cxx-client/test/utils/server_version.hxx +31 -15
  193. package/deps/couchbase-cxx-client/test/utils/test_context.cxx +8 -0
  194. package/deps/couchbase-cxx-client/tools/get.cxx +9 -8
  195. package/deps/couchbase-cxx-client/tools/pillowfight.cxx +175 -75
  196. package/deps/couchbase-cxx-client/tools/version.cxx +4 -2
  197. package/dist/binding.d.ts +1 -1
  198. package/package.json +1 -1
  199. package/src/jstocbpp_autogen.hpp +3 -2
@@ -0,0 +1,188 @@
1
+ {
2
+ "type": "fulltext-index",
3
+ "name": "travel-sample-index",
4
+ "sourceType": "gocbcore",
5
+ "sourceName": "travel-sample",
6
+ "planParams": {
7
+ "maxPartitionsPerPIndex": 1024,
8
+ "indexPartitions": 1
9
+ },
10
+ "params": {
11
+ "doc_config": {
12
+ "docid_prefix_delim": "",
13
+ "docid_regexp": "",
14
+ "mode": "scope.collection.type_field",
15
+ "type_field": "type"
16
+ },
17
+ "mapping": {
18
+ "analysis": {},
19
+ "default_analyzer": "standard",
20
+ "default_datetime_parser": "dateTimeOptional",
21
+ "default_field": "_all",
22
+ "default_mapping": {
23
+ "dynamic": false,
24
+ "enabled": false
25
+ },
26
+ "default_type": "_default",
27
+ "docvalues_dynamic": false,
28
+ "index_dynamic": false,
29
+ "store_dynamic": false,
30
+ "type_field": "_type",
31
+ "types": {
32
+ "inventory.airline": {
33
+ "dynamic": false,
34
+ "enabled": true,
35
+ "properties": {
36
+ "country": {
37
+ "dynamic": false,
38
+ "enabled": true,
39
+ "fields": [
40
+ {
41
+ "analyzer": "keyword",
42
+ "docvalues": true,
43
+ "index": true,
44
+ "name": "country",
45
+ "store": true,
46
+ "type": "text"
47
+ }
48
+ ]
49
+ },
50
+ "name": {
51
+ "dynamic": false,
52
+ "enabled": true,
53
+ "fields": [
54
+ {
55
+ "analyzer": "en",
56
+ "docvalues": true,
57
+ "include_in_all": true,
58
+ "include_term_vectors": true,
59
+ "index": true,
60
+ "name": "name",
61
+ "store": true,
62
+ "type": "text"
63
+ }
64
+ ]
65
+ }
66
+ }
67
+ },
68
+ "inventory.hotel": {
69
+ "dynamic": false,
70
+ "enabled": true,
71
+ "properties": {
72
+ "city": {
73
+ "dynamic": false,
74
+ "enabled": true,
75
+ "fields": [
76
+ {
77
+ "analyzer": "en",
78
+ "docvalues": true,
79
+ "include_in_all": true,
80
+ "include_term_vectors": true,
81
+ "index": true,
82
+ "name": "city",
83
+ "store": true,
84
+ "type": "text"
85
+ }
86
+ ]
87
+ },
88
+ "country": {
89
+ "dynamic": false,
90
+ "enabled": true,
91
+ "fields": [
92
+ {
93
+ "analyzer": "keyword",
94
+ "docvalues": true,
95
+ "include_in_all": true,
96
+ "include_term_vectors": true,
97
+ "index": true,
98
+ "name": "country",
99
+ "store": true,
100
+ "type": "text"
101
+ }
102
+ ]
103
+ },
104
+ "description": {
105
+ "dynamic": false,
106
+ "enabled": true,
107
+ "fields": [
108
+ {
109
+ "analyzer": "en",
110
+ "docvalues": true,
111
+ "include_in_all": true,
112
+ "include_term_vectors": true,
113
+ "index": true,
114
+ "name": "description",
115
+ "store": true,
116
+ "type": "text"
117
+ }
118
+ ]
119
+ },
120
+ "reviews": {
121
+ "dynamic": false,
122
+ "enabled": true,
123
+ "properties": {
124
+ "content": {
125
+ "dynamic": false,
126
+ "enabled": true,
127
+ "fields": [
128
+ {
129
+ "analyzer": "en",
130
+ "docvalues": true,
131
+ "include_in_all": true,
132
+ "include_term_vectors": true,
133
+ "index": true,
134
+ "name": "content",
135
+ "store": true,
136
+ "type": "text"
137
+ }
138
+ ]
139
+ },
140
+ "ratings": {
141
+ "dynamic": false,
142
+ "enabled": true,
143
+ "properties": {
144
+ "Overall": {
145
+ "dynamic": false,
146
+ "enabled": true,
147
+ "fields": [
148
+ {
149
+ "docvalues": true,
150
+ "include_in_all": true,
151
+ "index": true,
152
+ "name": "Overall",
153
+ "store": true,
154
+ "type": "number"
155
+ }
156
+ ]
157
+ }
158
+ }
159
+ }
160
+ }
161
+ },
162
+ "title": {
163
+ "dynamic": false,
164
+ "enabled": true,
165
+ "fields": [
166
+ {
167
+ "analyzer": "en",
168
+ "docvalues": true,
169
+ "include_in_all": true,
170
+ "include_term_vectors": true,
171
+ "index": true,
172
+ "name": "title",
173
+ "store": true,
174
+ "type": "text"
175
+ }
176
+ ]
177
+ }
178
+ }
179
+ }
180
+ }
181
+ },
182
+ "store": {
183
+ "indexType": "scorch",
184
+ "segmentVersion": 15
185
+ }
186
+ },
187
+ "sourceParams": {}
188
+ }
@@ -20,7 +20,6 @@ if(DOXYGEN_FOUND AND DOT)
20
20
  set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/html/index.html)
21
21
  set(DOXYGEN_CONFIG_TEMPLATE ${PROJECT_SOURCE_DIR}/docs/Doxyfile.in)
22
22
  set(DOXYGEN_CONFIG ${PROJECT_BINARY_DIR}/Doxyfile)
23
- file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR})
24
23
  configure_file(${DOXYGEN_CONFIG_TEMPLATE} ${DOXYGEN_CONFIG})
25
24
  add_custom_command(
26
25
  OUTPUT ${DOXYGEN_INDEX_FILE}
@@ -49,7 +49,7 @@ else()
49
49
  OPENSSL_USABLE ${CMAKE_CURRENT_BINARY_DIR}
50
50
  ${CMAKE_CURRENT_SOURCE_DIR}/cmake/test_openssl.cxx
51
51
  LINK_LIBRARIES OpenSSL::SSL CXX_STANDARD 17)
52
- if( OPENSSL_USABLE)
52
+ if(OPENSSL_USABLE)
53
53
  message(STATUS "OPENSSL_VERSION: ${OPENSSL_VERSION}")
54
54
  message(STATUS "OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}")
55
55
  message(STATUS "OPENSSL_LIBRARIES: ${OPENSSL_LIBRARIES}")
@@ -60,7 +60,12 @@ else()
60
60
  "Cannot use OpenSSL ${OPENSSL_VERSION} at \"${OPENSSL_INCLUDE_DIR}\" and \"${OPENSSL_LIBRARIES}\". Will try to use from pkg-config."
61
61
  )
62
62
  find_package(PkgConfig REQUIRED)
63
- pkg_check_modules(PKG_CONFIG_OPENSSL REQUIRED IMPORTED_TARGET GLOBAL openssl11)
63
+ pkg_check_modules(
64
+ PKG_CONFIG_OPENSSL
65
+ REQUIRED
66
+ IMPORTED_TARGET
67
+ GLOBAL
68
+ openssl11)
64
69
  if(PKG_CONFIG_OPENSSL_FOUND)
65
70
  message(STATUS "PKG_CONFIG_OPENSSL_VERSION: ${PKG_CONFIG_OPENSSL_VERSION}")
66
71
  message(STATUS "PKG_CONFIG_OPENSSL_INCLUDE_DIRS: ${PKG_CONFIG_OPENSSL_INCLUDE_DIRS}")
@@ -74,7 +79,12 @@ else()
74
79
  endif()
75
80
  elseif(UNIX)
76
81
  find_package(PkgConfig REQUIRED)
77
- pkg_check_modules(PKG_CONFIG_OPENSSL REQUIRED IMPORTED_TARGET GLOBAL openssl11)
82
+ pkg_check_modules(
83
+ PKG_CONFIG_OPENSSL
84
+ REQUIRED
85
+ IMPORTED_TARGET
86
+ GLOBAL
87
+ openssl11)
78
88
  if(PKG_CONFIG_OPENSSL_FOUND)
79
89
  message(STATUS "PKG_CONFIG_OPENSSL_VERSION: ${PKG_CONFIG_OPENSSL_VERSION}")
80
90
  message(STATUS "PKG_CONFIG_OPENSSL_INCLUDE_DIRS: ${PKG_CONFIG_OPENSSL_INCLUDE_DIRS}")
@@ -90,3 +100,88 @@ endif()
90
100
  # Read more at https://wiki.wireshark.org/TLS
91
101
  option(COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE
92
102
  "Path to file to write per-session secrets (Useful for Wireshark SSL/TLS dissection)")
103
+
104
+ option(COUCHBASE_CXX_CLIENT_EMBED_MOZILLA_CA_BUNDLE
105
+ "Download and embed Mozilla certificates from https://curl.se/ca/cacert.pem" TRUE)
106
+
107
+ if(COUCHBASE_CXX_CLIENT_EMBED_MOZILLA_CA_BUNDLE)
108
+ file(DOWNLOAD "https://curl.se/ca/cacert.pem.sha256" "${CMAKE_CURRENT_BINARY_DIR}/mozilla-ca-bundle.sha256"
109
+ TLS_VERIFY ON)
110
+ file(READ "${CMAKE_CURRENT_BINARY_DIR}/mozilla-ca-bundle.sha256" HASH_FILE_CONTENT)
111
+ string(
112
+ REGEX MATCH
113
+ "^([0-9a-f]+)"
114
+ COUCHBASE_CXX_CLIENT_MOZILLA_CA_BUNDLE_SHA256
115
+ ${HASH_FILE_CONTENT})
116
+ if(NOT COUCHBASE_CXX_CLIENT_MOZILLA_CA_BUNDLE_SHA256)
117
+ message(FATAL_ERROR "Failed to extract expected hash from file")
118
+ endif()
119
+ file(
120
+ DOWNLOAD "https://curl.se/ca/cacert.pem" "${CMAKE_CURRENT_BINARY_DIR}/mozilla-ca-bundle.crt"
121
+ TLS_VERIFY ON
122
+ EXPECTED_HASH SHA256=${COUCHBASE_CXX_CLIENT_MOZILLA_CA_BUNDLE_SHA256})
123
+
124
+ file(READ "${CMAKE_CURRENT_BINARY_DIR}/mozilla-ca-bundle.crt" CA_BUNDLE_CONTENT)
125
+ string(
126
+ REGEX MATCH
127
+ "Certificate data from Mozilla as of: ([^\n]*)"
128
+ CA_BUNDLE_DATE_LINE
129
+ ${CA_BUNDLE_CONTENT})
130
+ set(COUCHBASE_CXX_CLIENT_MOZILLA_CA_BUNDLE_DATE "${CMAKE_MATCH_1}")
131
+ else()
132
+ set(CA_BUNDLE_CONTENT "")
133
+ endif()
134
+
135
+ set(CA_BUNDLE_CPP_FILE "${CMAKE_CURRENT_BINARY_DIR}/generated/mozilla_ca_bundle.cxx")
136
+
137
+ # We parse CRT file because C++ does not allow string literals over 64k, and turning everything into bytes does not
138
+ # seems to be cross-platform and fast.
139
+ string(
140
+ REGEX MATCHALL
141
+ "[^=#]+=+\n-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----"
142
+ CERTIFICATES
143
+ "${CA_BUNDLE_CONTENT}")
144
+ list(LENGTH CERTIFICATES NUMBER_OF_CERTIFICATES)
145
+ file(
146
+ WRITE ${CA_BUNDLE_CPP_FILE}
147
+ "
148
+ #include \"core/mozilla_ca_bundle.hxx\"
149
+
150
+ namespace couchbase::core::default_ca
151
+ {
152
+ constexpr inline std::size_t number_of_certificates{ ${NUMBER_OF_CERTIFICATES} };
153
+ constexpr inline certificate certificates[]{
154
+ ")
155
+ foreach(CERTIFICATE ${CERTIFICATES})
156
+ string(
157
+ REGEX MATCH
158
+ "[ \t\r\n]*([^=\n]+)[ \t\r\n]*=+\n(-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----)"
159
+ PARTS
160
+ ${CERTIFICATE})
161
+ file(APPEND ${CA_BUNDLE_CPP_FILE} " { R\"(${CMAKE_MATCH_1})\",\n R\"(${CMAKE_MATCH_2})\" },\n\n")
162
+ endforeach()
163
+
164
+ file(
165
+ APPEND ${CA_BUNDLE_CPP_FILE}
166
+ " { \"\", \"\" },
167
+ };
168
+
169
+ auto
170
+ mozilla_ca_certs() -> gsl::span<const certificate>
171
+ {
172
+ return { certificates, number_of_certificates };
173
+ }
174
+
175
+ auto
176
+ mozilla_ca_certs_date() -> std::string_view
177
+ {
178
+ return \"${COUCHBASE_CXX_CLIENT_MOZILLA_CA_BUNDLE_DATE}\";
179
+ }
180
+
181
+ auto
182
+ mozilla_ca_certs_sha256() -> std::string_view
183
+ {
184
+ return \"${COUCHBASE_CXX_CLIENT_MOZILLA_CA_BUNDLE_SHA256}\";
185
+ }
186
+ } // namespace couchbase::core::default_ca
187
+ ")
@@ -25,6 +25,8 @@ macro(integration_test name)
25
25
  catch_discover_tests(
26
26
  test_integration_${name}
27
27
  PROPERTIES
28
+ SKIP_REGULAR_EXPRESSION
29
+ "SKIP"
28
30
  LABELS
29
31
  "integration")
30
32
  set_property(GLOBAL APPEND PROPERTY COUCHBASE_INTEGRATION_TESTS "test_integration_${name}")
@@ -52,6 +54,8 @@ macro(transaction_test name)
52
54
  catch_discover_tests(
53
55
  test_transaction_${name}
54
56
  PROPERTIES
57
+ SKIP_REGULAR_EXPRESSION
58
+ "SKIP"
55
59
  LABELS
56
60
  "transaction")
57
61
  set_property(GLOBAL APPEND PROPERTY COUCHBASE_TRANSACTION_TESTS "test_transaction_${name}")
@@ -78,6 +82,8 @@ macro(unit_test name)
78
82
  catch_discover_tests(
79
83
  test_unit_${name}
80
84
  PROPERTIES
85
+ SKIP_REGULAR_EXPRESSION
86
+ "SKIP"
81
87
  LABELS
82
88
  "unit")
83
89
  set_property(GLOBAL APPEND PROPERTY COUCHBASE_UNIT_TESTS "test_unit_${name}")
@@ -104,6 +110,8 @@ macro(integration_benchmark name)
104
110
  catch_discover_tests(
105
111
  benchmark_integration_${name}
106
112
  PROPERTIES
113
+ SKIP_REGULAR_EXPRESSION
114
+ "SKIP"
107
115
  LABELS
108
116
  "benchmark")
109
117
  set_property(GLOBAL APPEND PROPERTY COUCHBASE_BENCHMARKS "benchmark_integration_${name}")
@@ -18,3 +18,6 @@
18
18
  #pragma once
19
19
 
20
20
  #cmakedefine TLS_KEY_LOG_FILE "@TLS_KEY_LOG_FILE@"
21
+ #cmakedefine COUCHBASE_CXX_CLIENT_EMBED_MOZILLA_CA_BUNDLE
22
+ #cmakedefine COUCHBASE_CXX_CLIENT_MOZILLA_CA_BUNDLE_DATE "@COUCHBASE_CXX_CLIENT_MOZILLA_CA_BUNDLE_DATE@"
23
+ #cmakedefine COUCHBASE_CXX_CLIENT_MOZILLA_CA_BUNDLE_SHA256 "@COUCHBASE_CXX_CLIENT_MOZILLA_CA_BUNDLE_SHA256@"