planetscale 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (378) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/ci.yml +24 -0
  3. data/.github/workflows/gem-push.yml +38 -0
  4. data/.github/workflows/licensed.yml +43 -0
  5. data/.gitignore +10 -0
  6. data/.licensed.yml +9 -0
  7. data/.licenses/go/github.com/armon/circbuf.dep.yml +31 -0
  8. data/.licenses/go/github.com/gorilla/mux.dep.yml +41 -0
  9. data/.licenses/go/github.com/hashicorp/go-cleanhttp.dep.yml +375 -0
  10. data/.licenses/go/github.com/mitchellh/go-homedir.dep.yml +32 -0
  11. data/.licenses/go/github.com/pkg/errors.dep.yml +36 -0
  12. data/.licenses/go/github.com/planetscale/planetscale-go/planetscale.dep.yml +160 -0
  13. data/.licenses/go/github.com/planetscale/sql-proxy/proxy.dep.yml +180 -0
  14. data/.licenses/go/go.uber.org/atomic.dep.yml +31 -0
  15. data/.licenses/go/go.uber.org/multierr.dep.yml +30 -0
  16. data/.licenses/go/go.uber.org/zap.dep.yml +30 -0
  17. data/.licenses/go/go.uber.org/zap/buffer.dep.yml +30 -0
  18. data/.licenses/go/go.uber.org/zap/internal/bufferpool.dep.yml +30 -0
  19. data/.licenses/go/go.uber.org/zap/internal/color.dep.yml +30 -0
  20. data/.licenses/go/go.uber.org/zap/internal/exit.dep.yml +31 -0
  21. data/.licenses/go/go.uber.org/zap/zapcore.dep.yml +31 -0
  22. data/.licenses/go/golang.org/x/net/context/ctxhttp.dep.yml +63 -0
  23. data/.licenses/go/golang.org/x/oauth2.dep.yml +44 -0
  24. data/.licenses/go/golang.org/x/oauth2/internal.dep.yml +38 -0
  25. data/.ruby_version +1 -0
  26. data/Gemfile +8 -0
  27. data/LICENSE +201 -0
  28. data/README.md +88 -0
  29. data/Rakefile +10 -0
  30. data/bin/console +15 -0
  31. data/bin/setup +17 -0
  32. data/controller.go +255 -0
  33. data/go.mod +16 -0
  34. data/go.sum +428 -0
  35. data/lib/generators/planetscale/install_generator.rb +58 -0
  36. data/lib/planetscale.rb +137 -0
  37. data/lib/planetscale/version.rb +5 -0
  38. data/planetscale.gemspec +44 -0
  39. data/proxy.go +128 -0
  40. data/vendor/github.com/armon/circbuf/.gitignore +22 -0
  41. data/vendor/github.com/armon/circbuf/LICENSE +20 -0
  42. data/vendor/github.com/armon/circbuf/README.md +28 -0
  43. data/vendor/github.com/armon/circbuf/circbuf.go +92 -0
  44. data/vendor/github.com/armon/circbuf/go.mod +1 -0
  45. data/vendor/github.com/golang/protobuf/AUTHORS +3 -0
  46. data/vendor/github.com/golang/protobuf/CONTRIBUTORS +3 -0
  47. data/vendor/github.com/golang/protobuf/LICENSE +28 -0
  48. data/vendor/github.com/golang/protobuf/proto/buffer.go +324 -0
  49. data/vendor/github.com/golang/protobuf/proto/defaults.go +63 -0
  50. data/vendor/github.com/golang/protobuf/proto/deprecated.go +113 -0
  51. data/vendor/github.com/golang/protobuf/proto/discard.go +58 -0
  52. data/vendor/github.com/golang/protobuf/proto/extensions.go +356 -0
  53. data/vendor/github.com/golang/protobuf/proto/properties.go +306 -0
  54. data/vendor/github.com/golang/protobuf/proto/proto.go +167 -0
  55. data/vendor/github.com/golang/protobuf/proto/registry.go +317 -0
  56. data/vendor/github.com/golang/protobuf/proto/text_decode.go +801 -0
  57. data/vendor/github.com/golang/protobuf/proto/text_encode.go +560 -0
  58. data/vendor/github.com/golang/protobuf/proto/wire.go +78 -0
  59. data/vendor/github.com/golang/protobuf/proto/wrappers.go +34 -0
  60. data/vendor/github.com/gorilla/mux/AUTHORS +8 -0
  61. data/vendor/github.com/gorilla/mux/LICENSE +27 -0
  62. data/vendor/github.com/gorilla/mux/README.md +805 -0
  63. data/vendor/github.com/gorilla/mux/doc.go +306 -0
  64. data/vendor/github.com/gorilla/mux/go.mod +3 -0
  65. data/vendor/github.com/gorilla/mux/middleware.go +74 -0
  66. data/vendor/github.com/gorilla/mux/mux.go +606 -0
  67. data/vendor/github.com/gorilla/mux/regexp.go +388 -0
  68. data/vendor/github.com/gorilla/mux/route.go +736 -0
  69. data/vendor/github.com/gorilla/mux/test_helpers.go +19 -0
  70. data/vendor/github.com/hashicorp/go-cleanhttp/LICENSE +363 -0
  71. data/vendor/github.com/hashicorp/go-cleanhttp/README.md +30 -0
  72. data/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go +58 -0
  73. data/vendor/github.com/hashicorp/go-cleanhttp/doc.go +20 -0
  74. data/vendor/github.com/hashicorp/go-cleanhttp/go.mod +3 -0
  75. data/vendor/github.com/hashicorp/go-cleanhttp/handlers.go +48 -0
  76. data/vendor/github.com/mitchellh/go-homedir/LICENSE +21 -0
  77. data/vendor/github.com/mitchellh/go-homedir/README.md +14 -0
  78. data/vendor/github.com/mitchellh/go-homedir/go.mod +1 -0
  79. data/vendor/github.com/mitchellh/go-homedir/homedir.go +167 -0
  80. data/vendor/github.com/pkg/errors/.gitignore +24 -0
  81. data/vendor/github.com/pkg/errors/.travis.yml +10 -0
  82. data/vendor/github.com/pkg/errors/LICENSE +23 -0
  83. data/vendor/github.com/pkg/errors/Makefile +44 -0
  84. data/vendor/github.com/pkg/errors/README.md +59 -0
  85. data/vendor/github.com/pkg/errors/appveyor.yml +32 -0
  86. data/vendor/github.com/pkg/errors/errors.go +288 -0
  87. data/vendor/github.com/pkg/errors/go113.go +38 -0
  88. data/vendor/github.com/pkg/errors/stack.go +177 -0
  89. data/vendor/github.com/planetscale/planetscale-go/planetscale/backups.go +139 -0
  90. data/vendor/github.com/planetscale/planetscale-go/planetscale/branches.go +258 -0
  91. data/vendor/github.com/planetscale/planetscale-go/planetscale/certs.go +142 -0
  92. data/vendor/github.com/planetscale/planetscale-go/planetscale/client.go +305 -0
  93. data/vendor/github.com/planetscale/planetscale-go/planetscale/databases.go +131 -0
  94. data/vendor/github.com/planetscale/planetscale-go/planetscale/deploy_requests.go +368 -0
  95. data/vendor/github.com/planetscale/planetscale-go/planetscale/organizations.go +78 -0
  96. data/vendor/github.com/planetscale/planetscale-go/planetscale/service_tokens.go +163 -0
  97. data/vendor/github.com/planetscale/sql-proxy/proxy/client.go +467 -0
  98. data/vendor/github.com/planetscale/sql-proxy/proxy/tls_cache.go +73 -0
  99. data/vendor/go.uber.org/atomic/.codecov.yml +19 -0
  100. data/vendor/go.uber.org/atomic/.gitignore +12 -0
  101. data/vendor/go.uber.org/atomic/.travis.yml +27 -0
  102. data/vendor/go.uber.org/atomic/CHANGELOG.md +76 -0
  103. data/vendor/go.uber.org/atomic/LICENSE.txt +19 -0
  104. data/vendor/go.uber.org/atomic/Makefile +78 -0
  105. data/vendor/go.uber.org/atomic/README.md +63 -0
  106. data/vendor/go.uber.org/atomic/bool.go +81 -0
  107. data/vendor/go.uber.org/atomic/bool_ext.go +53 -0
  108. data/vendor/go.uber.org/atomic/doc.go +23 -0
  109. data/vendor/go.uber.org/atomic/duration.go +82 -0
  110. data/vendor/go.uber.org/atomic/duration_ext.go +40 -0
  111. data/vendor/go.uber.org/atomic/error.go +51 -0
  112. data/vendor/go.uber.org/atomic/error_ext.go +39 -0
  113. data/vendor/go.uber.org/atomic/float64.go +76 -0
  114. data/vendor/go.uber.org/atomic/float64_ext.go +47 -0
  115. data/vendor/go.uber.org/atomic/gen.go +26 -0
  116. data/vendor/go.uber.org/atomic/go.mod +8 -0
  117. data/vendor/go.uber.org/atomic/go.sum +9 -0
  118. data/vendor/go.uber.org/atomic/int32.go +102 -0
  119. data/vendor/go.uber.org/atomic/int64.go +102 -0
  120. data/vendor/go.uber.org/atomic/nocmp.go +35 -0
  121. data/vendor/go.uber.org/atomic/string.go +54 -0
  122. data/vendor/go.uber.org/atomic/string_ext.go +43 -0
  123. data/vendor/go.uber.org/atomic/uint32.go +102 -0
  124. data/vendor/go.uber.org/atomic/uint64.go +102 -0
  125. data/vendor/go.uber.org/atomic/value.go +31 -0
  126. data/vendor/go.uber.org/multierr/.codecov.yml +15 -0
  127. data/vendor/go.uber.org/multierr/.gitignore +4 -0
  128. data/vendor/go.uber.org/multierr/.travis.yml +23 -0
  129. data/vendor/go.uber.org/multierr/CHANGELOG.md +60 -0
  130. data/vendor/go.uber.org/multierr/LICENSE.txt +19 -0
  131. data/vendor/go.uber.org/multierr/Makefile +42 -0
  132. data/vendor/go.uber.org/multierr/README.md +23 -0
  133. data/vendor/go.uber.org/multierr/error.go +449 -0
  134. data/vendor/go.uber.org/multierr/glide.yaml +8 -0
  135. data/vendor/go.uber.org/multierr/go.mod +8 -0
  136. data/vendor/go.uber.org/multierr/go.sum +11 -0
  137. data/vendor/go.uber.org/multierr/go113.go +52 -0
  138. data/vendor/go.uber.org/zap/.codecov.yml +17 -0
  139. data/vendor/go.uber.org/zap/.gitignore +32 -0
  140. data/vendor/go.uber.org/zap/.readme.tmpl +109 -0
  141. data/vendor/go.uber.org/zap/.travis.yml +23 -0
  142. data/vendor/go.uber.org/zap/CHANGELOG.md +432 -0
  143. data/vendor/go.uber.org/zap/CODE_OF_CONDUCT.md +75 -0
  144. data/vendor/go.uber.org/zap/CONTRIBUTING.md +81 -0
  145. data/vendor/go.uber.org/zap/FAQ.md +156 -0
  146. data/vendor/go.uber.org/zap/LICENSE.txt +19 -0
  147. data/vendor/go.uber.org/zap/Makefile +63 -0
  148. data/vendor/go.uber.org/zap/README.md +134 -0
  149. data/vendor/go.uber.org/zap/array.go +320 -0
  150. data/vendor/go.uber.org/zap/buffer/buffer.go +123 -0
  151. data/vendor/go.uber.org/zap/buffer/pool.go +49 -0
  152. data/vendor/go.uber.org/zap/checklicense.sh +17 -0
  153. data/vendor/go.uber.org/zap/config.go +264 -0
  154. data/vendor/go.uber.org/zap/doc.go +113 -0
  155. data/vendor/go.uber.org/zap/encoder.go +79 -0
  156. data/vendor/go.uber.org/zap/error.go +80 -0
  157. data/vendor/go.uber.org/zap/field.go +539 -0
  158. data/vendor/go.uber.org/zap/flag.go +39 -0
  159. data/vendor/go.uber.org/zap/glide.yaml +34 -0
  160. data/vendor/go.uber.org/zap/global.go +168 -0
  161. data/vendor/go.uber.org/zap/global_go112.go +26 -0
  162. data/vendor/go.uber.org/zap/global_prego112.go +26 -0
  163. data/vendor/go.uber.org/zap/go.mod +13 -0
  164. data/vendor/go.uber.org/zap/go.sum +56 -0
  165. data/vendor/go.uber.org/zap/http_handler.go +81 -0
  166. data/vendor/go.uber.org/zap/internal/bufferpool/bufferpool.go +31 -0
  167. data/vendor/go.uber.org/zap/internal/color/color.go +44 -0
  168. data/vendor/go.uber.org/zap/internal/exit/exit.go +64 -0
  169. data/vendor/go.uber.org/zap/level.go +132 -0
  170. data/vendor/go.uber.org/zap/logger.go +344 -0
  171. data/vendor/go.uber.org/zap/options.go +140 -0
  172. data/vendor/go.uber.org/zap/sink.go +161 -0
  173. data/vendor/go.uber.org/zap/stacktrace.go +85 -0
  174. data/vendor/go.uber.org/zap/sugar.go +304 -0
  175. data/vendor/go.uber.org/zap/time.go +27 -0
  176. data/vendor/go.uber.org/zap/writer.go +99 -0
  177. data/vendor/go.uber.org/zap/zapcore/console_encoder.go +161 -0
  178. data/vendor/go.uber.org/zap/zapcore/core.go +113 -0
  179. data/vendor/go.uber.org/zap/zapcore/doc.go +24 -0
  180. data/vendor/go.uber.org/zap/zapcore/encoder.go +443 -0
  181. data/vendor/go.uber.org/zap/zapcore/entry.go +264 -0
  182. data/vendor/go.uber.org/zap/zapcore/error.go +115 -0
  183. data/vendor/go.uber.org/zap/zapcore/field.go +227 -0
  184. data/vendor/go.uber.org/zap/zapcore/hook.go +68 -0
  185. data/vendor/go.uber.org/zap/zapcore/increase_level.go +66 -0
  186. data/vendor/go.uber.org/zap/zapcore/json_encoder.go +534 -0
  187. data/vendor/go.uber.org/zap/zapcore/level.go +175 -0
  188. data/vendor/go.uber.org/zap/zapcore/level_strings.go +46 -0
  189. data/vendor/go.uber.org/zap/zapcore/marshaler.go +61 -0
  190. data/vendor/go.uber.org/zap/zapcore/memory_encoder.go +179 -0
  191. data/vendor/go.uber.org/zap/zapcore/sampler.go +208 -0
  192. data/vendor/go.uber.org/zap/zapcore/tee.go +81 -0
  193. data/vendor/go.uber.org/zap/zapcore/write_syncer.go +123 -0
  194. data/vendor/golang.org/x/net/AUTHORS +3 -0
  195. data/vendor/golang.org/x/net/CONTRIBUTORS +3 -0
  196. data/vendor/golang.org/x/net/LICENSE +27 -0
  197. data/vendor/golang.org/x/net/PATENTS +22 -0
  198. data/vendor/golang.org/x/net/context/context.go +56 -0
  199. data/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go +71 -0
  200. data/vendor/golang.org/x/net/context/go17.go +73 -0
  201. data/vendor/golang.org/x/net/context/go19.go +21 -0
  202. data/vendor/golang.org/x/net/context/pre_go17.go +301 -0
  203. data/vendor/golang.org/x/net/context/pre_go19.go +110 -0
  204. data/vendor/golang.org/x/oauth2/.travis.yml +13 -0
  205. data/vendor/golang.org/x/oauth2/AUTHORS +3 -0
  206. data/vendor/golang.org/x/oauth2/CONTRIBUTING.md +26 -0
  207. data/vendor/golang.org/x/oauth2/CONTRIBUTORS +3 -0
  208. data/vendor/golang.org/x/oauth2/LICENSE +27 -0
  209. data/vendor/golang.org/x/oauth2/README.md +36 -0
  210. data/vendor/golang.org/x/oauth2/go.mod +9 -0
  211. data/vendor/golang.org/x/oauth2/go.sum +361 -0
  212. data/vendor/golang.org/x/oauth2/internal/client_appengine.go +14 -0
  213. data/vendor/golang.org/x/oauth2/internal/doc.go +6 -0
  214. data/vendor/golang.org/x/oauth2/internal/oauth2.go +37 -0
  215. data/vendor/golang.org/x/oauth2/internal/token.go +294 -0
  216. data/vendor/golang.org/x/oauth2/internal/transport.go +33 -0
  217. data/vendor/golang.org/x/oauth2/oauth2.go +381 -0
  218. data/vendor/golang.org/x/oauth2/token.go +178 -0
  219. data/vendor/golang.org/x/oauth2/transport.go +89 -0
  220. data/vendor/google.golang.org/appengine/LICENSE +202 -0
  221. data/vendor/google.golang.org/appengine/internal/api.go +678 -0
  222. data/vendor/google.golang.org/appengine/internal/api_classic.go +169 -0
  223. data/vendor/google.golang.org/appengine/internal/api_common.go +123 -0
  224. data/vendor/google.golang.org/appengine/internal/app_id.go +28 -0
  225. data/vendor/google.golang.org/appengine/internal/base/api_base.pb.go +308 -0
  226. data/vendor/google.golang.org/appengine/internal/base/api_base.proto +33 -0
  227. data/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.pb.go +4367 -0
  228. data/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto +551 -0
  229. data/vendor/google.golang.org/appengine/internal/identity.go +55 -0
  230. data/vendor/google.golang.org/appengine/internal/identity_classic.go +61 -0
  231. data/vendor/google.golang.org/appengine/internal/identity_flex.go +11 -0
  232. data/vendor/google.golang.org/appengine/internal/identity_vm.go +134 -0
  233. data/vendor/google.golang.org/appengine/internal/internal.go +110 -0
  234. data/vendor/google.golang.org/appengine/internal/log/log_service.pb.go +1313 -0
  235. data/vendor/google.golang.org/appengine/internal/log/log_service.proto +150 -0
  236. data/vendor/google.golang.org/appengine/internal/main.go +16 -0
  237. data/vendor/google.golang.org/appengine/internal/main_common.go +7 -0
  238. data/vendor/google.golang.org/appengine/internal/main_vm.go +69 -0
  239. data/vendor/google.golang.org/appengine/internal/metadata.go +60 -0
  240. data/vendor/google.golang.org/appengine/internal/net.go +56 -0
  241. data/vendor/google.golang.org/appengine/internal/regen.sh +40 -0
  242. data/vendor/google.golang.org/appengine/internal/remote_api/remote_api.pb.go +361 -0
  243. data/vendor/google.golang.org/appengine/internal/remote_api/remote_api.proto +44 -0
  244. data/vendor/google.golang.org/appengine/internal/transaction.go +115 -0
  245. data/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go +527 -0
  246. data/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto +64 -0
  247. data/vendor/google.golang.org/appengine/urlfetch/urlfetch.go +210 -0
  248. data/vendor/google.golang.org/protobuf/AUTHORS +3 -0
  249. data/vendor/google.golang.org/protobuf/CONTRIBUTORS +3 -0
  250. data/vendor/google.golang.org/protobuf/LICENSE +27 -0
  251. data/vendor/google.golang.org/protobuf/PATENTS +22 -0
  252. data/vendor/google.golang.org/protobuf/encoding/prototext/decode.go +773 -0
  253. data/vendor/google.golang.org/protobuf/encoding/prototext/doc.go +7 -0
  254. data/vendor/google.golang.org/protobuf/encoding/prototext/encode.go +371 -0
  255. data/vendor/google.golang.org/protobuf/encoding/protowire/wire.go +538 -0
  256. data/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go +318 -0
  257. data/vendor/google.golang.org/protobuf/internal/descopts/options.go +29 -0
  258. data/vendor/google.golang.org/protobuf/internal/detrand/rand.go +69 -0
  259. data/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go +213 -0
  260. data/vendor/google.golang.org/protobuf/internal/encoding/messageset/messageset.go +241 -0
  261. data/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go +207 -0
  262. data/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go +665 -0
  263. data/vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go +190 -0
  264. data/vendor/google.golang.org/protobuf/internal/encoding/text/decode_string.go +161 -0
  265. data/vendor/google.golang.org/protobuf/internal/encoding/text/decode_token.go +373 -0
  266. data/vendor/google.golang.org/protobuf/internal/encoding/text/doc.go +29 -0
  267. data/vendor/google.golang.org/protobuf/internal/encoding/text/encode.go +265 -0
  268. data/vendor/google.golang.org/protobuf/internal/errors/errors.go +89 -0
  269. data/vendor/google.golang.org/protobuf/internal/errors/is_go112.go +39 -0
  270. data/vendor/google.golang.org/protobuf/internal/errors/is_go113.go +12 -0
  271. data/vendor/google.golang.org/protobuf/internal/filedesc/build.go +158 -0
  272. data/vendor/google.golang.org/protobuf/internal/filedesc/desc.go +631 -0
  273. data/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go +471 -0
  274. data/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go +704 -0
  275. data/vendor/google.golang.org/protobuf/internal/filedesc/desc_list.go +450 -0
  276. data/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go +356 -0
  277. data/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go +107 -0
  278. data/vendor/google.golang.org/protobuf/internal/filetype/build.go +297 -0
  279. data/vendor/google.golang.org/protobuf/internal/flags/flags.go +24 -0
  280. data/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.go +9 -0
  281. data/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.go +9 -0
  282. data/vendor/google.golang.org/protobuf/internal/genid/any_gen.go +34 -0
  283. data/vendor/google.golang.org/protobuf/internal/genid/api_gen.go +106 -0
  284. data/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +829 -0
  285. data/vendor/google.golang.org/protobuf/internal/genid/doc.go +11 -0
  286. data/vendor/google.golang.org/protobuf/internal/genid/duration_gen.go +34 -0
  287. data/vendor/google.golang.org/protobuf/internal/genid/empty_gen.go +19 -0
  288. data/vendor/google.golang.org/protobuf/internal/genid/field_mask_gen.go +31 -0
  289. data/vendor/google.golang.org/protobuf/internal/genid/goname.go +25 -0
  290. data/vendor/google.golang.org/protobuf/internal/genid/map_entry.go +16 -0
  291. data/vendor/google.golang.org/protobuf/internal/genid/source_context_gen.go +31 -0
  292. data/vendor/google.golang.org/protobuf/internal/genid/struct_gen.go +116 -0
  293. data/vendor/google.golang.org/protobuf/internal/genid/timestamp_gen.go +34 -0
  294. data/vendor/google.golang.org/protobuf/internal/genid/type_gen.go +184 -0
  295. data/vendor/google.golang.org/protobuf/internal/genid/wrappers.go +13 -0
  296. data/vendor/google.golang.org/protobuf/internal/genid/wrappers_gen.go +175 -0
  297. data/vendor/google.golang.org/protobuf/internal/impl/api_export.go +177 -0
  298. data/vendor/google.golang.org/protobuf/internal/impl/checkinit.go +141 -0
  299. data/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go +223 -0
  300. data/vendor/google.golang.org/protobuf/internal/impl/codec_field.go +830 -0
  301. data/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go +5637 -0
  302. data/vendor/google.golang.org/protobuf/internal/impl/codec_map.go +388 -0
  303. data/vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go +37 -0
  304. data/vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go +11 -0
  305. data/vendor/google.golang.org/protobuf/internal/impl/codec_message.go +217 -0
  306. data/vendor/google.golang.org/protobuf/internal/impl/codec_messageset.go +123 -0
  307. data/vendor/google.golang.org/protobuf/internal/impl/codec_reflect.go +209 -0
  308. data/vendor/google.golang.org/protobuf/internal/impl/codec_tables.go +557 -0
  309. data/vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.go +17 -0
  310. data/vendor/google.golang.org/protobuf/internal/impl/convert.go +496 -0
  311. data/vendor/google.golang.org/protobuf/internal/impl/convert_list.go +141 -0
  312. data/vendor/google.golang.org/protobuf/internal/impl/convert_map.go +121 -0
  313. data/vendor/google.golang.org/protobuf/internal/impl/decode.go +276 -0
  314. data/vendor/google.golang.org/protobuf/internal/impl/encode.go +201 -0
  315. data/vendor/google.golang.org/protobuf/internal/impl/enum.go +21 -0
  316. data/vendor/google.golang.org/protobuf/internal/impl/extension.go +156 -0
  317. data/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go +219 -0
  318. data/vendor/google.golang.org/protobuf/internal/impl/legacy_export.go +92 -0
  319. data/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go +176 -0
  320. data/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go +81 -0
  321. data/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go +558 -0
  322. data/vendor/google.golang.org/protobuf/internal/impl/merge.go +176 -0
  323. data/vendor/google.golang.org/protobuf/internal/impl/merge_gen.go +209 -0
  324. data/vendor/google.golang.org/protobuf/internal/impl/message.go +276 -0
  325. data/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go +465 -0
  326. data/vendor/google.golang.org/protobuf/internal/impl/message_reflect_field.go +543 -0
  327. data/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go +249 -0
  328. data/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go +178 -0
  329. data/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go +174 -0
  330. data/vendor/google.golang.org/protobuf/internal/impl/validate.go +576 -0
  331. data/vendor/google.golang.org/protobuf/internal/impl/weak.go +74 -0
  332. data/vendor/google.golang.org/protobuf/internal/order/order.go +89 -0
  333. data/vendor/google.golang.org/protobuf/internal/order/range.go +115 -0
  334. data/vendor/google.golang.org/protobuf/internal/pragma/pragma.go +29 -0
  335. data/vendor/google.golang.org/protobuf/internal/set/ints.go +58 -0
  336. data/vendor/google.golang.org/protobuf/internal/strs/strings.go +196 -0
  337. data/vendor/google.golang.org/protobuf/internal/strs/strings_pure.go +27 -0
  338. data/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go +94 -0
  339. data/vendor/google.golang.org/protobuf/internal/version/version.go +79 -0
  340. data/vendor/google.golang.org/protobuf/proto/checkinit.go +71 -0
  341. data/vendor/google.golang.org/protobuf/proto/decode.go +278 -0
  342. data/vendor/google.golang.org/protobuf/proto/decode_gen.go +603 -0
  343. data/vendor/google.golang.org/protobuf/proto/doc.go +94 -0
  344. data/vendor/google.golang.org/protobuf/proto/encode.go +319 -0
  345. data/vendor/google.golang.org/protobuf/proto/encode_gen.go +97 -0
  346. data/vendor/google.golang.org/protobuf/proto/equal.go +167 -0
  347. data/vendor/google.golang.org/protobuf/proto/extension.go +92 -0
  348. data/vendor/google.golang.org/protobuf/proto/merge.go +139 -0
  349. data/vendor/google.golang.org/protobuf/proto/messageset.go +93 -0
  350. data/vendor/google.golang.org/protobuf/proto/proto.go +43 -0
  351. data/vendor/google.golang.org/protobuf/proto/proto_methods.go +19 -0
  352. data/vendor/google.golang.org/protobuf/proto/proto_reflect.go +19 -0
  353. data/vendor/google.golang.org/protobuf/proto/reset.go +43 -0
  354. data/vendor/google.golang.org/protobuf/proto/size.go +97 -0
  355. data/vendor/google.golang.org/protobuf/proto/size_gen.go +55 -0
  356. data/vendor/google.golang.org/protobuf/proto/wrappers.go +29 -0
  357. data/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go +276 -0
  358. data/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go +248 -0
  359. data/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go +286 -0
  360. data/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go +374 -0
  361. data/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go +252 -0
  362. data/vendor/google.golang.org/protobuf/reflect/protoreflect/methods.go +77 -0
  363. data/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go +504 -0
  364. data/vendor/google.golang.org/protobuf/reflect/protoreflect/source.go +128 -0
  365. data/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +461 -0
  366. data/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go +665 -0
  367. data/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go +285 -0
  368. data/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go +59 -0
  369. data/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go +411 -0
  370. data/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go +98 -0
  371. data/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go +869 -0
  372. data/vendor/google.golang.org/protobuf/runtime/protoiface/legacy.go +15 -0
  373. data/vendor/google.golang.org/protobuf/runtime/protoiface/methods.go +167 -0
  374. data/vendor/google.golang.org/protobuf/runtime/protoimpl/impl.go +44 -0
  375. data/vendor/google.golang.org/protobuf/runtime/protoimpl/version.go +56 -0
  376. data/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go +4039 -0
  377. data/vendor/modules.txt +79 -0
  378. metadata +495 -0
