aws_advanced_ruby_driver_wrapper 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +23 -0
  3. data/LICENSE +175 -0
  4. data/NOTICE +1 -0
  5. data/README.md +168 -0
  6. data/THIRD-PARTY-LICENSES +473 -0
  7. data/aws_advanced_ruby_driver_wrapper.gemspec +73 -0
  8. data/lib/aws_advanced_ruby_driver_wrapper/active_record/aws_mysql2_adapter.rb +73 -0
  9. data/lib/aws_advanced_ruby_driver_wrapper/active_record/aws_postgresql_adapter.rb +95 -0
  10. data/lib/aws_advanced_ruby_driver_wrapper/custom_configuration.rb +58 -0
  11. data/lib/aws_advanced_ruby_driver_wrapper/db_dialects/aurora_mysql_dialect.rb +103 -0
  12. data/lib/aws_advanced_ruby_driver_wrapper/db_dialects/aurora_pg_dialect.rb +124 -0
  13. data/lib/aws_advanced_ruby_driver_wrapper/db_dialects/dialect_codes.rb +38 -0
  14. data/lib/aws_advanced_ruby_driver_wrapper/db_dialects/global_mysql_dialect.rb +91 -0
  15. data/lib/aws_advanced_ruby_driver_wrapper/db_dialects/global_pg_dialect.rb +92 -0
  16. data/lib/aws_advanced_ruby_driver_wrapper/db_dialects/multi_az_cluster_mysql_dialect.rb +95 -0
  17. data/lib/aws_advanced_ruby_driver_wrapper/db_dialects/multi_az_cluster_pg_dialect.rb +86 -0
  18. data/lib/aws_advanced_ruby_driver_wrapper/db_dialects/mysql_dialect.rb +98 -0
  19. data/lib/aws_advanced_ruby_driver_wrapper/db_dialects/pg_dialect.rb +95 -0
  20. data/lib/aws_advanced_ruby_driver_wrapper/db_dialects/rds_mysql_dialect.rb +88 -0
  21. data/lib/aws_advanced_ruby_driver_wrapper/db_dialects/rds_pg_dialect.rb +86 -0
  22. data/lib/aws_advanced_ruby_driver_wrapper/db_dialects/unknown_dialect.rb +72 -0
  23. data/lib/aws_advanced_ruby_driver_wrapper/db_dialects/utils/dialect_utils.rb +71 -0
  24. data/lib/aws_advanced_ruby_driver_wrapper/driver_dialects/driver_dialect.rb +154 -0
  25. data/lib/aws_advanced_ruby_driver_wrapper/driver_dialects/driver_dialect_manager.rb +55 -0
  26. data/lib/aws_advanced_ruby_driver_wrapper/driver_dialects/mysql_driver_dialect.rb +165 -0
  27. data/lib/aws_advanced_ruby_driver_wrapper/driver_dialects/pg_driver_dialect.rb +201 -0
  28. data/lib/aws_advanced_ruby_driver_wrapper/errors/error_handler.rb +62 -0
  29. data/lib/aws_advanced_ruby_driver_wrapper/errors/mysql_error_handler.rb +80 -0
  30. data/lib/aws_advanced_ruby_driver_wrapper/errors/pg_error_handler.rb +126 -0
  31. data/lib/aws_advanced_ruby_driver_wrapper/errors.rb +59 -0
  32. data/lib/aws_advanced_ruby_driver_wrapper/host/connection_string_host_list_provider.rb +95 -0
  33. data/lib/aws_advanced_ruby_driver_wrapper/host/global_aurora_host_list_provider.rb +65 -0
  34. data/lib/aws_advanced_ruby_driver_wrapper/host/host_availability.rb +24 -0
  35. data/lib/aws_advanced_ruby_driver_wrapper/host/host_availability_strategy.rb +27 -0
  36. data/lib/aws_advanced_ruby_driver_wrapper/host/host_info.rb +137 -0
  37. data/lib/aws_advanced_ruby_driver_wrapper/host/host_role.rb +25 -0
  38. data/lib/aws_advanced_ruby_driver_wrapper/host/random_host_selector.rb +40 -0
  39. data/lib/aws_advanced_ruby_driver_wrapper/host/rds_host_list_provider.rb +206 -0
  40. data/lib/aws_advanced_ruby_driver_wrapper/logging.rb +110 -0
  41. data/lib/aws_advanced_ruby_driver_wrapper/monitoring/cluster_topology_monitor.rb +709 -0
  42. data/lib/aws_advanced_ruby_driver_wrapper/monitoring/global_cluster_topology_monitor.rb +72 -0
  43. data/lib/aws_advanced_ruby_driver_wrapper/monitoring/monitor.rb +99 -0
  44. data/lib/aws_advanced_ruby_driver_wrapper/monitoring/monitor_connection.rb +57 -0
  45. data/lib/aws_advanced_ruby_driver_wrapper/monitoring/monitor_state.rb +25 -0
  46. data/lib/aws_advanced_ruby_driver_wrapper/mysql.rb +429 -0
  47. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/blue_green_plugin.rb +205 -0
  48. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/host_mapper.rb +132 -0
  49. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/iam_host_tracker.rb +84 -0
  50. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/interim_status.rb +92 -0
  51. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/interval_rate.rb +27 -0
  52. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/phase.rb +69 -0
  53. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/phase_event_log.rb +85 -0
  54. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/phase_time_info.rb +25 -0
  55. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/role.rb +38 -0
  56. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/routing/base_routing.rb +83 -0
  57. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/routing/reject_connect_routing.rb +40 -0
  58. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/routing/substitute_connect_routing.rb +136 -0
  59. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/routing/suspend_connect_routing.rb +53 -0
  60. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/routing/suspend_execute_routing.rb +52 -0
  61. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/routing/suspend_until_corresponding_host_found_connect_routing.rb +83 -0
  62. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/status.rb +68 -0
  63. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/status_builder.rb +244 -0
  64. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/status_info.rb +30 -0
  65. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/status_monitor.rb +564 -0
  66. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/status_provider.rb +414 -0
  67. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/switchover_state.rb +98 -0
  68. data/lib/aws_advanced_ruby_driver_wrapper/plugins/blue_green/switchover_timer.rb +46 -0
  69. data/lib/aws_advanced_ruby_driver_wrapper/plugins/custom_endpoint/custom_endpoint_monitor.rb +266 -0
  70. data/lib/aws_advanced_ruby_driver_wrapper/plugins/custom_endpoint/custom_endpoint_plugin.rb +158 -0
  71. data/lib/aws_advanced_ruby_driver_wrapper/plugins/custom_endpoint/info.rb +111 -0
  72. data/lib/aws_advanced_ruby_driver_wrapper/plugins/custom_endpoint/member_list_type.rb +31 -0
  73. data/lib/aws_advanced_ruby_driver_wrapper/plugins/custom_endpoint/role.rb +45 -0
  74. data/lib/aws_advanced_ruby_driver_wrapper/plugins/default_plugin.rb +108 -0
  75. data/lib/aws_advanced_ruby_driver_wrapper/plugins/failover_mode.rb +43 -0
  76. data/lib/aws_advanced_ruby_driver_wrapper/plugins/failover_plugin.rb +467 -0
  77. data/lib/aws_advanced_ruby_driver_wrapper/plugins/gdb/gdb_failover_mode.rb +68 -0
  78. data/lib/aws_advanced_ruby_driver_wrapper/plugins/gdb/gdb_failover_plugin.rb +403 -0
  79. data/lib/aws_advanced_ruby_driver_wrapper/plugins/iam_auth_plugin.rb +159 -0
  80. data/lib/aws_advanced_ruby_driver_wrapper/plugins/initial_connection_strategy_plugin.rb +485 -0
  81. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/audit_logger.rb +157 -0
  82. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/column_cipher.rb +159 -0
  83. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/column_encryption_config.rb +61 -0
  84. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/connection_source.rb +91 -0
  85. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/data_key_cache.rb +220 -0
  86. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/encryption_algorithm.rb +75 -0
  87. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/encryption_config.rb +146 -0
  88. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/encryption_service.rb +391 -0
  89. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/error_context.rb +198 -0
  90. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/errors.rb +259 -0
  91. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/key_management_utility.rb +435 -0
  92. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/key_manager.rb +378 -0
  93. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/key_metadata.rb +86 -0
  94. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/kms_encryption_plugin.rb +890 -0
  95. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/kms_encryption_utility.rb +281 -0
  96. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/metadata_manager.rb +332 -0
  97. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/sanitizer.rb +147 -0
  98. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/schema_name.rb +70 -0
  99. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/schema_validator.rb +211 -0
  100. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/sql_runner.rb +147 -0
  101. data/lib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/type_marker.rb +109 -0
  102. data/lib/aws_advanced_ruby_driver_wrapper/plugins/secrets_manager_plugin.rb +358 -0
  103. data/lib/aws_advanced_ruby_driver_wrapper/postgresql.rb +659 -0
  104. data/lib/aws_advanced_ruby_driver_wrapper/property_definition.rb +409 -0
  105. data/lib/aws_advanced_ruby_driver_wrapper/ruby_method.rb +122 -0
  106. data/lib/aws_advanced_ruby_driver_wrapper/services/connection_service.rb +143 -0
  107. data/lib/aws_advanced_ruby_driver_wrapper/services/dialect_service.rb +267 -0
  108. data/lib/aws_advanced_ruby_driver_wrapper/services/host_service.rb +199 -0
  109. data/lib/aws_advanced_ruby_driver_wrapper/services/monitor_service.rb +186 -0
  110. data/lib/aws_advanced_ruby_driver_wrapper/services/plugin_call_context.rb +63 -0
  111. data/lib/aws_advanced_ruby_driver_wrapper/services/plugin_manager.rb +273 -0
  112. data/lib/aws_advanced_ruby_driver_wrapper/services/service_container.rb +30 -0
  113. data/lib/aws_advanced_ruby_driver_wrapper/services/service_utility.rb +78 -0
  114. data/lib/aws_advanced_ruby_driver_wrapper/services/session_state_service.rb +56 -0
  115. data/lib/aws_advanced_ruby_driver_wrapper/utils/accessible_regions.rb +52 -0
  116. data/lib/aws_advanced_ruby_driver_wrapper/utils/ar_constants.rb +25 -0
  117. data/lib/aws_advanced_ruby_driver_wrapper/utils/aurora_topology_utils.rb +99 -0
  118. data/lib/aws_advanced_ruby_driver_wrapper/utils/aws_credentials_utils.rb +62 -0
  119. data/lib/aws_advanced_ruby_driver_wrapper/utils/connection_config.rb +91 -0
  120. data/lib/aws_advanced_ruby_driver_wrapper/utils/connection_config_parser.rb +368 -0
  121. data/lib/aws_advanced_ruby_driver_wrapper/utils/conversion_utils.rb +51 -0
  122. data/lib/aws_advanced_ruby_driver_wrapper/utils/events/batching_event_publisher.rb +119 -0
  123. data/lib/aws_advanced_ruby_driver_wrapper/utils/events/data_access_event.rb +26 -0
  124. data/lib/aws_advanced_ruby_driver_wrapper/utils/events/monitor_reset_event.rb +26 -0
  125. data/lib/aws_advanced_ruby_driver_wrapper/utils/global_aurora_topology_utils.rb +185 -0
  126. data/lib/aws_advanced_ruby_driver_wrapper/utils/host_list_utils.rb +27 -0
  127. data/lib/aws_advanced_ruby_driver_wrapper/utils/iam_auth_utils.rb +112 -0
  128. data/lib/aws_advanced_ruby_driver_wrapper/utils/multi_az_topology_utils.rb +117 -0
  129. data/lib/aws_advanced_ruby_driver_wrapper/utils/parser/encryption_annotation_parser.rb +99 -0
  130. data/lib/aws_advanced_ruby_driver_wrapper/utils/parser/mysql_statement_analyzer.rb +641 -0
  131. data/lib/aws_advanced_ruby_driver_wrapper/utils/parser/pg_statement_analyzer.rb +502 -0
  132. data/lib/aws_advanced_ruby_driver_wrapper/utils/parser/query_analysis.rb +63 -0
  133. data/lib/aws_advanced_ruby_driver_wrapper/utils/parser/query_type.rb +35 -0
  134. data/lib/aws_advanced_ruby_driver_wrapper/utils/parser/routing_hint.rb +27 -0
  135. data/lib/aws_advanced_ruby_driver_wrapper/utils/parser/routing_hint_parser.rb +50 -0
  136. data/lib/aws_advanced_ruby_driver_wrapper/utils/parser/sql_parser.rb +139 -0
  137. data/lib/aws_advanced_ruby_driver_wrapper/utils/rds_url_type.rb +71 -0
  138. data/lib/aws_advanced_ruby_driver_wrapper/utils/rds_utils.rb +575 -0
  139. data/lib/aws_advanced_ruby_driver_wrapper/utils/retry_util.rb +153 -0
  140. data/lib/aws_advanced_ruby_driver_wrapper/utils/sql_encoding.rb +56 -0
  141. data/lib/aws_advanced_ruby_driver_wrapper/utils/sql_method_analyzer.rb +195 -0
  142. data/lib/aws_advanced_ruby_driver_wrapper/utils/storage/cache_entry.rb +56 -0
  143. data/lib/aws_advanced_ruby_driver_wrapper/utils/storage/expiration_cache.rb +108 -0
  144. data/lib/aws_advanced_ruby_driver_wrapper/utils/storage/sliding_expiration_cache.rb +137 -0
  145. data/lib/aws_advanced_ruby_driver_wrapper/utils/storage/storage_service.rb +172 -0
  146. data/lib/aws_advanced_ruby_driver_wrapper/utils/topology_utils.rb +127 -0
  147. data/lib/aws_advanced_ruby_driver_wrapper/version.rb +19 -0
  148. data/lib/aws_advanced_ruby_driver_wrapper/wrapper_property.rb +64 -0
  149. data/lib/aws_advanced_ruby_driver_wrapper.rb +116 -0
  150. metadata +227 -0
