kong-client 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/.hound.yml +2 -0
  4. data/.rubocop.yml +360 -0
  5. data/.travis.yml +11 -0
  6. data/CHANGELOG.md +37 -0
  7. data/Gemfile +8 -0
  8. data/LICENSE +191 -0
  9. data/README.md +295 -0
  10. data/Rakefile +5 -0
  11. data/kong.gemspec +24 -0
  12. data/lib/kong/acl.rb +8 -0
  13. data/lib/kong/api.rb +19 -0
  14. data/lib/kong/base.rb +180 -0
  15. data/lib/kong/basic_auth.rb +8 -0
  16. data/lib/kong/belongs_to_api.rb +30 -0
  17. data/lib/kong/belongs_to_consumer.rb +30 -0
  18. data/lib/kong/client.rb +232 -0
  19. data/lib/kong/consumer.rb +103 -0
  20. data/lib/kong/error.rb +10 -0
  21. data/lib/kong/hmac_auth.rb +9 -0
  22. data/lib/kong/jwt.rb +8 -0
  23. data/lib/kong/key_auth.rb +8 -0
  24. data/lib/kong/oauth2_token.rb +14 -0
  25. data/lib/kong/oauth_app.rb +8 -0
  26. data/lib/kong/plugin.rb +31 -0
  27. data/lib/kong/server.rb +23 -0
  28. data/lib/kong/target.rb +61 -0
  29. data/lib/kong/upstream.rb +24 -0
  30. data/lib/kong/util.rb +16 -0
  31. data/lib/kong/version.rb +3 -0
  32. data/lib/kong.rb +20 -0
  33. data/spec/kong/acl_spec.rb +19 -0
  34. data/spec/kong/api_spec.rb +32 -0
  35. data/spec/kong/base_spec.rb +169 -0
  36. data/spec/kong/basic_auth_spec.rb +26 -0
  37. data/spec/kong/client_spec.rb +297 -0
  38. data/spec/kong/consumer_spec.rb +72 -0
  39. data/spec/kong/error_spec.rb +23 -0
  40. data/spec/kong/hmac_auth_spec.rb +26 -0
  41. data/spec/kong/key_auth_spec.rb +26 -0
  42. data/spec/kong/oauth2_token_spec.rb +19 -0
  43. data/spec/kong/oauth_app_spec.rb +19 -0
  44. data/spec/kong/plugin_spec.rb +62 -0
  45. data/spec/kong/server_spec.rb +39 -0
  46. data/spec/kong/target_spec.rb +53 -0
  47. data/spec/kong/upstream_spec.rb +37 -0
  48. data/spec/kong/util_spec.rb +29 -0
  49. data/spec/spec_helper.rb +19 -0
  50. data/tasks/rspec.rake +5 -0
  51. metadata +153 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c7b211453d1bc46a035ca17dd7925348d97cb6a4d53e7570b3c1045a1cb8706a
