insights-api-common 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +202 -0
- data/README.md +102 -0
- data/Rakefile +18 -0
- data/app/models/authentication.rb +19 -0
- data/app/models/concerns/encryption_concern.rb +52 -0
- data/app/models/encryption.rb +13 -0
- data/lib/generators/shared_utilities/migration_generator.rb +79 -0
- data/lib/generators/shared_utilities/orm_helper.rb +25 -0
- data/lib/generators/shared_utilities/templates/migration.rb +27 -0
- data/lib/generators/shared_utilities/templates/migration_existing.rb +28 -0
- data/lib/insights.rb +1 -0
- data/lib/insights/api/common.rb +12 -0
- data/lib/insights/api/common/application_controller_mixins/api_doc.rb +39 -0
- data/lib/insights/api/common/application_controller_mixins/common.rb +27 -0
- data/lib/insights/api/common/application_controller_mixins/exception_handling.rb +41 -0
- data/lib/insights/api/common/application_controller_mixins/openapi_enabled.rb +13 -0
- data/lib/insights/api/common/application_controller_mixins/parameters.rb +134 -0
- data/lib/insights/api/common/application_controller_mixins/request_body_validation.rb +48 -0
- data/lib/insights/api/common/application_controller_mixins/request_parameter_validation.rb +29 -0
- data/lib/insights/api/common/application_controller_mixins/request_path.rb +70 -0
- data/lib/insights/api/common/engine.rb +20 -0
- data/lib/insights/api/common/entitlement.rb +37 -0
- data/lib/insights/api/common/error_document.rb +29 -0
- data/lib/insights/api/common/filter.rb +175 -0
- data/lib/insights/api/common/graphql.rb +127 -0
- data/lib/insights/api/common/graphql/associated_records.rb +44 -0
- data/lib/insights/api/common/graphql/association_loader.rb +35 -0
- data/lib/insights/api/common/graphql/generator.rb +148 -0
- data/lib/insights/api/common/graphql/templates/model_type.erb +35 -0
- data/lib/insights/api/common/graphql/templates/query_type.erb +49 -0
- data/lib/insights/api/common/graphql/templates/schema.erb +6 -0
- data/lib/insights/api/common/graphql/types/big_int.rb +23 -0
- data/lib/insights/api/common/graphql/types/date_time.rb +16 -0
- data/lib/insights/api/common/graphql/types/query_filter.rb +16 -0
- data/lib/insights/api/common/graphql/types/query_sort_by.rb +16 -0
- data/lib/insights/api/common/inflections.rb +28 -0
- data/lib/insights/api/common/logging.rb +17 -0
- data/lib/insights/api/common/metrics.rb +39 -0
- data/lib/insights/api/common/middleware/web_server_metrics.rb +62 -0
- data/lib/insights/api/common/open_api.rb +2 -0
- data/lib/insights/api/common/open_api/docs.rb +54 -0
- data/lib/insights/api/common/open_api/docs/component_collection.rb +67 -0
- data/lib/insights/api/common/open_api/docs/doc_v3.rb +102 -0
- data/lib/insights/api/common/open_api/docs/object_definition.rb +39 -0
- data/lib/insights/api/common/open_api/generator.rb +520 -0
- data/lib/insights/api/common/open_api/serializer.rb +31 -0
- data/lib/insights/api/common/option_redirect_enhancements.rb +23 -0
- data/lib/insights/api/common/paginated_response.rb +108 -0
- data/lib/insights/api/common/rbac/access.rb +66 -0
- data/lib/insights/api/common/rbac/acl.rb +74 -0
- data/lib/insights/api/common/rbac/policies.rb +33 -0
- data/lib/insights/api/common/rbac/query_shared_resource.rb +45 -0
- data/lib/insights/api/common/rbac/roles.rb +77 -0
- data/lib/insights/api/common/rbac/seed.rb +140 -0
- data/lib/insights/api/common/rbac/service.rb +67 -0
- data/lib/insights/api/common/rbac/share_resource.rb +60 -0
- data/lib/insights/api/common/rbac/unshare_resource.rb +32 -0
- data/lib/insights/api/common/rbac/utilities.rb +30 -0
- data/lib/insights/api/common/request.rb +111 -0
- data/lib/insights/api/common/routing.rb +26 -0
- data/lib/insights/api/common/user.rb +48 -0
- data/lib/insights/api/common/version.rb +7 -0
- data/lib/tasks/insights/api/common_tasks.rake +4 -0
- data/spec/support/default_as_json.rb +17 -0
- data/spec/support/rbac_shared_contexts.rb +44 -0
- data/spec/support/requests_spec_helper.rb +7 -0
- data/spec/support/service_spec_helper.rb +26 -0
- data/spec/support/user_header_spec_helper.rb +68 -0
- metadata +403 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
module Insights
|
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,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,44 @@
|
|
1
|
+
RSpec.shared_context "rbac_objects" do
|
2
|
+
let(:app_name) { 'catalog' }
|
3
|
+
let(:resource) { "portfolios" }
|
4
|
+
let(:permissions) { ["#{app_name}:#{resource}:read"] }
|
5
|
+
let(:resource_id1) { "1" }
|
6
|
+
let(:resource_id2) { "2" }
|
7
|
+
let(:resource_id3) { "3" }
|
8
|
+
let(:group1) { instance_double(RBACApiClient::GroupOut, :name => 'group1', :uuid => "123") }
|
9
|
+
let(:group2) { instance_double(RBACApiClient::GroupOut, :name => 'group2', :uuid => "12345") }
|
10
|
+
let(:group3) { instance_double(RBACApiClient::GroupOut, :name => 'group3', :uuid => "45665") }
|
11
|
+
let(:role1) { instance_double(RBACApiClient::RoleOut, :name => "#{app_name}-#{resource}-#{resource_id1}-group-#{group1.uuid}", :uuid => "67899") }
|
12
|
+
let(:role2) { instance_double(RBACApiClient::RoleOut, :name => "#{app_name}-#{resource}-#{resource_id2}-group-#{group1.uuid}", :uuid => "55555") }
|
13
|
+
let(:role1_detail) { instance_double(RBACApiClient::RoleWithAccess, :name => role1.name, :uuid => role1.uuid, :access => [access1]) }
|
14
|
+
let(:role2_detail) { instance_double(RBACApiClient::RoleWithAccess, :name => role2.name, :uuid => role2.uuid, :access => []) }
|
15
|
+
let(:role1_detail_updated) { instance_double(RBACApiClient::RoleWithAccess, :name => role1.name, :uuid => role1.uuid, :access => []) }
|
16
|
+
let(:groups) { [group1, group2, group3] }
|
17
|
+
let(:roles) { [role1] }
|
18
|
+
let(:policies) { [instance_double(RBACApiClient::PolicyIn, :group => group1, :roles => roles)] }
|
19
|
+
let(:filter1) { instance_double(RBACApiClient::ResourceDefinitionFilter, :key => 'id', :operation => 'equal', :value => resource_id1) }
|
20
|
+
let(:resource_def1) { instance_double(RBACApiClient::ResourceDefinition, :attribute_filter => filter1) }
|
21
|
+
let(:filter2) { instance_double(RBACApiClient::ResourceDefinitionFilter, :key => 'id', :operation => 'equal', :value => resource_id2) }
|
22
|
+
let(:resource_def2) { instance_double(RBACApiClient::ResourceDefinition, :attribute_filter => filter2) }
|
23
|
+
let(:filter3) { instance_double(RBACApiClient::ResourceDefinitionFilter, :key => 'id', :operation => 'equal', :value => resource_id3) }
|
24
|
+
let(:resource_def3) { instance_double(RBACApiClient::ResourceDefinition, :attribute_filter => filter3) }
|
25
|
+
let(:filter4) { instance_double(RBACApiClient::ResourceDefinitionFilter, :key => 'id', :operation => 'equal', :value => '*') }
|
26
|
+
let(:resource_def4) { instance_double(RBACApiClient::ResourceDefinition, :attribute_filter => filter4) }
|
27
|
+
let(:access1) { instance_double(RBACApiClient::Access, :permission => "#{app_name}:#{resource}:read", :resource_definitions => [resource_def1]) }
|
28
|
+
let(:access2) { instance_double(RBACApiClient::Access, :permission => "#{app_name}:#{resource}:write", :resource_definitions => [resource_def2]) }
|
29
|
+
let(:access3) { instance_double(RBACApiClient::Access, :permission => "#{app_name}:#{resource}:order", :resource_definitions => []) }
|
30
|
+
let(:admin_access) { instance_double(RBACApiClient::Access, :permission => "#{app_name}:#{resource}:read", :resource_definitions => [resource_def4]) }
|
31
|
+
let(:group_uuids) { [group1.uuid, group2.uuid, group3.uuid] }
|
32
|
+
let(:api_instance) { double }
|
33
|
+
let(:rs_class) { class_double("Insights::API::Common::RBAC::Service").as_stubbed_const(:transfer_nested_constants => true) }
|
34
|
+
let(:current_user) { '{{username}}' }
|
35
|
+
let(:id_value) { '*' }
|
36
|
+
let(:owner_filter) { instance_double(RBACApiClient::ResourceDefinitionFilter, :key => 'owner', :operation => 'equal', :value => current_user) }
|
37
|
+
let(:owner_resource_def) { instance_double(RBACApiClient::ResourceDefinition, :attribute_filter => owner_filter) }
|
38
|
+
let(:id_filter) { instance_double(RBACApiClient::ResourceDefinitionFilter, :key => 'id', :operation => 'equal', :value => id_value) }
|
39
|
+
let(:id_resource_def) { instance_double(RBACApiClient::ResourceDefinition, :attribute_filter => id_filter) }
|
40
|
+
let(:owner_resource) { 'orders' }
|
41
|
+
let(:owner_permission) { "#{app_name}:#{owner_resource}:read" }
|
42
|
+
let(:owner_access) { instance_double(RBACApiClient::Access, :permission => owner_permission, :resource_definitions => [owner_resource_def]) }
|
43
|
+
let(:all_access) { instance_double(RBACApiClient::Access, :permission => owner_permission, :resource_definitions => [id_resource_def]) }
|
44
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module ServiceSpecHelper
|
2
|
+
RSpec.configure do |config|
|
3
|
+
config.around(:example, :type => :service) do |example|
|
4
|
+
default_tenant = Tenant.first_or_create!(:external_tenant => default_account_number)
|
5
|
+
|
6
|
+
ActsAsTenant.with_tenant(default_tenant) do
|
7
|
+
example.call
|
8
|
+
end
|
9
|
+
|
10
|
+
Tenant.delete_all
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def default_headers
|
15
|
+
{ 'x-rh-identity' => encoded_user_hash,
|
16
|
+
'x-rh-insights-request-id' => 'gobbledygook' }
|
17
|
+
end
|
18
|
+
|
19
|
+
def original_url
|
20
|
+
"http://example.com"
|
21
|
+
end
|
22
|
+
|
23
|
+
def default_request
|
24
|
+
{ :headers => default_headers, :original_url => original_url }
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module UserHeaderSpecHelper
|
2
|
+
DEFAULT_USER = {
|
3
|
+
"entitlements" => {
|
4
|
+
"ansible" => {
|
5
|
+
"is_entitled" => true
|
6
|
+
},
|
7
|
+
"hybrid_cloud" => {
|
8
|
+
"is_entitled" => true
|
9
|
+
},
|
10
|
+
"insights" => {
|
11
|
+
"is_entitled" => true
|
12
|
+
},
|
13
|
+
"migrations" => {
|
14
|
+
"is_entitled" => true
|
15
|
+
},
|
16
|
+
"openshift" => {
|
17
|
+
"is_entitled" => true
|
18
|
+
},
|
19
|
+
"smart_management" => {
|
20
|
+
"is_entitled" => true
|
21
|
+
}
|
22
|
+
},
|
23
|
+
"identity" => {
|
24
|
+
"account_number" => "0369233",
|
25
|
+
"type" => "User",
|
26
|
+
"user" => {
|
27
|
+
"username" => "jdoe",
|
28
|
+
"email" => "jdoe@acme.com",
|
29
|
+
"first_name" => "John",
|
30
|
+
"last_name" => "Doe",
|
31
|
+
"is_active" => true,
|
32
|
+
"is_org_admin" => false,
|
33
|
+
"is_internal" => false,
|
34
|
+
"locale" => "en_US"
|
35
|
+
},
|
36
|
+
"internal" => {
|
37
|
+
"org_id" => "3340851",
|
38
|
+
"auth_type" => "basic-auth",
|
39
|
+
"auth_time" => 6300
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}.freeze
|
43
|
+
|
44
|
+
def default_account_number
|
45
|
+
default_user_hash["identity"]["account_number"]
|
46
|
+
end
|
47
|
+
|
48
|
+
def default_username
|
49
|
+
default_user_hash["identity"]["user"]["username"]
|
50
|
+
end
|
51
|
+
|
52
|
+
def encode(val)
|
53
|
+
if val.kind_of?(Hash)
|
54
|
+
hashed = val.stringify_keys
|
55
|
+
Base64.strict_encode64(hashed.to_json)
|
56
|
+
else
|
57
|
+
raise StandardError, "Must be a Hash"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def encoded_user_hash(hash = nil)
|
62
|
+
encode(hash || DEFAULT_USER)
|
63
|
+
end
|
64
|
+
|
65
|
+
def default_user_hash
|
66
|
+
Marshal.load(Marshal.dump(DEFAULT_USER))
|
67
|
+
end
|
68
|
+
end
|
metadata
ADDED
@@ -0,0 +1,403 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: insights-api-common
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Insights Authors
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-11-08 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.6.1
|
138
|
+
type: :runtime
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: 0.6.1
|
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
|
+
- !ruby/object:Gem::Dependency
|
292
|
+
name: webmock
|
293
|
+
requirement: !ruby/object:Gem::Requirement
|
294
|
+
requirements:
|
295
|
+
- - ">="
|
296
|
+
- !ruby/object:Gem::Version
|
297
|
+
version: '0'
|
298
|
+
type: :development
|
299
|
+
prerelease: false
|
300
|
+
version_requirements: !ruby/object:Gem::Requirement
|
301
|
+
requirements:
|
302
|
+
- - ">="
|
303
|
+
- !ruby/object:Gem::Version
|
304
|
+
version: '0'
|
305
|
+
description: Header, Encryption, RBAC, Serialization, Pagination and other common
|
306
|
+
behavior for Insights microservices built with Rails
|
307
|
+
email:
|
308
|
+
executables: []
|
309
|
+
extensions: []
|
310
|
+
extra_rdoc_files: []
|
311
|
+
files:
|
312
|
+
- LICENSE.txt
|
313
|
+
- README.md
|
314
|
+
- Rakefile
|
315
|
+
- app/models/authentication.rb
|
316
|
+
- app/models/concerns/encryption_concern.rb
|
317
|
+
- app/models/encryption.rb
|
318
|
+
- lib/generators/shared_utilities/migration_generator.rb
|
319
|
+
- lib/generators/shared_utilities/orm_helper.rb
|
320
|
+
- lib/generators/shared_utilities/templates/migration.rb
|
321
|
+
- lib/generators/shared_utilities/templates/migration_existing.rb
|
322
|
+
- lib/insights.rb
|
323
|
+
- lib/insights/api/common.rb
|
324
|
+
- lib/insights/api/common/application_controller_mixins/api_doc.rb
|
325
|
+
- lib/insights/api/common/application_controller_mixins/common.rb
|
326
|
+
- lib/insights/api/common/application_controller_mixins/exception_handling.rb
|
327
|
+
- lib/insights/api/common/application_controller_mixins/openapi_enabled.rb
|
328
|
+
- lib/insights/api/common/application_controller_mixins/parameters.rb
|
329
|
+
- lib/insights/api/common/application_controller_mixins/request_body_validation.rb
|
330
|
+
- lib/insights/api/common/application_controller_mixins/request_parameter_validation.rb
|
331
|
+
- lib/insights/api/common/application_controller_mixins/request_path.rb
|
332
|
+
- lib/insights/api/common/engine.rb
|
333
|
+
- lib/insights/api/common/entitlement.rb
|
334
|
+
- lib/insights/api/common/error_document.rb
|
335
|
+
- lib/insights/api/common/filter.rb
|
336
|
+
- lib/insights/api/common/graphql.rb
|
337
|
+
- lib/insights/api/common/graphql/associated_records.rb
|
338
|
+
- lib/insights/api/common/graphql/association_loader.rb
|
339
|
+
- lib/insights/api/common/graphql/generator.rb
|
340
|
+
- lib/insights/api/common/graphql/templates/model_type.erb
|
341
|
+
- lib/insights/api/common/graphql/templates/query_type.erb
|
342
|
+
- lib/insights/api/common/graphql/templates/schema.erb
|
343
|
+
- lib/insights/api/common/graphql/types/big_int.rb
|
344
|
+
- lib/insights/api/common/graphql/types/date_time.rb
|
345
|
+
- lib/insights/api/common/graphql/types/query_filter.rb
|
346
|
+
- lib/insights/api/common/graphql/types/query_sort_by.rb
|
347
|
+
- lib/insights/api/common/inflections.rb
|
348
|
+
- lib/insights/api/common/logging.rb
|
349
|
+
- lib/insights/api/common/metrics.rb
|
350
|
+
- lib/insights/api/common/middleware/web_server_metrics.rb
|
351
|
+
- lib/insights/api/common/open_api.rb
|
352
|
+
- lib/insights/api/common/open_api/docs.rb
|
353
|
+
- lib/insights/api/common/open_api/docs/component_collection.rb
|
354
|
+
- lib/insights/api/common/open_api/docs/doc_v3.rb
|
355
|
+
- lib/insights/api/common/open_api/docs/object_definition.rb
|
356
|
+
- lib/insights/api/common/open_api/generator.rb
|
357
|
+
- lib/insights/api/common/open_api/serializer.rb
|
358
|
+
- lib/insights/api/common/option_redirect_enhancements.rb
|
359
|
+
- lib/insights/api/common/paginated_response.rb
|
360
|
+
- lib/insights/api/common/rbac/access.rb
|
361
|
+
- lib/insights/api/common/rbac/acl.rb
|
362
|
+
- lib/insights/api/common/rbac/policies.rb
|
363
|
+
- lib/insights/api/common/rbac/query_shared_resource.rb
|
364
|
+
- lib/insights/api/common/rbac/roles.rb
|
365
|
+
- lib/insights/api/common/rbac/seed.rb
|
366
|
+
- lib/insights/api/common/rbac/service.rb
|
367
|
+
- lib/insights/api/common/rbac/share_resource.rb
|
368
|
+
- lib/insights/api/common/rbac/unshare_resource.rb
|
369
|
+
- lib/insights/api/common/rbac/utilities.rb
|
370
|
+
- lib/insights/api/common/request.rb
|
371
|
+
- lib/insights/api/common/routing.rb
|
372
|
+
- lib/insights/api/common/user.rb
|
373
|
+
- lib/insights/api/common/version.rb
|
374
|
+
- lib/tasks/insights/api/common_tasks.rake
|
375
|
+
- spec/support/default_as_json.rb
|
376
|
+
- spec/support/rbac_shared_contexts.rb
|
377
|
+
- spec/support/requests_spec_helper.rb
|
378
|
+
- spec/support/service_spec_helper.rb
|
379
|
+
- spec/support/user_header_spec_helper.rb
|
380
|
+
homepage: https://github.com/RedHatInsights/insights-api-common-rails.git
|
381
|
+
licenses:
|
382
|
+
- Apache-2.0
|
383
|
+
metadata: {}
|
384
|
+
post_install_message:
|
385
|
+
rdoc_options: []
|
386
|
+
require_paths:
|
387
|
+
- lib
|
388
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
389
|
+
requirements:
|
390
|
+
- - ">="
|
391
|
+
- !ruby/object:Gem::Version
|
392
|
+
version: '0'
|
393
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
394
|
+
requirements:
|
395
|
+
- - ">="
|
396
|
+
- !ruby/object:Gem::Version
|
397
|
+
version: '0'
|
398
|
+
requirements: []
|
399
|
+
rubygems_version: 3.0.6
|
400
|
+
signing_key:
|
401
|
+
specification_version: 4
|
402
|
+
summary: Common Utilites for Insights microservices
|
403
|
+
test_files: []
|