manageiq-api-common 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +202 -0
  3. data/README.md +62 -0
  4. data/Rakefile +18 -0
  5. data/app/models/authentication.rb +19 -0
  6. data/app/models/concerns/encryption_concern.rb +52 -0
  7. data/app/models/encryption.rb +13 -0
  8. data/lib/generators/shared_utilities/migration_generator.rb +79 -0
  9. data/lib/generators/shared_utilities/orm_helper.rb +25 -0
  10. data/lib/generators/shared_utilities/templates/migration.rb +27 -0
  11. data/lib/generators/shared_utilities/templates/migration_existing.rb +28 -0
  12. data/lib/manageiq-api-common.rb +1 -0
  13. data/lib/manageiq/api/common.rb +13 -0
  14. data/lib/manageiq/api/common/api_error.rb +21 -0
  15. data/lib/manageiq/api/common/application_controller_mixins/api_doc.rb +39 -0
  16. data/lib/manageiq/api/common/application_controller_mixins/common.rb +27 -0
  17. data/lib/manageiq/api/common/application_controller_mixins/openapi_enabled.rb +13 -0
  18. data/lib/manageiq/api/common/application_controller_mixins/parameters.rb +113 -0
  19. data/lib/manageiq/api/common/application_controller_mixins/request_body_validation.rb +61 -0
  20. data/lib/manageiq/api/common/application_controller_mixins/request_path.rb +75 -0
  21. data/lib/manageiq/api/common/engine.rb +20 -0
  22. data/lib/manageiq/api/common/entitlement.rb +35 -0
  23. data/lib/manageiq/api/common/error_document.rb +29 -0
  24. data/lib/manageiq/api/common/filter.rb +160 -0
  25. data/lib/manageiq/api/common/graphql.rb +117 -0
  26. data/lib/manageiq/api/common/graphql/associated_records.rb +44 -0
  27. data/lib/manageiq/api/common/graphql/association_loader.rb +35 -0
  28. data/lib/manageiq/api/common/graphql/generator.rb +149 -0
  29. data/lib/manageiq/api/common/graphql/templates/model_type.erb +35 -0
  30. data/lib/manageiq/api/common/graphql/templates/query_type.erb +47 -0
  31. data/lib/manageiq/api/common/graphql/templates/schema.erb +6 -0
  32. data/lib/manageiq/api/common/graphql/types/big_int.rb +23 -0
  33. data/lib/manageiq/api/common/graphql/types/date_time.rb +16 -0
  34. data/lib/manageiq/api/common/graphql/types/query_filter.rb +16 -0
  35. data/lib/manageiq/api/common/inflections.rb +28 -0
  36. data/lib/manageiq/api/common/logging.rb +17 -0
  37. data/lib/manageiq/api/common/metrics.rb +39 -0
  38. data/lib/manageiq/api/common/middleware/web_server_metrics.rb +62 -0
  39. data/lib/manageiq/api/common/open_api.rb +2 -0
  40. data/lib/manageiq/api/common/open_api/docs.rb +54 -0
  41. data/lib/manageiq/api/common/open_api/docs/component_collection.rb +67 -0
  42. data/lib/manageiq/api/common/open_api/docs/doc_v3.rb +92 -0
  43. data/lib/manageiq/api/common/open_api/docs/object_definition.rb +27 -0
  44. data/lib/manageiq/api/common/open_api/generator.rb +441 -0
  45. data/lib/manageiq/api/common/open_api/serializer.rb +31 -0
  46. data/lib/manageiq/api/common/option_redirect_enhancements.rb +23 -0
  47. data/lib/manageiq/api/common/paginated_response.rb +92 -0
  48. data/lib/manageiq/api/common/request.rb +107 -0
  49. data/lib/manageiq/api/common/routing.rb +26 -0
  50. data/lib/manageiq/api/common/user.rb +48 -0
  51. data/lib/manageiq/api/common/version.rb +7 -0
  52. data/lib/tasks/manageiq/api/common_tasks.rake +4 -0
  53. data/spec/support/default_as_json.rb +17 -0
  54. data/spec/support/requests_spec_helper.rb +7 -0
  55. data/spec/support/user_header_spec_helper.rb +62 -0
  56. metadata +375 -0
