strongdm 1.0.0 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/LICENSE.html +45 -136
- data/doc/Object.html +623 -105
- data/doc/README_md.html +15 -7
- data/doc/SDM.html +16 -24
- data/doc/SDM/AKS.html +150 -52
- data/doc/SDM/AKSBasicAuth.html +130 -36
- data/doc/SDM/AKSServiceAccount.html +125 -32
- data/doc/SDM/AccountAttachment.html +77 -27
- data/doc/SDM/AccountAttachmentCreateOptions.html +62 -13
- data/doc/SDM/AccountAttachmentCreateResponse.html +75 -24
- data/doc/SDM/AccountAttachmentDeleteResponse.html +69 -19
- data/doc/SDM/AccountAttachmentGetResponse.html +75 -23
- data/doc/SDM/AccountAttachments.html +62 -61
- data/doc/SDM/AccountCreateResponse.html +80 -27
- data/doc/SDM/AccountDeleteResponse.html +69 -17
- data/doc/SDM/AccountGetResponse.html +74 -21
- data/doc/SDM/AccountGrant.html +89 -39
- data/doc/SDM/AccountGrantCreateResponse.html +75 -23
- data/doc/SDM/AccountGrantDeleteResponse.html +69 -18
- data/doc/SDM/AccountGrantGetResponse.html +75 -22
- data/doc/SDM/AccountGrants.html +63 -58
- data/doc/SDM/AccountUpdateResponse.html +74 -21
- data/doc/SDM/Accounts.html +74 -68
- data/doc/SDM/AlreadyExistsError.html +13 -10
- data/doc/SDM/AmazonEKS.html +163 -48
- data/doc/SDM/AmazonES.html +117 -40
- data/doc/SDM/Athena.html +117 -40
- data/doc/SDM/AuroraMysql.html +122 -44
- data/doc/SDM/AuroraPostgres.html +127 -48
- data/doc/SDM/AuthenticationError.html +13 -10
- data/doc/SDM/BadRequestError.html +13 -10
- data/doc/SDM/BigQuery.html +117 -40
- data/doc/SDM/Cassandra.html +122 -44
- data/doc/SDM/Citus.html +409 -0
- data/doc/SDM/Client.html +29 -48
- data/doc/SDM/Clustrix.html +122 -44
- data/doc/SDM/Cockroach.html +127 -48
- data/doc/SDM/CreateResponseMetadata.html +59 -9
- data/doc/SDM/DB2.html +391 -0
- data/doc/SDM/DeadlineExceededError.html +13 -10
- data/doc/SDM/DeleteResponseMetadata.html +60 -10
- data/doc/SDM/Druid.html +117 -40
- data/doc/SDM/DynamoDB.html +117 -40
- data/doc/SDM/Elastic.html +122 -44
- data/doc/SDM/ElasticacheRedis.html +117 -40
- data/doc/SDM/Gateway.html +108 -39
- data/doc/SDM/GetResponseMetadata.html +60 -10
- data/doc/SDM/GoogleGKE.html +135 -40
- data/doc/SDM/Greenplum.html +127 -48
- data/doc/SDM/HTTPAuth.html +122 -44
- data/doc/SDM/HTTPBasicAuth.html +127 -48
- data/doc/SDM/HTTPNoAuth.html +117 -40
- data/doc/SDM/InternalError.html +13 -10
- data/doc/SDM/Kubernetes.html +150 -52
- data/doc/SDM/KubernetesBasicAuth.html +130 -36
- data/doc/SDM/KubernetesServiceAccount.html +125 -32
- data/doc/SDM/Maria.html +122 -44
- data/doc/SDM/Memcached.html +107 -32
- data/doc/SDM/Memsql.html +122 -44
- data/doc/SDM/MongoHost.html +127 -48
- data/doc/SDM/MongoLegacyHost.html +132 -52
- data/doc/SDM/MongoLegacyReplicaset.html +137 -56
- data/doc/SDM/MongoReplicaSet.html +137 -56
- data/doc/SDM/Mysql.html +122 -44
- data/doc/SDM/NodeCreateResponse.html +80 -27
- data/doc/SDM/NodeDeleteResponse.html +69 -17
- data/doc/SDM/NodeGetResponse.html +74 -21
- data/doc/SDM/NodeUpdateResponse.html +74 -21
- data/doc/SDM/Nodes.html +75 -70
- data/doc/SDM/NotFoundError.html +13 -10
- data/doc/SDM/Oracle.html +127 -48
- data/doc/SDM/PermissionError.html +13 -10
- data/doc/SDM/Plumbing.html +4177 -3576
- data/doc/SDM/Postgres.html +127 -48
- data/doc/SDM/Presto.html +127 -48
- data/doc/SDM/RDP.html +117 -40
- data/doc/SDM/RPCError.html +12 -8
- data/doc/SDM/RateLimitError.html +13 -10
- data/doc/SDM/RateLimitMetadata.html +81 -29
- data/doc/SDM/Redis.html +112 -36
- data/doc/SDM/Redshift.html +127 -48
- data/doc/SDM/Relay.html +96 -27
- data/doc/SDM/ResourceCreateResponse.html +74 -21
- data/doc/SDM/ResourceDeleteResponse.html +69 -17
- data/doc/SDM/ResourceGetResponse.html +74 -21
- data/doc/SDM/ResourceUpdateResponse.html +74 -22
- data/doc/SDM/Resources.html +71 -63
- data/doc/SDM/Role.html +96 -27
- data/doc/SDM/RoleAttachment.html +77 -26
- data/doc/SDM/RoleAttachmentCreateResponse.html +75 -24
- data/doc/SDM/RoleAttachmentDeleteResponse.html +69 -19
- data/doc/SDM/RoleAttachmentGetResponse.html +75 -22
- data/doc/SDM/RoleAttachments.html +63 -60
- data/doc/SDM/RoleCreateResponse.html +75 -23
- data/doc/SDM/RoleDeleteResponse.html +69 -17
- data/doc/SDM/RoleGetResponse.html +75 -22
- data/doc/SDM/RoleGrant.html +77 -24
- data/doc/SDM/RoleGrantCreateResponse.html +75 -23
- data/doc/SDM/RoleGrantDeleteResponse.html +69 -18
- data/doc/SDM/RoleGrantGetResponse.html +75 -22
- data/doc/SDM/RoleGrants.html +63 -60
- data/doc/SDM/RoleUpdateResponse.html +75 -23
- data/doc/SDM/Roles.html +76 -74
- data/doc/SDM/SQLServer.html +132 -52
- data/doc/SDM/SSH.html +135 -40
- data/doc/SDM/SSHCert.html +373 -0
- data/doc/SDM/Service.html +95 -25
- data/doc/SDM/Snowflake.html +122 -44
- data/doc/SDM/Sybase.html +117 -40
- data/doc/SDM/SybaseIQ.html +117 -40
- data/doc/SDM/Teradata.html +117 -40
- data/doc/SDM/UpdateResponseMetadata.html +60 -10
- data/doc/SDM/User.html +104 -31
- data/doc/V1.html +35 -11
- data/doc/V1/AccountAttachments.html +10 -6
- data/doc/V1/AccountAttachments/Service.html +11 -8
- data/doc/V1/AccountGrants.html +10 -6
- data/doc/V1/AccountGrants/Service.html +11 -9
- data/doc/V1/Accounts.html +10 -6
- data/doc/V1/Accounts/Service.html +12 -10
- data/doc/V1/Nodes.html +10 -6
- data/doc/V1/Nodes/Service.html +13 -13
- data/doc/V1/Resources.html +10 -6
- data/doc/V1/Resources/Service.html +10 -6
- data/doc/V1/RoleAttachments.html +10 -6
- data/doc/V1/RoleAttachments/Service.html +11 -11
- data/doc/V1/RoleGrants.html +10 -6
- data/doc/V1/RoleGrants/Service.html +11 -11
- data/doc/V1/Roles.html +10 -6
- data/doc/V1/Roles/Service.html +11 -12
- data/doc/V1/Tags.html +113 -0
- data/doc/created.rid +45 -37
- data/doc/css/fonts.css +6 -6
- data/doc/css/rdoc.css +22 -1
- data/doc/examples/Gemfile.html +14 -4
- data/doc/examples/Gemfile_lock.html +14 -4
- data/doc/examples/README_md.html +14 -4
- data/doc/examples/okta-sync/Gemfile.html +105 -0
- data/doc/examples/okta-sync/Gemfile_lock.html +146 -0
- data/doc/index.html +23 -10
- data/doc/js/darkfish.js +23 -100
- data/doc/js/navigation.js +4 -41
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +32 -31
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +7 -6
- data/doc/js/searcher.js.gz +0 -0
- data/doc/lib/version.html +16 -6
- data/doc/strongdm_gemspec.html +15 -5
- data/doc/table_of_contents.html +1587 -771
- data/examples/Gemfile +2 -2
- data/examples/ldap-sync/ldapSync.rb +290 -0
- data/examples/listUsers.rb +8 -8
- data/examples/okta-sync/Gemfile +4 -0
- data/examples/okta-sync/Gemfile.lock +38 -0
- data/examples/okta-sync/matchers.yml +11 -0
- data/examples/okta-sync/oktaSync.rb +173 -0
- data/examples/panicButton.rb +103 -119
- data/lib/errors/errors.rb +55 -53
- data/lib/grpc/account_attachments_pb.rb +9 -14
- data/lib/grpc/account_attachments_services_pb.rb +7 -8
- data/lib/grpc/account_grants_pb.rb +10 -10
- data/lib/grpc/account_grants_services_pb.rb +8 -9
- data/lib/grpc/accounts_pb.rb +12 -9
- data/lib/grpc/accounts_services_pb.rb +7 -8
- data/lib/grpc/drivers_pb.rb +104 -7
- data/lib/grpc/nodes_pb.rb +12 -9
- data/lib/grpc/nodes_services_pb.rb +7 -8
- data/lib/grpc/options_pb.rb +16 -5
- data/lib/grpc/plumbing.rb +4367 -4084
- data/lib/grpc/protoc-gen-swagger/options/annotations_pb.rb +4 -4
- data/lib/grpc/resources_pb.rb +9 -9
- data/lib/grpc/resources_services_pb.rb +7 -8
- data/lib/grpc/role_attachments_pb.rb +9 -9
- data/lib/grpc/role_attachments_services_pb.rb +7 -8
- data/lib/grpc/role_grants_pb.rb +9 -9
- data/lib/grpc/role_grants_services_pb.rb +7 -8
- data/lib/grpc/roles_pb.rb +11 -9
- data/lib/grpc/roles_services_pb.rb +7 -8
- data/lib/grpc/spec_pb.rb +7 -8
- data/lib/grpc/tags_pb.rb +36 -0
- data/lib/models/porcelain.rb +4966 -4017
- data/lib/strongdm.rb +94 -95
- data/lib/svc.rb +1200 -1224
- data/lib/version +16 -2
- data/lib/version.rb +6 -6
- data/strongdm.gemspec +10 -10
- metadata +27 -15
data/examples/panicButton.rb
CHANGED
@@ -1,18 +1,4 @@
|
|
1
1
|
# Copyright 2020 StrongDM Inc
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
#
|
15
|
-
# Copyright 2020 StrongDM Inc
|
16
2
|
#
|
17
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
18
4
|
# you may not use this file except in compliance with the License.
|
@@ -26,7 +12,6 @@
|
|
26
12
|
# See the License for the specific language governing permissions and
|
27
13
|
# limitations under the License.
|
28
14
|
#
|
29
|
-
|
30
15
|
require "strongdm"
|
31
16
|
require "OpenSSL"
|
32
17
|
require "JSON"
|
@@ -38,117 +23,116 @@ require "JSON"
|
|
38
23
|
# to revert back to pre-panic state:
|
39
24
|
# ruby panicButton.rb revert
|
40
25
|
def main
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
26
|
+
access_key = ENV["SDM_API_ACCESS_KEY"]
|
27
|
+
secret_key = ENV["SDM_API_SECRET_KEY"]
|
28
|
+
if access_key == nil or secret_key == nil
|
29
|
+
puts "SDM_API_ACCESS_KEY and SDM_API_SECRET_KEY must be provided"
|
30
|
+
return
|
31
|
+
end
|
32
|
+
client = SDM::Client.new(access_key, secret_key)
|
33
|
+
|
34
|
+
if ARGV.size == 1 and ARGV[0] == "revert"
|
35
|
+
state_file = File.open("state.json")
|
36
|
+
state = JSON.load(state_file)
|
37
|
+
|
38
|
+
reinstated_count = 0
|
39
|
+
|
40
|
+
users = client.accounts.list("")
|
41
|
+
users.each { |user|
|
42
|
+
if user.suspended
|
43
|
+
reinstated_count += 1
|
44
|
+
user.suspended = false
|
45
|
+
client.accounts.update(user)
|
46
|
+
end
|
47
|
+
}
|
48
|
+
state["attachments"].each { |attachment|
|
49
|
+
begin
|
50
|
+
a = SDM::AccountAttachment.new()
|
51
|
+
a.account_id = attachment["account_id"]
|
52
|
+
a.role_id = attachment["role_id"]
|
53
|
+
client.account_attachments.create(a)
|
54
|
+
rescue SDM::AlreadyExistsError
|
55
|
+
rescue => ex
|
56
|
+
puts "skipping creation of attachment due to error: " + ex.to_s
|
57
|
+
end
|
58
|
+
}
|
59
|
+
state["grants"].each { |attachment|
|
60
|
+
begin
|
61
|
+
g = SDM::AccountGrant.new()
|
62
|
+
g.account_id = attachment["account_id"]
|
63
|
+
g.resource_id = attachment["resource_id"]
|
64
|
+
client.account_grants.create(g)
|
65
|
+
rescue SDM::AlreadyExistsError
|
66
|
+
rescue => ex
|
67
|
+
puts "skipping creation of grant due to error: " + ex.to_s
|
68
|
+
end
|
69
|
+
}
|
54
70
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
71
|
+
puts "reinstated " + reinstated_count.to_s + " users"
|
72
|
+
puts "recreated " + state["attachments"].size.to_s + " account attachments"
|
73
|
+
puts "recreated " + state["grants"].size.to_s + " account grants"
|
74
|
+
|
75
|
+
return
|
76
|
+
end
|
77
|
+
|
78
|
+
admin_email = ""
|
79
|
+
if ARGV.size == 1
|
80
|
+
admin_email = ARGV[0]
|
81
|
+
else
|
82
|
+
puts "please provide an admin email to preserve"
|
83
|
+
return 1
|
84
|
+
end
|
85
|
+
|
86
|
+
admin_user_id = ""
|
87
|
+
users = client.accounts.list("email:?", admin_email)
|
88
|
+
users.each { |user|
|
89
|
+
admin_user_id = user.id
|
90
|
+
}
|
91
|
+
|
92
|
+
account_attachments = client.account_attachments.list("")
|
93
|
+
account_grants = client.account_grants.list("")
|
94
|
+
|
95
|
+
state = {
|
96
|
+
'attachments': account_attachments.map { |x|
|
97
|
+
if x.account_id != admin_user_id
|
98
|
+
out = {
|
99
|
+
'account_id': x.account_id,
|
100
|
+
'role_id': x.role_id,
|
62
101
|
}
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
rescue => ex
|
71
|
-
puts "skipping creation of attachment due to error: " + ex.to_s
|
72
|
-
end
|
73
|
-
}
|
74
|
-
state["grants"].each { |attachment|
|
75
|
-
begin
|
76
|
-
g = SDM::AccountGrant.new()
|
77
|
-
g.account_id = attachment["account_id"]
|
78
|
-
g.resource_id = attachment["resource_id"]
|
79
|
-
client.account_grants.create(g)
|
80
|
-
rescue SDM::AlreadyExistsError
|
81
|
-
rescue => ex
|
82
|
-
puts "skipping creation of grant due to error: " + ex.to_s
|
83
|
-
end
|
102
|
+
end
|
103
|
+
}.reject { |x| x == nil },
|
104
|
+
'grants': account_grants.map { |x|
|
105
|
+
if x.account_id != admin_user_id and x.valid_until == nil
|
106
|
+
out = {
|
107
|
+
'account_id': x.account_id,
|
108
|
+
'resource_id': x.resource_id,
|
84
109
|
}
|
110
|
+
end
|
111
|
+
}.reject { |x| x == nil },
|
112
|
+
}
|
85
113
|
|
86
|
-
|
87
|
-
|
88
|
-
puts "recreated " + state["grants"].size.to_s + " account grants"
|
114
|
+
puts "storing " + state[:attachments].size.to_s + " account attachments in state"
|
115
|
+
puts "storing " + state[:grants].size.to_s + " account grants in state"
|
89
116
|
|
90
|
-
|
91
|
-
|
117
|
+
state_file = File.open("state.json", "w")
|
118
|
+
state_file.write(state.to_json)
|
92
119
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
return 1
|
120
|
+
suspended_count = 0
|
121
|
+
users = client.accounts.list("")
|
122
|
+
users.each { |user|
|
123
|
+
if user.instance_of? SDM::User and user.email == admin_email
|
124
|
+
next
|
99
125
|
end
|
126
|
+
user.suspended = true
|
127
|
+
begin
|
128
|
+
client.accounts.update(user)
|
129
|
+
suspended_count += 1
|
130
|
+
rescue StandardError => ex
|
131
|
+
puts "skipping user " + user.id + " on account of error: " + ex.to_s
|
132
|
+
end
|
133
|
+
}
|
100
134
|
|
101
|
-
|
102
|
-
users = client.accounts.list("email:?", admin_email)
|
103
|
-
users.each{ |user|
|
104
|
-
admin_user_id = user.id
|
105
|
-
}
|
106
|
-
|
107
|
-
account_attachments = client.account_attachments.list('')
|
108
|
-
account_grants = client.account_grants.list('')
|
109
|
-
|
110
|
-
state = {
|
111
|
-
'attachments': account_attachments.map{|x|
|
112
|
-
if x.account_id != admin_user_id
|
113
|
-
out = {
|
114
|
-
'account_id': x.account_id,
|
115
|
-
'role_id': x.role_id,
|
116
|
-
}
|
117
|
-
end
|
118
|
-
}.reject{|x| x == nil},
|
119
|
-
'grants': account_grants.map{|x|
|
120
|
-
if x.account_id != admin_user_id and x.valid_until == nil
|
121
|
-
out = {
|
122
|
-
'account_id': x.account_id,
|
123
|
-
'resource_id': x.resource_id,
|
124
|
-
}
|
125
|
-
end
|
126
|
-
}.reject{|x| x == nil},
|
127
|
-
}
|
128
|
-
|
129
|
-
puts "storing " + state[:attachments].size.to_s + " account attachments in state"
|
130
|
-
puts "storing " + state[:grants].size.to_s + " account grants in state"
|
131
|
-
|
132
|
-
state_file = File.open("state.json", "w")
|
133
|
-
state_file.write(state.to_json)
|
134
|
-
|
135
|
-
suspended_count = 0
|
136
|
-
users = client.accounts.list('')
|
137
|
-
users.each{ |user|
|
138
|
-
if user.instance_of? SDM::User and user.email == admin_email
|
139
|
-
next
|
140
|
-
end
|
141
|
-
user.suspended = true
|
142
|
-
begin
|
143
|
-
client.accounts.update(user)
|
144
|
-
suspended_count += 1
|
145
|
-
rescue StandardError => ex
|
146
|
-
puts "skipping user " + user.id + " on account of error: " + ex.to_s
|
147
|
-
end
|
148
|
-
}
|
149
|
-
|
150
|
-
puts "suspended " + suspended_count.to_s + " users"
|
151
|
-
|
135
|
+
puts "suspended " + suspended_count.to_s + " users"
|
152
136
|
end
|
153
137
|
|
154
|
-
main()
|
138
|
+
main()
|
data/lib/errors/errors.rb
CHANGED
@@ -1,85 +1,87 @@
|
|
1
1
|
# Copyright 2020 StrongDM Inc
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
5
5
|
# You may obtain a copy of the License at
|
6
|
-
#
|
6
|
+
#
|
7
7
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
8
|
+
#
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# This file was generated by protogen. DO NOT EDIT.
|
16
16
|
|
17
17
|
module SDM
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
# RPCError is a generic RPC error
|
20
|
+
class RPCError < StandardError
|
21
|
+
attr_reader :code
|
22
|
+
|
23
|
+
def initialize(msg, code)
|
24
|
+
@code = code
|
25
|
+
super(msg)
|
26
26
|
end
|
27
|
+
end
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
29
|
+
# DeadlineExceededError indicates an RPC call timed out
|
30
|
+
class DeadlineExceededError < RPCError
|
31
|
+
def initialize(msg)
|
32
|
+
super(msg, 4)
|
33
33
|
end
|
34
|
+
end
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
end
|
36
|
+
# AlreadyExistsError is used when an entity already exists in the system
|
37
|
+
class AlreadyExistsError < RPCError
|
38
|
+
def initialize(msg)
|
39
|
+
super(msg, 6)
|
40
40
|
end
|
41
|
+
end
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
43
|
+
# NotFoundError is used when an entity does not exist in the system
|
44
|
+
class NotFoundError < RPCError
|
45
|
+
def initialize(msg)
|
46
|
+
super(msg, 5)
|
47
47
|
end
|
48
|
+
end
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
end
|
50
|
+
# BadRequestError identifies a bad request sent by the client
|
51
|
+
class BadRequestError < RPCError
|
52
|
+
def initialize(msg)
|
53
|
+
super(msg, 3)
|
54
54
|
end
|
55
|
+
end
|
55
56
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
end
|
57
|
+
# AuthenticationError is used to specify an authentication failure condition
|
58
|
+
class AuthenticationError < RPCError
|
59
|
+
def initialize(msg)
|
60
|
+
super(msg, 16)
|
61
61
|
end
|
62
|
+
end
|
62
63
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
end
|
64
|
+
# PermissionError is used to specify a permissions violation
|
65
|
+
class PermissionError < RPCError
|
66
|
+
def initialize(msg)
|
67
|
+
super(msg, 7)
|
68
68
|
end
|
69
|
+
end
|
69
70
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
end
|
71
|
+
# InternalError is used to specify an internal system error
|
72
|
+
class InternalError < RPCError
|
73
|
+
def initialize(msg)
|
74
|
+
super(msg, 13)
|
75
75
|
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# RateLimitError is used for rate limit excess condition
|
79
|
+
class RateLimitError < RPCError
|
80
|
+
attr_reader :rate_limit
|
76
81
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
def initialize(msg, rate_limit)
|
81
|
-
@rate_limit = rate_limit
|
82
|
-
super(msg, 8)
|
83
|
-
end
|
82
|
+
def initialize(msg, rate_limit)
|
83
|
+
@rate_limit = rate_limit
|
84
|
+
super(msg, 8)
|
84
85
|
end
|
86
|
+
end
|
85
87
|
end
|
@@ -1,35 +1,31 @@
|
|
1
1
|
# Copyright 2020 StrongDM Inc
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
5
5
|
# You may obtain a copy of the License at
|
6
|
-
#
|
6
|
+
#
|
7
7
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
8
|
+
#
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
16
16
|
# source: account_attachments.proto
|
17
17
|
|
18
|
-
require
|
18
|
+
require "google/protobuf"
|
19
19
|
|
20
|
-
require
|
21
|
-
require
|
22
|
-
require
|
23
|
-
require
|
20
|
+
require "google/api/annotations_pb"
|
21
|
+
require "protoc-gen-swagger/options/annotations_pb"
|
22
|
+
require "options_pb"
|
23
|
+
require "spec_pb"
|
24
24
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
25
25
|
add_file("account_attachments.proto", :syntax => :proto3) do
|
26
26
|
add_message "v1.AccountAttachmentCreateRequest" do
|
27
27
|
optional :meta, :message, 1, "v1.CreateRequestMetadata"
|
28
28
|
optional :account_attachment, :message, 2, "v1.AccountAttachment"
|
29
|
-
optional :options, :message, 3, "v1.AccountAttachmentCreateOptions"
|
30
|
-
end
|
31
|
-
add_message "v1.AccountAttachmentCreateOptions" do
|
32
|
-
optional :overwrite, :bool, 1
|
33
29
|
end
|
34
30
|
add_message "v1.AccountAttachmentCreateResponse" do
|
35
31
|
optional :meta, :message, 1, "v1.CreateResponseMetadata"
|
@@ -72,7 +68,6 @@ end
|
|
72
68
|
|
73
69
|
module V1
|
74
70
|
AccountAttachmentCreateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentCreateRequest").msgclass
|
75
|
-
AccountAttachmentCreateOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentCreateOptions").msgclass
|
76
71
|
AccountAttachmentCreateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentCreateResponse").msgclass
|
77
72
|
AccountAttachmentGetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentGetRequest").msgclass
|
78
73
|
AccountAttachmentGetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentGetResponse").msgclass
|
@@ -1,33 +1,32 @@
|
|
1
1
|
# Copyright 2020 StrongDM Inc
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
5
5
|
# You may obtain a copy of the License at
|
6
|
-
#
|
6
|
+
#
|
7
7
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
8
|
+
#
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
16
16
|
# Source: account_attachments.proto for package 'v1'
|
17
17
|
|
18
|
-
require
|
19
|
-
require
|
18
|
+
require "grpc"
|
19
|
+
require "account_attachments_pb"
|
20
20
|
|
21
21
|
module V1
|
22
22
|
module AccountAttachments
|
23
23
|
# AccountAttachments assign an account to a role.
|
24
24
|
class Service
|
25
|
-
|
26
25
|
include GRPC::GenericService
|
27
26
|
|
28
27
|
self.marshal_class_method = :encode
|
29
28
|
self.unmarshal_class_method = :decode
|
30
|
-
self.service_name =
|
29
|
+
self.service_name = "v1.AccountAttachments"
|
31
30
|
|
32
31
|
# Create registers a new AccountAttachment.
|
33
32
|
rpc :Create, AccountAttachmentCreateRequest, AccountAttachmentCreateResponse
|