@@ -0,0 +1,473 @@
1
+ The AWS Advanced Ruby Driver Wrapper includes, or depends at runtime on, the
2
+ following third-party software. The applicable licenses and notices are
3
+ reproduced below. Each dependency remains under its own license; nothing in
4
+ this file modifies those terms.
5
+
6
+ The underlying database drivers (pg, mysql2), ActiveRecord, pg_query, and the
7
+ AWS SDK gems are optional dependencies that are installed by the user as needed;
8
+ they are listed here because the wrapper is designed to load and run on top of
9
+ them.
10
+
11
+ ===============================================================================
12
+
13
+ The following Ruby gem is a required runtime dependency of this product:
14
+
15
+ - concurrent-ruby@1.3.8
16
+
17
+ This package contains the following license and notice below:
18
+
19
+ Copyright (c) Jerry D'Antonio -- released under the MIT license.
20
+
21
+ http://www.opensource.org/licenses/mit-license.php
22
+
23
+ Permission is hereby granted, free of charge, to any person obtaining a copy
24
+ of this software and associated documentation files (the "Software"), to deal
25
+ in the Software without restriction, including without limitation the rights
26
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27
+ copies of the Software, and to permit persons to whom the Software is
28
+ furnished to do so, subject to the following conditions:
29
+
30
+ The above copyright notice and this permission notice shall be included in all
31
+ copies or substantial portions of the Software.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39
+ SOFTWARE.
40
+
41
+ -----------
42
+
43
+ The following Ruby gem may be used with this product (ActiveRecord adapters):
44
+
45
+ - activerecord@8.1.4
46
+
47
+ This package contains the following license and notice below:
48
+
49
+ Copyright (c) David Heinemeier Hansson
50
+
51
+ Arel originally copyright (c) 2007-2016 Nick Kallen, Bryan Helmkamp, Emilio Tagua, Aaron Patterson
52
+
53
+ Permission is hereby granted, free of charge, to any person obtaining
54
+ a copy of this software and associated documentation files (the
55
+ "Software"), to deal in the Software without restriction, including
56
+ without limitation the rights to use, copy, modify, merge, publish,
57
+ distribute, sublicense, and/or sell copies of the Software, and to
58
+ permit persons to whom the Software is furnished to do so, subject to
59
+ the following conditions:
60
+
61
+ The above copyright notice and this permission notice shall be
62
+ included in all copies or substantial portions of the Software.
63
+
64
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
65
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
66
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
67
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
68
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
69
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
70
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
71
+
72
+ -----------
73
+
74
+ The following Ruby gem may be used with this product (ActiveRecord adapter
75
+ registration):
76
+
77
+ - activesupport@8.1.4
78
+
79
+ This package contains the following license and notice below:
80
+
81
+ Copyright (c) David Heinemeier Hansson
82
+
83
+ Permission is hereby granted, free of charge, to any person obtaining
84
+ a copy of this software and associated documentation files (the
85
+ "Software"), to deal in the Software without restriction, including
86
+ without limitation the rights to use, copy, modify, merge, publish,
87
+ distribute, sublicense, and/or sell copies of the Software, and to
88
+ permit persons to whom the Software is furnished to do so, subject to
89
+ the following conditions:
90
+
91
+ The above copyright notice and this permission notice shall be
92
+ included in all copies or substantial portions of the Software.
93
+
94
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
95
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
96
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
97
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
98
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
99
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
100
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
101
+
102
+ -----------
103
+
104
+ The following Ruby gem may be used with this product (MySQL driver):
105
+
106
+ - mysql2@0.5.7
107
+
108
+ This package contains the following license and notice below:
109
+
110
+ The MIT License (MIT)
111
+
112
+ Copyright (c) 2014 Brian Lopez
113
+
114
+ Permission is hereby granted, free of charge, to any person obtaining a copy
115
+ of this software and associated documentation files (the "Software"), to deal
116
+ in the Software without restriction, including without limitation the rights
117
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
118
+ copies of the Software, and to permit persons to whom the Software is
119
+ furnished to do so, subject to the following conditions:
120
+
121
+ The above copyright notice and this permission notice shall be included in all
122
+ copies or substantial portions of the Software.
123
+
124
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
125
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
126
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
127
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
128
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
129
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
130
+ SOFTWARE.
131
+
132
+ -----------
133
+
134
+ The following Ruby gem may be used with this product (PostgreSQL driver):
135
+
136
+ - pg@1.6.3
137
+
138
+ This package contains the following license and notice below:
139
+
140
+ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
141
+ You can redistribute it and/or modify it under either the terms of the
142
+ 2-clause BSDL (see the file BSDL), or the conditions below:
143
+
144
+ 1. You may make and give away verbatim copies of the source form of the
145
+ software without restriction, provided that you duplicate all of the
146
+ original copyright notices and associated disclaimers.
147
+
148
+ 2. You may modify your copy of the software in any way, provided that
149
+ you do at least ONE of the following:
150
+
151
+ a) place your modifications in the Public Domain or otherwise
152
+ make them Freely Available, such as by posting said
153
+ modifications to Usenet or an equivalent medium, or by allowing
154
+ the author to include your modifications in the software.
155
+
156
+ b) use the modified software only within your corporation or
157
+ organization.
158
+
159
+ c) give non-standard binaries non-standard names, with
160
+ instructions on where to get the original software distribution.
161
+
162
+ d) make other distribution arrangements with the author.
163
+
164
+ 3. You may distribute the software in object code or binary form,
165
+ provided that you do at least ONE of the following:
166
+
167
+ a) distribute the binaries and library files of the software,
168
+ together with instructions (in the manual page or equivalent)
169
+ on where to get the original distribution.
170
+
171
+ b) accompany the distribution with the machine-readable source of
172
+ the software.
173
+
174
+ c) give non-standard binaries non-standard names, with
175
+ instructions on where to get the original software distribution.
176
+
177
+ d) make other distribution arrangements with the author.
178
+
179
+ 4. You may modify and include the part of the software into any other
180
+ software (possibly commercial). But some files in the distribution
181
+ are not written by the author, so that they are not under these terms.
182
+
183
+ For the list of those files and their copying conditions, see the
184
+ file LEGAL.
185
+
186
+ 5. The scripts and library files supplied as input to or produced as
187
+ output from the software do not automatically fall under the
188
+ copyright of the software, but belong to whomever generated them,
189
+ and may be sold commercially, and may be aggregated with this
190
+ software.
191
+
192
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
193
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
194
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
195
+ PURPOSE.
196
+
197
+ The 2-clause BSDL referenced above (file BSDL):
198
+
199
+ Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
200
+
201
+ Redistribution and use in source and binary forms, with or without
202
+ modification, are permitted provided that the following conditions
203
+ are met:
204
+ 1. Redistributions of source code must retain the above copyright
205
+ notice, this list of conditions and the following disclaimer.
206
+ 2. Redistributions in binary form must reproduce the above copyright
207
+ notice, this list of conditions and the following disclaimer in the
208
+ documentation and/or other materials provided with the distribution.
209
+
210
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
211
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
212
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
213
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
214
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
215
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
216
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
217
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
218
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
219
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
220
+ SUCH DAMAGE.
221
+
222
+ -----------
223
+
224
+ The following Ruby gem may be used with this product (SQL statement parsing
225
+ for the KMS Encryption plugin):
226
+
227
+ - pg_query@6.2.3
228
+
229
+ This package contains the following license and notice below:
230
+
231
+ Copyright (c) 2014, pganalyze Team <team@pganalyze.com>
232
+ All rights reserved.
233
+
234
+ Redistribution and use in source and binary forms, with or without
235
+ modification, are permitted provided that the following conditions are met:
236
+
237
+ * Redistributions of source code must retain the above copyright notice, this
238
+ list of conditions and the following disclaimer.
239
+
240
+ * Redistributions in binary form must reproduce the above copyright notice,
241
+ this list of conditions and the following disclaimer in the documentation
242
+ and/or other materials provided with the distribution.
243
+
244
+ * Neither the name of pganalyze nor the names of its contributors may be used
245
+ to endorse or promote products derived from this software without specific
246
+ prior written permission.
247
+
248
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
249
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
250
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
251
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
252
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
253
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
254
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
255
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
256
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
257
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
258
+ POSSIBILITY OF SUCH DAMAGE.
259
+
260
+ -----------
261
+
262
+ The following AWS SDK for Ruby gems may be used with this product (AWS IAM
263
+ Authentication, AWS Secrets Manager, Custom Endpoint, and KMS Encryption
264
+ plugins):
265
+
266
+ - aws-sdk-kms@1.132.0
267
+ - aws-sdk-rds@1.323.0
268
+ - aws-sdk-secretsmanager@1.136.0
269
+
270
+ These packages are each licensed under the Apache License, Version 2.0,
271
+ reproduced below:
272
+
273
+ Apache License
274
+ Version 2.0, January 2004
275
+ http://www.apache.org/licenses/
276
+
277
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
278
+
279
+ 1. Definitions.
280
+
281
+ "License" shall mean the terms and conditions for use, reproduction,
282
+ and distribution as defined by Sections 1 through 9 of this document.
283
+
284
+ "Licensor" shall mean the copyright owner or entity authorized by
285
+ the copyright owner that is granting the License.
286
+
287
+ "Legal Entity" shall mean the union of the acting entity and all
288
+ other entities that control, are controlled by, or are under common
289
+ control with that entity. For the purposes of this definition,
290
+ "control" means (i) the power, direct or indirect, to cause the
291
+ direction or management of such entity, whether by contract or
292
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
293
+ outstanding shares, or (iii) beneficial ownership of such entity.
294
+
295
+ "You" (or "Your") shall mean an individual or Legal Entity
296
+ exercising permissions granted by this License.
297
+
298
+ "Source" form shall mean the preferred form for making modifications,
299
+ including but not limited to software source code, documentation
300
+ source, and configuration files.
301
+
302
+ "Object" form shall mean any form resulting from mechanical
303
+ transformation or translation of a Source form, including but
304
+ not limited to compiled object code, generated documentation,
305
+ and conversions to other media types.
306
+
307
+ "Work" shall mean the work of authorship, whether in Source or
308
+ Object form, made available under the License, as indicated by a
309
+ copyright notice that is included in or attached to the work
310
+ (an example is provided in the Appendix below).
311
+
312
+ "Derivative Works" shall mean any work, whether in Source or Object
313
+ form, that is based on (or derived from) the Work and for which the
314
+ editorial revisions, annotations, elaborations, or other modifications
315
+ represent, as a whole, an original work of authorship. For the purposes
316
+ of this License, Derivative Works shall not include works that remain
317
+ separable from, or merely link (or bind by name) to the interfaces of,
318
+ the Work and Derivative Works thereof.
319
+
320
+ "Contribution" shall mean any work of authorship, including
321
+ the original version of the Work and any modifications or additions
322
+ to that Work or Derivative Works thereof, that is intentionally
323
+ submitted to Licensor for inclusion in the Work by the copyright owner
324
+ or by an individual or Legal Entity authorized to submit on behalf of
325
+ the copyright owner. For the purposes of this definition, "submitted"
326
+ means any form of electronic, verbal, or written communication sent
327
+ to the Licensor or its representatives, including but not limited to
328
+ communication on electronic mailing lists, source code control systems,
329
+ and issue tracking systems that are managed by, or on behalf of, the
330
+ Licensor for the purpose of discussing and improving the Work, but
331
+ excluding communication that is conspicuously marked or otherwise
332
+ designated in writing by the copyright owner as "Not a Contribution."
333
+
334
+ "Contributor" shall mean Licensor and any individual or Legal Entity
335
+ on behalf of whom a Contribution has been received by Licensor and
336
+ subsequently incorporated within the Work.
337
+
338
+ 2. Grant of Copyright License. Subject to the terms and conditions of
339
+ this License, each Contributor hereby grants to You a perpetual,
340
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
341
+ copyright license to reproduce, prepare Derivative Works of,
342
+ publicly display, publicly perform, sublicense, and distribute the
343
+ Work and such Derivative Works in Source or Object form.
344
+
345
+ 3. Grant of Patent License. Subject to the terms and conditions of
346
+ this License, each Contributor hereby grants to You a perpetual,
347
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
348
+ (except as stated in this section) patent license to make, have made,
349
+ use, offer to sell, sell, import, and otherwise transfer the Work,
350
+ where such license applies only to those patent claims licensable
351
+ by such Contributor that are necessarily infringed by their
352
+ Contribution(s) alone or by combination of their Contribution(s)
353
+ with the Work to which such Contribution(s) was submitted. If You
354
+ institute patent litigation against any entity (including a
355
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
356
+ or a Contribution incorporated within the Work constitutes direct
357
+ or contributory patent infringement, then any patent licenses
358
+ granted to You under this License for that Work shall terminate
359
+ as of the date such litigation is filed.
360
+
361
+ 4. Redistribution. You may reproduce and distribute copies of the
362
+ Work or Derivative Works thereof in any medium, with or without
363
+ modifications, and in Source or Object form, provided that You
364
+ meet the following conditions:
365
+
366
+ (a) You must give any other recipients of the Work or
367
+ Derivative Works a copy of this License; and
368
+
369
+ (b) You must cause any modified files to carry prominent notices
370
+ stating that You changed the files; and
371
+
372
+ (c) You must retain, in the Source form of any Derivative Works
373
+ that You distribute, all copyright, patent, trademark, and
374
+ attribution notices from the Source form of the Work,
375
+ excluding those notices that do not pertain to any part of
376
+ the Derivative Works; and
377
+
378
+ (d) If the Work includes a "NOTICE" text file as part of its
379
+ distribution, then any Derivative Works that You distribute must
380
+ include a readable copy of the attribution notices contained
381
+ within such NOTICE file, excluding those notices that do not
382
+ pertain to any part of the Derivative Works, in at least one
383
+ of the following places: within a NOTICE text file distributed
384
+ as part of the Derivative Works; within the Source form or
385
+ documentation, if provided along with the Derivative Works; or,
386
+ within a display generated by the Derivative Works, if and
387
+ wherever such third-party notices normally appear. The contents
388
+ of the NOTICE file are for informational purposes only and
389
+ do not modify the License. You may add Your own attribution
390
+ notices within Derivative Works that You distribute, alongside
391
+ or as an addendum to the NOTICE text from the Work, provided
392
+ that such additional attribution notices cannot be construed
393
+ as modifying the License.
394
+
395
+ You may add Your own copyright statement to Your modifications and
396
+ may provide additional or different license terms and conditions
397
+ for use, reproduction, or distribution of Your modifications, or
398
+ for any such Derivative Works as a whole, provided Your use,
399
+ reproduction, and distribution of the Work otherwise complies with
400
+ the conditions stated in this License.
401
+
402
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
403
+ any Contribution intentionally submitted for inclusion in the Work
404
+ by You to the Licensor shall be under the terms and conditions of
405
+ this License, without any additional terms or conditions.
406
+ Notwithstanding the above, nothing herein shall supersede or modify
407
+ the terms of any separate license agreement you may have executed
408
+ with Licensor regarding such Contributions.
409
+
410
+ 6. Trademarks. This License does not grant permission to use the trade
411
+ names, trademarks, service marks, or product names of the Licensor,
412
+ except as required for reasonable and customary use in describing the
413
+ origin of the Work and reproducing the content of the NOTICE file.
414
+
415
+ 7. Disclaimer of Warranty. Unless required by applicable law or
416
+ agreed to in writing, Licensor provides the Work (and each
417
+ Contributor provides its Contributions) on an "AS IS" BASIS,
418
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
419
+ implied, including, without limitation, any warranties or conditions
420
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
421
+ PARTICULAR PURPOSE. You are solely responsible for determining the
422
+ appropriateness of using or redistributing the Work and assume any
423
+ risks associated with Your exercise of permissions under this License.
424
+
425
+ 8. Limitation of Liability. In no event and under no legal theory,
426
+ whether in tort (including negligence), contract, or otherwise,
427
+ unless required by applicable law (such as deliberate and grossly
428
+ negligent acts) or agreed to in writing, shall any Contributor be
429
+ liable to You for damages, including any direct, indirect, special,
430
+ incidental, or consequential damages of any character arising as a
431
+ result of this License or out of the use or inability to use the
432
+ Work (including but not limited to damages for loss of goodwill,
433
+ work stoppage, computer failure or malfunction, or any and all
434
+ other commercial damages or losses), even if such Contributor
435
+ has been advised of the possibility of such damages.
436
+
437
+ 9. Accepting Warranty or Additional Liability. While redistributing
438
+ the Work or Derivative Works thereof, You may choose to offer,
439
+ and charge a fee for, acceptance of support, warranty, indemnity,
440
+ or other liability obligations and/or rights consistent with this
441
+ License. However, in accepting such obligations, You may act only
442
+ on Your own behalf and on Your sole responsibility, not on behalf
443
+ of any other Contributor, and only if You agree to indemnify,
444
+ defend, and hold each Contributor harmless for any liability
445
+ incurred by, or claims asserted against, such Contributor by reason
446
+ of your accepting any such warranty or additional liability.
447
+
448
+ END OF TERMS AND CONDITIONS
449
+
450
+ APPENDIX: How to apply the Apache License to your work.
451
+
452
+ To apply the Apache License to your work, attach the following
453
+ boilerplate notice, with the fields enclosed by brackets "[]"
454
+ replaced with your own identifying information. (Don't include
455
+ the brackets!) The text should be enclosed in the appropriate
456
+ comment syntax for the file format. We also recommend that a
457
+ file or class name and description of purpose be included on the
458
+ same "printed page" as the copyright notice for easier
459
+ identification within third-party archives.
460
+
461
+ Copyright [yyyy] [name of copyright owner]
462
+
463
+ Licensed under the Apache License, Version 2.0 (the "License");
464
+ you may not use this file except in compliance with the License.
465
+ You may obtain a copy of the License at
466
+
467
+ http://www.apache.org/licenses/LICENSE-2.0
468
+
469
+ Unless required by applicable law or agreed to in writing, software
470
+ distributed under the License is distributed on an "AS IS" BASIS,
471
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
472
+ See the License for the specific language governing permissions and
473
+ limitations under the License.
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License").
6
+ # You may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require_relative 'lib/aws_advanced_ruby_driver_wrapper/version'
18
+
19
+ Gem::Specification.new do |spec|
20
+ spec.name = 'aws_advanced_ruby_driver_wrapper'
21
+ spec.version = AwsAdvancedRubyDriverWrapper::VERSION
22
+ spec.authors = ['Amazon Web Services']
23
+
24
+ spec.summary = 'AWS Advanced Ruby Driver Wrapper for MySQL and PostgreSQL'
25
+ spec.description = 'A Ruby DB driver wrapper that provides enhanced features for AWS RDS MySQL/PostgreSQL databases'
26
+ spec.homepage = 'https://github.com/aws/aws-advanced-ruby-driver-wrapper'
27
+ spec.license = 'Apache-2.0'
28
+ spec.required_ruby_version = '>= 3.3.0'
29
+
30
+ spec.metadata['source_code_uri'] = 'https://github.com/aws/aws-advanced-ruby-driver-wrapper'
31
+ spec.metadata['changelog_uri'] = 'https://github.com/aws/aws-advanced-ruby-driver-wrapper/blob/main/CHANGELOG.md'
32
+ spec.metadata['rubygems_mfa_required'] = 'true'
33
+
34
+ # Specify which files ship in the released gem via an explicit allow-list: the
35
+ # runtime library plus the top-level legal/informational files. An allow-list is
36
+ # used deliberately so packaging never depends on git being present and can never
37
+ # sweep up unrelated files that happen to sit in the build directory (local
38
+ # credentials, logs, editor state, previously built gems, etc.).
39
+ spec.files = Dir.chdir(__dir__) do
40
+ root_files = %w[
41
+ LICENSE
42
+ NOTICE
43
+ THIRD-PARTY-LICENSES
44
+ README.md
45
+ CHANGELOG.md
46
+ aws_advanced_ruby_driver_wrapper.gemspec
47
+ ]
48
+
49
+ Dir.glob('lib/**/*', File::FNM_DOTMATCH).reject { |f| File.directory?(f) } +
50
+ root_files.select { |f| File.file?(f) }
51
+ end
52
+ spec.bindir = 'exe'
53
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
54
+ spec.require_paths = ['lib']
55
+
56
+ spec.add_dependency 'concurrent-ruby', '~> 1.3', '>= 1.3.7'
57
+
58
+ spec.post_install_message = <<~MSG
59
+ ═══════════════════════════════════════════════════════════════
60
+ AWS Advanced Ruby Driver Wrapper installed successfully!
61
+
62
+ To use with MySQL:
63
+ gem install mysql2
64
+ require 'aws_advanced_ruby_driver_wrapper/mysql'
65
+
66
+ To use with PostgreSQL:
67
+ gem install pg
68
+ require 'aws_advanced_ruby_driver_wrapper/postgresql'
69
+
70
+ Documentation: github.com/aws/aws-advanced-ruby-driver-wrapper
71
+ ═══════════════════════════════════════════════════════════════
72
+ MSG
73
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License").
6
+ # You may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require 'active_record/connection_adapters/mysql2_adapter'
18
+ require_relative '../mysql'
19
+ require_relative '../errors'
20
+ require_relative '../utils/ar_constants'
21
+
22
+ module ActiveRecord
23
+ module ConnectionAdapters
24
+ class AwsMysql2Adapter < Mysql2Adapter
25
+ ADAPTER_NAME = 'AwsMySQL2'
26
+
27
+ # ActiveRecord-only keys that should not be passed to the wrapper or native driver.
28
+ AR_ONLY_KEYS = AwsAdvancedRubyDriverWrapper::Utils::AR_COMMON_KEYS
29
+
30
+ def adapter_name = ADAPTER_NAME
31
+
32
+ def self.new_client(config)
33
+ AwsAdvancedRubyDriverWrapper::WrapperMysql2Client.new(**config.except(*AR_ONLY_KEYS))
34
+ end
35
+
36
+ def connect
37
+ @connection_broken = false
38
+ super
39
+ end
40
+
41
+ def reconnect
42
+ @connection_broken = false
43
+ super
44
+ end
45
+
46
+ def active?
47
+ return false if @connection_broken
48
+
49
+ super
50
+ end
51
+
52
+ def translate_exception(exception, message:, sql:, binds:)
53
+ return super unless exception.is_a?(AwsAdvancedRubyDriverWrapper::Errors::AwsError)
54
+
55
+ if exception.needs_reconfiguration
56
+ configure_connection
57
+ exception
58
+ elsif exception.is_a?(AwsAdvancedRubyDriverWrapper::Errors::FailoverFailedError)
59
+ @connection_broken = true
60
+ ActiveRecord::ConnectionFailed.new(message, sql:, binds:, connection_pool: @pool)
61
+ else
62
+ exception
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+
69
+ ActiveRecord::ConnectionAdapters.register(
70
+ 'aws_mysql2',
71
+ 'ActiveRecord::ConnectionAdapters::AwsMysql2Adapter',
72
+ 'aws_advanced_ruby_driver_wrapper/active_record/aws_mysql2_adapter'
73
+ )