@@ -0,0 +1,31 @@
1
+ module ManageIQ
2
+ module API
3
+ module Common
4
+ module OpenApi
5
+ module Serializer
6
+ def as_json(arg = {})
7
+ previous = super
8
+ encrypted_columns_set = (self.class.try(:encrypted_columns) || []).to_set
9
+ encryption_filtered = previous.except(*encrypted_columns_set)
10
+ return encryption_filtered unless arg.key?(:prefixes)
11
+ version = api_version_from_prefix(arg[:prefixes].first)
12
+ schema = ::ManageIQ::API::Common::OpenApi::Docs.instance[version].definitions[self.class.name]
13
+ attrs = encryption_filtered.slice(*schema["properties"].keys)
14
+ schema["properties"].keys.each do |name|
15
+ next if attrs[name].nil?
16
+ attrs[name] = attrs[name].iso8601 if attrs[name].kind_of?(Time)
17
+ attrs[name] = attrs[name].to_s if name.ends_with?("_id") || name == "id"
18
+ attrs[name] = self.public_send(name) if !attrs.key?(name) && !encrypted_columns_set.include?(name)
19
+ end
20
+ attrs.compact
21
+ end
22
+
23
+ def api_version_from_prefix(prefix)
24
+ /\/?\w+\/v(?<major>\d+)[x\.]?(?<minor>\d+)?\// =~ prefix
25
+ [major, minor].compact.join(".")
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,23 @@
1
+ module ManageIQ
2
+ module API
3
+ module Common
4
+ module OptionRedirectEnhancements
5
+ def serve(req)
6
+ uri = URI.parse(path(req.path_parameters, req))
7
+
8
+ req.commit_flash
9
+
10
+ body = %(<html><body>You are being <a href="#{ERB::Util.unwrapped_html_escape(uri.to_s)}">redirected</a>.</body></html>)
11
+
12
+ headers = {
13
+ "Location" => uri.to_s,
14
+ "Content-Type" => "text/html",
15
+ "Content-Length" => body.length.to_s
16
+ }
17
+
18
+ [ status, headers, [body] ]
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,92 @@
1
+ module ManageIQ
2
+ module API
3
+ module Common
4
+ class PaginatedResponse
5
+ attr_reader :limit, :offset
6
+
7
+ def initialize(base_query:, request:, limit: nil, offset: nil)
8
+ @base_query = base_query
9
+ @request = request
10
+ @limit = (limit || 100).to_i.clamp(1, 1000)
11
+ @offset = (offset || 0).to_i.clamp(0, Float::INFINITY)
12
+ end
13
+
14
+ def records
15
+ @records ||= @base_query.order(:id).limit(limit).offset(offset)
16
+ end
17
+
18
+ def response
19
+ {
20
+ "meta" => metadata_hash,
21
+ "links" => links_hash,
22
+ "data" => records
23
+ }
24
+ end
25
+
26
+ private
27
+
28
+ def metadata_hash
29
+ @metadata_hash ||= {"count" => count, "limit" => limit, "offset" => offset}
30
+ end
31
+
32
+ def links_hash
33
+ @links_hash ||= {
34
+ "first" => link_to_first,
35
+ "last" => link_to_last,
36
+ "prev" => link_to_prev,
37
+ "next" => link_to_next,
38
+ }.compact
39
+ end
40
+
41
+ def link_to_first
42
+ link_with_new_offset(0)
43
+ end
44
+
45
+ def link_to_last
46
+ link_with_new_offset(max_limit_multiplier.clamp(0, Float::INFINITY) * limit)
47
+ end
48
+
49
+ def link_to_prev
50
+ return if current_limit_multiplier == 0
51
+
52
+ link_with_new_offset((current_limit_multiplier - 1) * limit)
53
+ end
54
+
55
+ def link_to_next
56
+ next_limit_multiplier = current_limit_multiplier + 1
57
+ return if next_limit_multiplier > max_limit_multiplier
58
+
59
+ link_with_new_offset(next_limit_multiplier * limit)
60
+ end
61
+
62
+ def link_with_new_offset(offset)
63
+ URI::Generic.build(:path => request_uri.path, :query => query_hash_merge("offset" => offset.to_s)).to_s
64
+ end
65
+
66
+ def query_hash_merge(new_hash)
67
+ parsed_query.merge(new_hash).to_query
68
+ end
69
+
70
+ def parsed_query
71
+ @parsed_query ||= Rack::Utils.parse_query(request_uri.query)
72
+ end
73
+
74
+ def request_uri
75
+ @request_uri ||= URI.parse(@request.original_url)
76
+ end
77
+
78
+ def current_limit_multiplier
79
+ @current_limit_multiplier ||= offset / limit
80
+ end
81
+
82
+ def max_limit_multiplier
83
+ @max_limit_multiplier ||= ((count - 1) / limit)
84
+ end
85
+
86
+ def count
87
+ @count ||= @base_query.count
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,107 @@
1
+ module ManageIQ
2
+ module API
3
+ module Common
4
+ class RequestNotSet < ArgumentError
5
+ def initialize
6
+ super("Current request has not been set")
7
+ end
8
+ end
9
+
10
+ class Request
11
+ REQUEST_ID_KEY = "x-rh-insights-request-id".freeze
12
+ IDENTITY_KEY = 'x-rh-identity'.freeze
13
+ FORWARDABLE_HEADER_KEYS = [REQUEST_ID_KEY, IDENTITY_KEY].freeze
14
+ OPTIONAL_AUTH_PATHS = [
15
+ %r{\A/api/v[0-9]+(\.[0-9]+)?/openapi.json\z},
16
+ %r{\A/api/[^/]+/v[0-9]+(\.[0-9]+)?/openapi.json\z}
17
+ ].freeze
18
+
19
+ def self.current
20
+ Thread.current[:current_request]
21
+ end
22
+
23
+ def self.current!
24
+ current || raise(RequestNotSet)
25
+ end
26
+
27
+ def self.current=(request)
28
+ Thread.current[:current_request] =
29
+ case request
30
+ when ActionDispatch::Request
31
+ new(:headers => request.headers, :original_url => request.original_url)
32
+ when Hash
33
+ new(request)
34
+ when Request, nil
35
+ request
36
+ else
37
+ raise ArgumentError, 'Not a ManageIQ::API::Common::Request or ActionDispatch::Request Class, Hash, or nil'
38
+ end
39
+ end
40
+
41
+ def self.with_request(request)
42
+ saved = current
43
+ self.current = request
44
+ yield current
45
+ ensure
46
+ self.current = saved
47
+ end
48
+
49
+ def self.current_forwardable
50
+ current!.forwardable
51
+ end
52
+
53
+ attr_reader :headers, :original_url
54
+
55
+ def initialize(headers:, original_url:, **_kwargs)
56
+ headers = from_hash(headers) if headers.kind_of?(Hash)
57
+ @headers, @original_url = headers, original_url
58
+ end
59
+
60
+ def request_id
61
+ headers.fetch(REQUEST_ID_KEY, nil)
62
+ end
63
+
64
+ def identity
65
+ @identity ||= JSON.parse(Base64.decode64(headers.fetch(IDENTITY_KEY)))
66
+ rescue KeyError
67
+ raise IdentityError, "x-rh-identity not found"
68
+ end
69
+
70
+ def user
71
+ @user ||= User.new(identity)
72
+ end
73
+
74
+ def entitlement
75
+ @entitlement ||= Entitlement.new(identity)
76
+ end
77
+
78
+ def to_h
79
+ {:headers => forwardable, :original_url => original_url}
80
+ end
81
+
82
+ def forwardable
83
+ FORWARDABLE_HEADER_KEYS.each_with_object({}) do |key, hash|
84
+ hash[key] = headers[key] if headers.key?(key)
85
+ end
86
+ end
87
+
88
+ def required_auth?
89
+ !optional_auth?
90
+ end
91
+
92
+ def optional_auth?
93
+ uri_path = URI.parse(original_url).path
94
+ OPTIONAL_AUTH_PATHS.any? { |optional_auth_path_regex| optional_auth_path_regex.match(uri_path) }
95
+ end
96
+
97
+ private
98
+
99
+ def from_hash(hash)
100
+ ActionDispatch::Http::Headers.from_hash({}).tap do |headers|
101
+ hash.each { |k, v| headers.add(k, v) }
102
+ end
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
@@ -0,0 +1,26 @@
1
+ module ManageIQ
2
+ module API
3
+ module Common
4
+ class Routing
5
+ attr_reader :route_mapper
6
+
7
+ def initialize(route_mapper)
8
+ @route_mapper = route_mapper
9
+ end
10
+
11
+ def redirect_major_version(version, prefix, via: [:delete, :get, :options, :patch, :post])
12
+ route_mapper.match(
13
+ "/#{version.split('.').first}/*path(.:format)",
14
+ :format => false,
15
+ :via => via,
16
+ :to => route_mapper.redirect(
17
+ :path => "/#{prefix}/#{version}/%{path}",
18
+ :only_path => true,
19
+ :status => 302
20
+ )
21
+ )
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,48 @@
1
+ module ManageIQ
2
+ module API
3
+ module Common
4
+ class IdentityError < StandardError; end
5
+
6
+ class User
7
+ def initialize(identity)
8
+ @identity = identity
9
+ end
10
+
11
+ %w[
12
+ username
13
+ email
14
+ first_name
15
+ is_active
16
+ is_org_admin
17
+ is_internal
18
+ last_name
19
+ locale
20
+ ].each do |m|
21
+ define_method(m.start_with?("is_") ? "#{m[3..-1]}?" : m) do
22
+ find_user_key(m)
23
+ end
24
+ end
25
+
26
+ def tenant
27
+ find_tenant_key
28
+ end
29
+
30
+ private
31
+
32
+ attr_reader :identity
33
+
34
+ def find_user_key(key)
35
+ result = identity.dig('identity', 'user', key.to_s)
36
+ raise IdentityError, "#{key} doesn't exist" if result.nil?
37
+ result
38
+ end
39
+
40
+ def find_tenant_key
41
+ result = identity.dig('identity', 'account_number')
42
+ raise IdentityError, "Tenant key doesn't exist" if result.nil?
43
+ result
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,7 @@
1
+ module ManageIQ
2
+ module API
3
+ module Common
4
+ VERSION = "0.1.0".freeze
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :manageiq_api_common do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,17 @@
1
+ module DefaultAsJson
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ let(:default_as) { :json }
6
+ prepend RequestHelpersCustomized
7
+ end
8
+
9
+ module RequestHelpersCustomized
10
+ %w[patch post put].each do |method|
11
+ define_method(method) do |path, **kwargs|
12
+ kwargs[:as] ||= default_as if default_as
13
+ super(path, kwargs)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,7 @@
1
+ require_relative "default_as_json"
2
+
3
+ module RequestSpecHelper
4
+ RSpec.configure do |config|
5
+ config.include DefaultAsJson, :type => :request
6
+ end
7
+ end
@@ -0,0 +1,62 @@
1
+ module UserHeaderSpecHelper
2
+ DEFAULT_USER = {
3
+ "entitlements" => {
4
+ "hybrid_cloud" => {
5
+ "is_entitled" => true
6
+ },
7
+ "insights" => {
8
+ "is_entitled" => true
9
+ },
10
+ "openshift" => {
11
+ "is_entitled" => true
12
+ },
13
+ "smart_management" => {
14
+ "is_entitled" => true
15
+ }
16
+ },
17
+ "identity" => {
18
+ "account_number" => "0369233",
19
+ "type" => "User",
20
+ "user" => {
21
+ "username" => "jdoe",
22
+ "email" => "jdoe@acme.com",
23
+ "first_name" => "John",
24
+ "last_name" => "Doe",
25
+ "is_active" => true,
26
+ "is_org_admin" => false,
27
+ "is_internal" => false,
28
+ "locale" => "en_US"
29
+ },
30
+ "internal" => {
31
+ "org_id" => "3340851",
32
+ "auth_type" => "basic-auth",
33
+ "auth_time" => 6300
34
+ }
35
+ }
36
+ }.freeze
37
+
38
+ def default_account_number
39
+ default_user_hash["identity"]["account_number"]
40
+ end
41
+
42
+ def default_username
43
+ default_user_hash["identity"]["user"]["username"]
44
+ end
45
+
46
+ def encode(val)
47
+ if val.kind_of?(Hash)
48
+ hashed = val.stringify_keys
49
+ Base64.strict_encode64(hashed.to_json)
50
+ else
51
+ raise StandardError, "Must be a Hash"
52
+ end
53
+ end
54
+
55
+ def encoded_user_hash(hash = nil)
56
+ encode(hash || DEFAULT_USER)
57
+ end
58
+
59
+ def default_user_hash
60
+ Marshal.load(Marshal.dump(DEFAULT_USER))
61
+ end
62
+ end
metadata ADDED
@@ -0,0 +1,375 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: manageiq-api-common
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - ManageIQ Authors
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-09-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: acts_as_tenant
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: manageiq-password
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pg
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">"
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">"
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '5.2'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 5.2.1.1
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '5.2'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 5.2.1.1
75
+ - !ruby/object:Gem::Dependency
76
+ name: manageiq-loggers
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '0.3'
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '0.3'
89
+ - !ruby/object:Gem::Dependency
90
+ name: cloudwatchlogger
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '0.2'
96
+ type: :runtime
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.2'
103
+ - !ruby/object:Gem::Dependency
104
+ name: prometheus_exporter
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: 0.4.5
110
+ type: :runtime
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: 0.4.5
117
+ - !ruby/object:Gem::Dependency
118
+ name: more_core_extensions
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ type: :runtime
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ - !ruby/object:Gem::Dependency
132
+ name: openapi_parser
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: 0.3.0
138
+ type: :runtime
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: 0.3.0
145
+ - !ruby/object:Gem::Dependency
146
+ name: graphql
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '1.9'
152
+ type: :runtime
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '1.9'
159
+ - !ruby/object:Gem::Dependency
160
+ name: graphql-batch
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: '0.4'
166
+ type: :runtime
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: '0.4'
173
+ - !ruby/object:Gem::Dependency
174
+ name: graphql-preload
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '2.0'
180
+ - - "<"
181
+ - !ruby/object:Gem::Version
182
+ version: '2.1'
183
+ type: :runtime
184
+ prerelease: false
185
+ version_requirements: !ruby/object:Gem::Requirement
186
+ requirements:
187
+ - - "~>"
188
+ - !ruby/object:Gem::Version
189
+ version: '2.0'
190
+ - - "<"
191
+ - !ruby/object:Gem::Version
192
+ version: '2.1'
193
+ - !ruby/object:Gem::Dependency
194
+ name: query_relation
195
+ requirement: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - ">="
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ type: :runtime
201
+ prerelease: false
202
+ version_requirements: !ruby/object:Gem::Requirement
203
+ requirements:
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
207
+ - !ruby/object:Gem::Dependency
208
+ name: factory_bot
209
+ requirement: !ruby/object:Gem::Requirement
210
+ requirements:
211
+ - - ">="
212
+ - !ruby/object:Gem::Version
213
+ version: '0'
214
+ type: :development
215
+ prerelease: false
216
+ version_requirements: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: '0'
221
+ - !ruby/object:Gem::Dependency
222
+ name: rake
223
+ requirement: !ruby/object:Gem::Requirement
224
+ requirements:
225
+ - - "~>"
226
+ - !ruby/object:Gem::Version
227
+ version: '10.0'
228
+ type: :development
229
+ prerelease: false
230
+ version_requirements: !ruby/object:Gem::Requirement
231
+ requirements:
232
+ - - "~>"
233
+ - !ruby/object:Gem::Version
234
+ version: '10.0'
235
+ - !ruby/object:Gem::Dependency
236
+ name: rspec
237
+ requirement: !ruby/object:Gem::Requirement
238
+ requirements:
239
+ - - "~>"
240
+ - !ruby/object:Gem::Version
241
+ version: '3.0'
242
+ type: :development
243
+ prerelease: false
244
+ version_requirements: !ruby/object:Gem::Requirement
245
+ requirements:
246
+ - - "~>"
247
+ - !ruby/object:Gem::Version
248
+ version: '3.0'
249
+ - !ruby/object:Gem::Dependency
250
+ name: rspec-mocks
251
+ requirement: !ruby/object:Gem::Requirement
252
+ requirements:
253
+ - - ">="
254
+ - !ruby/object:Gem::Version
255
+ version: '0'
256
+ type: :development
257
+ prerelease: false
258
+ version_requirements: !ruby/object:Gem::Requirement
259
+ requirements:
260
+ - - ">="
261
+ - !ruby/object:Gem::Version
262
+ version: '0'
263
+ - !ruby/object:Gem::Dependency
264
+ name: rspec-rails
265
+ requirement: !ruby/object:Gem::Requirement
266
+ requirements:
267
+ - - "~>"
268
+ - !ruby/object:Gem::Version
269
+ version: '3.8'
270
+ type: :development
271
+ prerelease: false
272
+ version_requirements: !ruby/object:Gem::Requirement
273
+ requirements:
274
+ - - "~>"
275
+ - !ruby/object:Gem::Version
276
+ version: '3.8'
277
+ - !ruby/object:Gem::Dependency
278
+ name: simplecov
279
+ requirement: !ruby/object:Gem::Requirement
280
+ requirements:
281
+ - - ">="
282
+ - !ruby/object:Gem::Version
283
+ version: '0'
284
+ type: :development
285
+ prerelease: false
286
+ version_requirements: !ruby/object:Gem::Requirement
287
+ requirements:
288
+ - - ">="
289
+ - !ruby/object:Gem::Version
290
+ version: '0'
291
+ description: Header, Encryption, RBAC, Serialization, Pagination and other common
292
+ behavior for microservices
293
+ email:
294
+ executables: []
295
+ extensions: []
296
+ extra_rdoc_files: []
297
+ files:
298
+ - LICENSE.txt
299
+ - README.md
300
+ - Rakefile
301
+ - app/models/authentication.rb
302
+ - app/models/concerns/encryption_concern.rb
303
+ - app/models/encryption.rb
304
+ - lib/generators/shared_utilities/migration_generator.rb
305
+ - lib/generators/shared_utilities/orm_helper.rb
306
+ - lib/generators/shared_utilities/templates/migration.rb
307
+ - lib/generators/shared_utilities/templates/migration_existing.rb
308
+ - lib/manageiq-api-common.rb
309
+ - lib/manageiq/api/common.rb
310
+ - lib/manageiq/api/common/api_error.rb
311
+ - lib/manageiq/api/common/application_controller_mixins/api_doc.rb
312
+ - lib/manageiq/api/common/application_controller_mixins/common.rb
313
+ - lib/manageiq/api/common/application_controller_mixins/openapi_enabled.rb
314
+ - lib/manageiq/api/common/application_controller_mixins/parameters.rb
315
+ - lib/manageiq/api/common/application_controller_mixins/request_body_validation.rb
316
+ - lib/manageiq/api/common/application_controller_mixins/request_path.rb
317
+ - lib/manageiq/api/common/engine.rb
318
+ - lib/manageiq/api/common/entitlement.rb
319
+ - lib/manageiq/api/common/error_document.rb
320
+ - lib/manageiq/api/common/filter.rb
321
+ - lib/manageiq/api/common/graphql.rb
322
+ - lib/manageiq/api/common/graphql/associated_records.rb
323
+ - lib/manageiq/api/common/graphql/association_loader.rb
324
+ - lib/manageiq/api/common/graphql/generator.rb
325
+ - lib/manageiq/api/common/graphql/templates/model_type.erb
326
+ - lib/manageiq/api/common/graphql/templates/query_type.erb
327
+ - lib/manageiq/api/common/graphql/templates/schema.erb
328
+ - lib/manageiq/api/common/graphql/types/big_int.rb
329
+ - lib/manageiq/api/common/graphql/types/date_time.rb
330
+ - lib/manageiq/api/common/graphql/types/query_filter.rb
331
+ - lib/manageiq/api/common/inflections.rb
332
+ - lib/manageiq/api/common/logging.rb
333
+ - lib/manageiq/api/common/metrics.rb
334
+ - lib/manageiq/api/common/middleware/web_server_metrics.rb
335
+ - lib/manageiq/api/common/open_api.rb
336
+ - lib/manageiq/api/common/open_api/docs.rb
337
+ - lib/manageiq/api/common/open_api/docs/component_collection.rb
338
+ - lib/manageiq/api/common/open_api/docs/doc_v3.rb
339
+ - lib/manageiq/api/common/open_api/docs/object_definition.rb
340
+ - lib/manageiq/api/common/open_api/generator.rb
341
+ - lib/manageiq/api/common/open_api/serializer.rb
342
+ - lib/manageiq/api/common/option_redirect_enhancements.rb
343
+ - lib/manageiq/api/common/paginated_response.rb
344
+ - lib/manageiq/api/common/request.rb
345
+ - lib/manageiq/api/common/routing.rb
346
+ - lib/manageiq/api/common/user.rb
347
+ - lib/manageiq/api/common/version.rb
348
+ - lib/tasks/manageiq/api/common_tasks.rake
349
+ - spec/support/default_as_json.rb
350
+ - spec/support/requests_spec_helper.rb
351
+ - spec/support/user_header_spec_helper.rb
352
+ homepage: https://github.com/ManageIQ/manageiq-api-common.git
353
+ licenses:
354
+ - Apache-2.0
355
+ metadata: {}
356
+ post_install_message:
357
+ rdoc_options: []
358
+ require_paths:
359
+ - lib
360
+ required_ruby_version: !ruby/object:Gem::Requirement
361
+ requirements:
362
+ - - ">="
363
+ - !ruby/object:Gem::Version
364
+ version: '0'
365
+ required_rubygems_version: !ruby/object:Gem::Requirement
366
+ requirements:
367
+ - - ">="
368
+ - !ruby/object:Gem::Version
369
+ version: '0'
370
+ requirements: []
371
+ rubygems_version: 3.0.6
372
+ signing_key:
373
+ specification_version: 4
374
+ summary: Common Utilites for Microservices
375
+ test_files: []