@@ -0,0 +1,178 @@
1
+ // Copyright 2014 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package oauth2
6
+
7
+ import (
8
+ "context"
9
+ "fmt"
10
+ "net/http"
11
+ "net/url"
12
+ "strconv"
13
+ "strings"
14
+ "time"
15
+
16
+ "golang.org/x/oauth2/internal"
17
+ )
18
+
19
+ // expiryDelta determines how earlier a token should be considered
20
+ // expired than its actual expiration time. It is used to avoid late
21
+ // expirations due to client-server time mismatches.
22
+ const expiryDelta = 10 * time.Second
23
+
24
+ // Token represents the credentials used to authorize
25
+ // the requests to access protected resources on the OAuth 2.0
26
+ // provider's backend.
27
+ //
28
+ // Most users of this package should not access fields of Token
29
+ // directly. They're exported mostly for use by related packages
30
+ // implementing derivative OAuth2 flows.
31
+ type Token struct {
32
+ // AccessToken is the token that authorizes and authenticates
33
+ // the requests.
34
+ AccessToken string `json:"access_token"`
35
+
36
+ // TokenType is the type of token.
37
+ // The Type method returns either this or "Bearer", the default.
38
+ TokenType string `json:"token_type,omitempty"`
39
+
40
+ // RefreshToken is a token that's used by the application
41
+ // (as opposed to the user) to refresh the access token
42
+ // if it expires.
43
+ RefreshToken string `json:"refresh_token,omitempty"`
44
+
45
+ // Expiry is the optional expiration time of the access token.
46
+ //
47
+ // If zero, TokenSource implementations will reuse the same
48
+ // token forever and RefreshToken or equivalent
49
+ // mechanisms for that TokenSource will not be used.
50
+ Expiry time.Time `json:"expiry,omitempty"`
51
+
52
+ // raw optionally contains extra metadata from the server
53
+ // when updating a token.
54
+ raw interface{}
55
+ }
56
+
57
+ // Type returns t.TokenType if non-empty, else "Bearer".
58
+ func (t *Token) Type() string {
59
+ if strings.EqualFold(t.TokenType, "bearer") {
60
+ return "Bearer"
61
+ }
62
+ if strings.EqualFold(t.TokenType, "mac") {
63
+ return "MAC"
64
+ }
65
+ if strings.EqualFold(t.TokenType, "basic") {
66
+ return "Basic"
67
+ }
68
+ if t.TokenType != "" {
69
+ return t.TokenType
70
+ }
71
+ return "Bearer"
72
+ }
73
+
74
+ // SetAuthHeader sets the Authorization header to r using the access
75
+ // token in t.
76
+ //
77
+ // This method is unnecessary when using Transport or an HTTP Client
78
+ // returned by this package.
79
+ func (t *Token) SetAuthHeader(r *http.Request) {
80
+ r.Header.Set("Authorization", t.Type()+" "+t.AccessToken)
81
+ }
82
+
83
+ // WithExtra returns a new Token that's a clone of t, but using the
84
+ // provided raw extra map. This is only intended for use by packages
85
+ // implementing derivative OAuth2 flows.
86
+ func (t *Token) WithExtra(extra interface{}) *Token {
87
+ t2 := new(Token)
88
+ *t2 = *t
89
+ t2.raw = extra
90
+ return t2
91
+ }
92
+
93
+ // Extra returns an extra field.
94
+ // Extra fields are key-value pairs returned by the server as a
95
+ // part of the token retrieval response.
96
+ func (t *Token) Extra(key string) interface{} {
97
+ if raw, ok := t.raw.(map[string]interface{}); ok {
98
+ return raw[key]
99
+ }
100
+
101
+ vals, ok := t.raw.(url.Values)
102
+ if !ok {
103
+ return nil
104
+ }
105
+
106
+ v := vals.Get(key)
107
+ switch s := strings.TrimSpace(v); strings.Count(s, ".") {
108
+ case 0: // Contains no "."; try to parse as int
109
+ if i, err := strconv.ParseInt(s, 10, 64); err == nil {
110
+ return i
111
+ }
112
+ case 1: // Contains a single "."; try to parse as float
113
+ if f, err := strconv.ParseFloat(s, 64); err == nil {
114
+ return f
115
+ }
116
+ }
117
+
118
+ return v
119
+ }
120
+
121
+ // timeNow is time.Now but pulled out as a variable for tests.
122
+ var timeNow = time.Now
123
+
124
+ // expired reports whether the token is expired.
125
+ // t must be non-nil.
126
+ func (t *Token) expired() bool {
127
+ if t.Expiry.IsZero() {
128
+ return false
129
+ }
130
+ return t.Expiry.Round(0).Add(-expiryDelta).Before(timeNow())
131
+ }
132
+
133
+ // Valid reports whether t is non-nil, has an AccessToken, and is not expired.
134
+ func (t *Token) Valid() bool {
135
+ return t != nil && t.AccessToken != "" && !t.expired()
136
+ }
137
+
138
+ // tokenFromInternal maps an *internal.Token struct into
139
+ // a *Token struct.
140
+ func tokenFromInternal(t *internal.Token) *Token {
141
+ if t == nil {
142
+ return nil
143
+ }
144
+ return &Token{
145
+ AccessToken: t.AccessToken,
146
+ TokenType: t.TokenType,
147
+ RefreshToken: t.RefreshToken,
148
+ Expiry: t.Expiry,
149
+ raw: t.Raw,
150
+ }
151
+ }
152
+
153
+ // retrieveToken takes a *Config and uses that to retrieve an *internal.Token.
154
+ // This token is then mapped from *internal.Token into an *oauth2.Token which is returned along
155
+ // with an error..
156
+ func retrieveToken(ctx context.Context, c *Config, v url.Values) (*Token, error) {
157
+ tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v, internal.AuthStyle(c.Endpoint.AuthStyle))
158
+ if err != nil {
159
+ if rErr, ok := err.(*internal.RetrieveError); ok {
160
+ return nil, (*RetrieveError)(rErr)
161
+ }
162
+ return nil, err
163
+ }
164
+ return tokenFromInternal(tk), nil
165
+ }
166
+
167
+ // RetrieveError is the error returned when the token endpoint returns a
168
+ // non-2XX HTTP status code.
169
+ type RetrieveError struct {
170
+ Response *http.Response
171
+ // Body is the body that was consumed by reading Response.Body.
172
+ // It may be truncated.
173
+ Body []byte
174
+ }
175
+
176
+ func (r *RetrieveError) Error() string {
177
+ return fmt.Sprintf("oauth2: cannot fetch token: %v\nResponse: %s", r.Response.Status, r.Body)
178
+ }
@@ -0,0 +1,89 @@
1
+ // Copyright 2014 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package oauth2
6
+
7
+ import (
8
+ "errors"
9
+ "log"
10
+ "net/http"
11
+ "sync"
12
+ )
13
+
14
+ // Transport is an http.RoundTripper that makes OAuth 2.0 HTTP requests,
15
+ // wrapping a base RoundTripper and adding an Authorization header
16
+ // with a token from the supplied Sources.
17
+ //
18
+ // Transport is a low-level mechanism. Most code will use the
19
+ // higher-level Config.Client method instead.
20
+ type Transport struct {
21
+ // Source supplies the token to add to outgoing requests'
22
+ // Authorization headers.
23
+ Source TokenSource
24
+
25
+ // Base is the base RoundTripper used to make HTTP requests.
26
+ // If nil, http.DefaultTransport is used.
27
+ Base http.RoundTripper
28
+ }
29
+
30
+ // RoundTrip authorizes and authenticates the request with an
31
+ // access token from Transport's Source.
32
+ func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {
33
+ reqBodyClosed := false
34
+ if req.Body != nil {
35
+ defer func() {
36
+ if !reqBodyClosed {
37
+ req.Body.Close()
38
+ }
39
+ }()
40
+ }
41
+
42
+ if t.Source == nil {
43
+ return nil, errors.New("oauth2: Transport's Source is nil")
44
+ }
45
+ token, err := t.Source.Token()
46
+ if err != nil {
47
+ return nil, err
48
+ }
49
+
50
+ req2 := cloneRequest(req) // per RoundTripper contract
51
+ token.SetAuthHeader(req2)
52
+
53
+ // req.Body is assumed to be closed by the base RoundTripper.
54
+ reqBodyClosed = true
55
+ return t.base().RoundTrip(req2)
56
+ }
57
+
58
+ var cancelOnce sync.Once
59
+
60
+ // CancelRequest does nothing. It used to be a legacy cancellation mechanism
61
+ // but now only it only logs on first use to warn that it's deprecated.
62
+ //
63
+ // Deprecated: use contexts for cancellation instead.
64
+ func (t *Transport) CancelRequest(req *http.Request) {
65
+ cancelOnce.Do(func() {
66
+ log.Printf("deprecated: golang.org/x/oauth2: Transport.CancelRequest no longer does anything; use contexts")
67
+ })
68
+ }
69
+
70
+ func (t *Transport) base() http.RoundTripper {
71
+ if t.Base != nil {
72
+ return t.Base
73
+ }
74
+ return http.DefaultTransport
75
+ }
76
+
77
+ // cloneRequest returns a clone of the provided *http.Request.
78
+ // The clone is a shallow copy of the struct and its Header map.
79
+ func cloneRequest(r *http.Request) *http.Request {
80
+ // shallow copy of the struct
81
+ r2 := new(http.Request)
82
+ *r2 = *r
83
+ // deep copy of the Header
84
+ r2.Header = make(http.Header, len(r.Header))
85
+ for k, s := range r.Header {
86
+ r2.Header[k] = append([]string(nil), s...)
87
+ }
88
+ return r2
89
+ }
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.