4
+ data.tar.gz: '049eaa47370ecd5be797ad5753e9f7bf135abaf8ef59f5799ba6efe5c1ae215e'
5
+ SHA512:
6
+ metadata.gz: 93cff2fd323a7ea1f37711d5133f31dc9bdcff2c0759f827c952e7243d11f86451e64449b54a5a05cff5a087f7e3c5bcab4c1ff5a7ee879dca15a9c8bef72409
7
+ data.tar.gz: 828de888866b44848c972e27969d810aec24a54a853dedf878411cb3770201b7d56147d23af4f070def7aeb9c48ed2672ecec303bfe547a108484055d3bbd246
data/.gitignore ADDED
@@ -0,0 +1,16 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ *.gem
15
+ mkmf.log
16
+ .idea
data/.hound.yml ADDED
@@ -0,0 +1,2 @@
1
+ ruby:
2
+ config_file: .rubocop.yml
data/.rubocop.yml ADDED
@@ -0,0 +1,360 @@
1
+ AllCops:
2
+ DisabledByDefault: true
3
+
4
+ Layout/IndentationConsistency:
5
+ Enabled: true
6
+ AutoCorrect: true
7
+
8
+ Layout/CommentIndentation:
9
+ Enabled: true
10
+ AutoCorrect: true
11
+
12
+ Style/NestedModifier:
13
+ Enabled: true
14
+
15
+ Layout/IndentFirstArrayElement:
16
+ Enabled: true
17
+
18
+ Layout/AlignArray:
19
+ Enabled: true
20
+
21
+ Layout/AlignHash:
22
+ Enabled: true
23
+
24
+ #Lint/EmptyInterpolation:
25
+ # Enabled: true
26
+ #
27
+ #Lint/Eval:
28
+ # Enabled: true
29
+ # Exclude:
30
+ # - test/**/*
31
+ #
32
+ #Lint/Debugger:
33
+ # Enabled: true
34
+ #
35
+ #Lint/EmptyEnsure:
36
+ # Enabled: true
37
+ #
38
+ #Lint/DuplicatedKey:
39
+ # Enabled: true
40
+ #
41
+ #Lint/UnreachableCode:
42
+ # Enabled: true
43
+ #
44
+ #Lint/BlockAlignment:
45
+ # Enabled: true
46
+ #
47
+ #Lint/DefEndAlignment:
48
+ # Enabled: true
49
+ #
50
+ #Lint/DuplicateMethods:
51
+ # Enabled: true
52
+ #
53
+ #Lint/AmbiguousOperator:
54
+ # Enabled: true
55
+ #
56
+ #Lint/ConditionPosition:
57
+ # Enabled: true
58
+
59
+ # TODO JMB 2015-12-28: should we include this?
60
+ #Lint/UselessAssignment:
61
+ # Enabled: true
62
+
63
+ #Lint/RequireParentheses:
64
+ # Enabled: true
65
+ #
66
+ #Lint/LiteralInCondition:
67
+ # Enabled: true
68
+ #
69
+ #Lint/UnusedBlockArgument:
70
+ # Enabled: true
71
+ #
72
+ #Lint/UnusedMethodArgument:
73
+ # Enabled: true
74
+ #
75
+ #Lint/UselessAccessModifier:
76
+ # Enabled: true
77
+
78
+ # TODO JMB 2015-12-28: needs latest rubocop
79
+ #Lint/IneffectiveAccessModifier:
80
+ # Enabled: true
81
+
82
+ #Lint/StringConversionInInterpolation:
83
+ # Enabled: true
84
+ #
85
+ #Lint/ShadowingOuterLocalVariable:
86
+ # Enabled: true
87
+ #
88
+ #Rails/Delegate:
89
+ # Enabled: true
90
+ #
91
+ #Rails/FindBy:
92
+ # Enabled: true
93
+ #
94
+ #Rails/FindEach:
95
+ # Enabled: true
96
+ #
97
+ #Rails/Output:
98
+ # Enabled: true
99
+ #
100
+ #Rails/PluralizationGrammar:
101
+ # Enabled: true
102
+ #
103
+ #Rails/Validation:
104
+ # Enabled: true
105
+ #
106
+ #Performance/CaseWhenSplat:
107
+ # Enabled: true
108
+ #
109
+ #Performance/Count:
110
+ # Enabled: true
111
+ #
112
+ #Performance/Detect:
113
+ # Enabled: true
114
+ #
115
+ #Performance/FixedSize:
116
+ # Enabled: true
117
+ #
118
+ #Performance/FlatMap:
119
+ # Enabled: true
120
+ #
121
+ #Performance/ReverseEach:
122
+ # Enabled: true
123
+ #
124
+ #Performance/Sample:
125
+ # Enabled: true
126
+ #
127
+ #Performance/Size:
128
+ # Enabled: true
129
+ #
130
+ #Performance/StringReplacement:
131
+ # Enabled: true
132
+
133
+ # TODO JMB 2015-12-28: metrics
134
+
135
+ ## Coding Style
136
+
137
+ Metrics/MethodLength:
138
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#method-length
139
+ Enabled: true
140
+ CountComments: false # count full line comments?
141
+ Max: 40
142
+ Severity: refactor
143
+
144
+ Layout/Tab:
145
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#tabs
146
+ Enabled: true
147
+
148
+ Metrics/ParameterLists:
149
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#parameter-count
150
+ Enabled: true
151
+ Severity: refactor
152
+ Max: 5
153
+ CountKeywordArgs: true
154
+
155
+ Layout/IndentationWidth:
156
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#tabs
157
+ Enabled: true
158
+
159
+ Metrics/LineLength:
160
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#max-line-length
161
+ Max: 120
162
+ Enabled: false
163
+
164
+ Layout/TrailingWhitespace:
165
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#no-trailing-whitespace
166
+ Enabled: true
167
+
168
+ Layout/TrailingBlankLines:
169
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#end-file-newline
170
+ EnforcedStyle: final_newline
171
+
172
+ Layout/SpaceAroundOperators:
173
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#spaces-around-operators
174
+ Enabled: true
175
+ AllowForAlignment: true
176
+
177
+ Layout/SpaceAroundEqualsInParameterDefault:
178
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#spaces-around-operators
179
+ EnforcedStyle: space
180
+
181
+ Layout/SpaceAfterComma:
182
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#spaces-around-operators
183
+ Enabled: true
184
+
185
+ Layout/SpaceAfterColon:
186
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#spaces-around-operators
187
+ Enabled: true
188
+
189
+ Layout/SpaceAfterSemicolon:
190
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#spaces-around-operators
191
+ Enabled: true
192
+
193
+ Layout/SpaceBeforeBlockBraces:
194
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#spaces-around-operators
195
+ Enabled: true
196
+ EnforcedStyle: space
197
+
198
+ Layout/SpaceInsideBlockBraces:
199
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#spaces-around-operators
200
+ Enabled: true
201
+ EnforcedStyle: space
202
+ # Valid values are: space, no_space
203
+ EnforcedStyleForEmptyBraces: no_space
204
+ # Space between { and |. Overrides EnforcedStyle if there is a conflict.
205
+ SpaceBeforeBlockParameters: true
206
+
207
+ Layout/SpaceInsideHashLiteralBraces:
208
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#spaces-around-operators
209
+ Enabled: true
210
+ EnforcedStyle: space
211
+ EnforcedStyleForEmptyBraces: no_space
212
+
213
+ Layout/SpaceInsideStringInterpolation:
214
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#spaces-around-operators
215
+ Enabled: true
216
+ EnforcedStyle: no_space
217
+
218
+ Layout/SpaceInsideParens:
219
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#no-spaces-around-delimiters
220
+ Enabled: true
221
+
222
+ Layout/SpaceInsideArrayLiteralBrackets:
223
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#no-spaces-around-delimiters
224
+ Enabled: true
225
+
226
+ Layout/SpaceInsideReferenceBrackets:
227
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#no-spaces-around-delimiters
228
+ Enabled: true
229
+
230
+ Layout/CaseIndentation:
231
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#case-indentation
232
+ Enabled: true
233
+
234
+ Layout/ElseAlignment:
235
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#case-indentation
236
+ Enabled: true
237
+
238
+ Layout/RescueEnsureAlignment:
239
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#case-indentation
240
+ Enabled: true
241
+
242
+ Layout/EndAlignment:
243
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#case-indentation
244
+ Enabled: true
245
+ AutoCorrect: true
246
+
247
+ Layout/SpaceAfterNot:
248
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#no-space-after-not
249
+ Enabled: true
250
+
251
+ Layout/EmptyLineBetweenDefs:
252
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#lines-between-defs
253
+ Enabled: true
254
+ AllowAdjacentOneLineDefs: false
255
+
256
+ ## Syntax
257
+
258
+ Style/MethodDefParentheses:
259
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#method-parentheses
260
+ Enabled: true
261
+
262
+ Style/DefWithParentheses:
263
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#method-parentheses
264
+ Enabled: true
265
+
266
+ Style/For:
267
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#for-keyword
268
+ Enabled: true
269
+
270
+ Style/MultilineIfThen:
271
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#multiline-if-then
272
+ Enabled: true
273
+
274
+ Style/NestedTernaryOperator:
275
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#nested-ternary
276
+ Enabled: true
277
+
278
+ Style/AndOr:
279
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#no-and-or-keyword
280
+ Enabled: true
281
+
282
+ Style/MultilineTernaryOperator:
283
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#multiline-ternary
284
+ Enabled: true
285
+
286
+ Style/UnlessElse:
287
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#unless-else
288
+ Enabled: true
289
+
290
+ Style/ParenthesesAroundCondition:
291
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#parens-around-condition
292
+ Enabled: true
293
+
294
+ Style/MultilineBlockChain:
295
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#block-syntax
296
+ Enabled: false
297
+
298
+ Style/RedundantReturn:
299
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#avoid-return
300
+ Enabled: true
301
+
302
+ Style/PerlBackrefs:
303
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#no-perlisms
304
+ Enabled: true
305
+
306
+ Style/SpecialGlobalVars:
307
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#no-perlisms
308
+ Enabled: true
309
+
310
+ Layout/SpaceAfterMethodName:
311
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#no-space-after-method-name
312
+ Enabled: true
313
+
314
+ Naming/VariableName:
315
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#variable-names
316
+ Enabled: true
317
+
318
+ Naming/ConstantName:
319
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#constant-names
320
+ Enabled: true
321
+
322
+ ## Classes
323
+
324
+ Style/ClassVars:
325
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#class-vars
326
+ Enabled: true
327
+
328
+ Layout/AccessModifierIndentation:
329
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#access-modifier-indent
330
+ Enabled: true
331
+
332
+ ## Exceptions
333
+
334
+ Lint/RescueException:
335
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#rescue-specific-exceptions
336
+ Enabled: true
337
+
338
+ ## Collections
339
+
340
+ Style/WordArray:
341
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#percent-w
342
+ Enabled: true
343
+ MinSize: 3
344
+
345
+ # Align with the style guide.
346
+ Style/CollectionMethods:
347
+ # Mapping from undesired method to desired_method
348
+ # e.g. to use `detect` over `find`:
349
+ #
350
+ # CollectionMethods:
351
+ # PreferredMethods:
352
+ # find: detect
353
+ Enabled: true
354
+ StyleGuide: https://github.com/backupify/backupify_styleguides/blob/master/RubyStyleguide.md#banned-aliases
355
+ PreferredMethods:
356
+ collect: 'map'
357
+ collect!: 'map!'
358
+ inject: 'reduce'
359
+ detect: 'find'
360
+ find_all: 'select'
data/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.4
4
+ - 2.5
5
+ - 2.6
6
+ cache: bundler
7
+ before_install:
8
+ - # we want bundler 1.7 (for now) https://docs.travis-ci.com/user/languages/ruby/
9
+ - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
10
+ - gem install bundler -v '< 2'
11
+ script: bundle install && bundle exec rspec spec/
data/CHANGELOG.md ADDED
@@ -0,0 +1,37 @@
1
+ # 0.4.0 (2023-02-02)
2
+ - Allow create ACLs with tags
3
+ - Allow find all resources by some field
4
+
5
+ # 0.3.4 (2018-09-12)
6
+ - Re-built gem package
7
+
8
+ # 0.3.3 (2018-09-07)
9
+ - Switch to application json content type ([#28](https://github.com/kontena/kong-client-ruby/pull/28))
10
+ - Flatten nested plugin config items ([#27](https://github.com/kontena/kong-client-ruby/pull/27))
11
+
12
+ # 0.3.2 (2018-02-05)
13
+ - Remove Excon version dependency ([#25](https://github.com/kontena/kong-client-ruby/pull/25))
14
+
15
+ # 0.3.1 (2017-10-02)
16
+ - Use consumer id to retrieve auth keys and tokens ([#19](https://github.com/kontena/kong-client-ruby/pull/19))
17
+ - Add methods to kong api base attributes ([#21](https://github.com/kontena/kong-client-ruby/pull/21))
18
+ # 0.3.0 (2017-07-31)
19
+ - Add support for Upstream and Target resources ([#15](https://github.com/kontena/kong-client-ruby/pull/15))
20
+
21
+ # 0.2.0 (2017-04-20)
22
+ - Add Server information support ([#14](https://github.com/kontena/kong-client-ruby/pull/14))
23
+ - Add optional attributes to Api
24
+ ([#13](https://github.com/kontena/kong-client-ruby/pull/13))
25
+ - Fix Plugin#create and #update to save config properly
26
+ ([#12](https://github.com/kontena/kong-client-ruby/pull/12))
27
+
28
+ # 0.1.2 (2017-01-12)
29
+ - Add JWT support ([#2](https://github.com/kontena/kong-client-ruby/pull/2))
30
+ - Allow to properly set a custom api_url ([#4](https://github.com/kontena/kong-client-ruby/pull/4))
31
+ - Allow to redefine api_url
32
+ ([#6](https://github.com/kontena/kong-client-ruby/pull/6))
33
+ - Add ACL support
34
+ ([#9](https://github.com/kontena/kong-client-ruby/pull/9))
35
+
36
+ # 0.1.1 (2016-10-10)
37
+ - Fix Kong::Base.respond_to? to return true for find_by_* methods
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in kong.gemspec
4
+ gemspec
5
+ group :development, :test do
6
+ gem "rspec"
7
+ gem "rubocop", "~> 0.76.0"
8
+ end
data/LICENSE ADDED
@@ -0,0 +1,191 @@
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
+ Copyright 2015 Kontena, Inc.
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.