strongdm 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +201 -0
- data/README.md +30 -0
- data/doc/Google.html +95 -0
- data/doc/Google/Protobuf.html +95 -0
- data/doc/LICENSE.html +294 -0
- data/doc/Object.html +290 -0
- data/doc/README_md.html +128 -0
- data/doc/SDM.html +143 -0
- data/doc/SDM/AKS.html +347 -0
- data/doc/SDM/AKSBasicAuth.html +279 -0
- data/doc/SDM/AKSServiceAccount.html +262 -0
- data/doc/SDM/AccountAttachment.html +217 -0
- data/doc/SDM/AccountAttachmentCreateOptions.html +182 -0
- data/doc/SDM/AccountAttachmentCreateResponse.html +216 -0
- data/doc/SDM/AccountAttachmentDeleteResponse.html +199 -0
- data/doc/SDM/AccountAttachmentGetResponse.html +215 -0
- data/doc/SDM/AccountAttachments.html +429 -0
- data/doc/SDM/AccountCreateResponse.html +232 -0
- data/doc/SDM/AccountDeleteResponse.html +197 -0
- data/doc/SDM/AccountGetResponse.html +214 -0
- data/doc/SDM/AccountGrant.html +253 -0
- data/doc/SDM/AccountGrantCreateResponse.html +215 -0
- data/doc/SDM/AccountGrantDeleteResponse.html +198 -0
- data/doc/SDM/AccountGrantGetResponse.html +214 -0
- data/doc/SDM/AccountGrants.html +425 -0
- data/doc/SDM/AccountUpdateResponse.html +214 -0
- data/doc/SDM/Accounts.html +492 -0
- data/doc/SDM/AlreadyExistsError.html +161 -0
- data/doc/SDM/AmazonEKS.html +330 -0
- data/doc/SDM/AmazonES.html +296 -0
- data/doc/SDM/Athena.html +296 -0
- data/doc/SDM/AuroraMysql.html +313 -0
- data/doc/SDM/AuroraPostgres.html +330 -0
- data/doc/SDM/AuthenticationError.html +161 -0
- data/doc/SDM/BadRequestError.html +161 -0
- data/doc/SDM/BigQuery.html +296 -0
- data/doc/SDM/Cassandra.html +313 -0
- data/doc/SDM/Client.html +549 -0
- data/doc/SDM/Clustrix.html +313 -0
- data/doc/SDM/Cockroach.html +330 -0
- data/doc/SDM/CreateResponseMetadata.html +156 -0
- data/doc/SDM/DeadlineExceededError.html +161 -0
- data/doc/SDM/DeleteResponseMetadata.html +156 -0
- data/doc/SDM/Druid.html +296 -0
- data/doc/SDM/DynamoDB.html +296 -0
- data/doc/SDM/Elastic.html +313 -0
- data/doc/SDM/ElasticacheRedis.html +296 -0
- data/doc/SDM/Gateway.html +252 -0
- data/doc/SDM/GetResponseMetadata.html +156 -0
- data/doc/SDM/GoogleGKE.html +296 -0
- data/doc/SDM/Greenplum.html +330 -0
- data/doc/SDM/HTTPAuth.html +313 -0
- data/doc/SDM/HTTPBasicAuth.html +330 -0
- data/doc/SDM/HTTPNoAuth.html +296 -0
- data/doc/SDM/InternalError.html +161 -0
- data/doc/SDM/Kubernetes.html +347 -0
- data/doc/SDM/KubernetesBasicAuth.html +279 -0
- data/doc/SDM/KubernetesServiceAccount.html +262 -0
- data/doc/SDM/Maria.html +313 -0
- data/doc/SDM/Memcached.html +262 -0
- data/doc/SDM/Memsql.html +313 -0
- data/doc/SDM/MongoHost.html +330 -0
- data/doc/SDM/MongoLegacyHost.html +347 -0
- data/doc/SDM/MongoLegacyReplicaset.html +364 -0
- data/doc/SDM/MongoReplicaSet.html +364 -0
- data/doc/SDM/Mysql.html +313 -0
- data/doc/SDM/NodeCreateResponse.html +232 -0
- data/doc/SDM/NodeDeleteResponse.html +197 -0
- data/doc/SDM/NodeGetResponse.html +214 -0
- data/doc/SDM/NodeUpdateResponse.html +214 -0
- data/doc/SDM/Nodes.html +493 -0
- data/doc/SDM/NotFoundError.html +161 -0
- data/doc/SDM/Oracle.html +330 -0
- data/doc/SDM/PermissionError.html +161 -0
- data/doc/SDM/Plumbing.html +15821 -0
- data/doc/SDM/Postgres.html +330 -0
- data/doc/SDM/Presto.html +330 -0
- data/doc/SDM/RDP.html +296 -0
- data/doc/SDM/RPCError.html +182 -0
- data/doc/SDM/RateLimitError.html +183 -0
- data/doc/SDM/RateLimitMetadata.html +233 -0
- data/doc/SDM/Redis.html +279 -0
- data/doc/SDM/Redshift.html +330 -0
- data/doc/SDM/Relay.html +216 -0
- data/doc/SDM/ResourceCreateResponse.html +214 -0
- data/doc/SDM/ResourceDeleteResponse.html +197 -0
- data/doc/SDM/ResourceGetResponse.html +214 -0
- data/doc/SDM/ResourceUpdateResponse.html +215 -0
- data/doc/SDM/Resources.html +482 -0
- data/doc/SDM/Role.html +216 -0
- data/doc/SDM/RoleAttachment.html +216 -0
- data/doc/SDM/RoleAttachmentCreateResponse.html +216 -0
- data/doc/SDM/RoleAttachmentDeleteResponse.html +199 -0
- data/doc/SDM/RoleAttachmentGetResponse.html +214 -0
- data/doc/SDM/RoleAttachments.html +427 -0
- data/doc/SDM/RoleCreateResponse.html +215 -0
- data/doc/SDM/RoleDeleteResponse.html +197 -0
- data/doc/SDM/RoleGetResponse.html +214 -0
- data/doc/SDM/RoleGrant.html +214 -0
- data/doc/SDM/RoleGrantCreateResponse.html +215 -0
- data/doc/SDM/RoleGrantDeleteResponse.html +198 -0
- data/doc/SDM/RoleGrantGetResponse.html +214 -0
- data/doc/SDM/RoleGrants.html +427 -0
- data/doc/SDM/RoleUpdateResponse.html +215 -0
- data/doc/SDM/Roles.html +490 -0
- data/doc/SDM/SQLServer.html +347 -0
- data/doc/SDM/SSH.html +296 -0
- data/doc/SDM/Service.html +215 -0
- data/doc/SDM/Snowflake.html +313 -0
- data/doc/SDM/Sybase.html +296 -0
- data/doc/SDM/SybaseIQ.html +296 -0
- data/doc/SDM/Teradata.html +296 -0
- data/doc/SDM/UpdateResponseMetadata.html +156 -0
- data/doc/SDM/User.html +248 -0
- data/doc/V1.html +864 -0
- data/doc/V1/AccountAttachments.html +109 -0
- data/doc/V1/AccountAttachments/Service.html +116 -0
- data/doc/V1/AccountGrants.html +109 -0
- data/doc/V1/AccountGrants/Service.html +117 -0
- data/doc/V1/Accounts.html +109 -0
- data/doc/V1/Accounts/Service.html +122 -0
- data/doc/V1/Nodes.html +109 -0
- data/doc/V1/Nodes/Service.html +124 -0
- data/doc/V1/Resources.html +109 -0
- data/doc/V1/Resources/Service.html +113 -0
- data/doc/V1/RoleAttachments.html +109 -0
- data/doc/V1/RoleAttachments/Service.html +119 -0
- data/doc/V1/RoleGrants.html +109 -0
- data/doc/V1/RoleGrants/Service.html +119 -0
- data/doc/V1/Roles.html +109 -0
- data/doc/V1/Roles/Service.html +120 -0
- data/doc/created.rid +37 -0
- data/doc/css/fonts.css +167 -0
- data/doc/css/rdoc.css +590 -0
- data/doc/examples/Gemfile.html +95 -0
- data/doc/examples/Gemfile_lock.html +112 -0
- data/doc/examples/README_md.html +95 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +353 -0
- data/doc/js/darkfish.js +161 -0
- data/doc/js/jquery.js +4 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +109 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +228 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/lib/version.html +98 -0
- data/doc/strongdm_gemspec.html +117 -0
- data/doc/table_of_contents.html +3002 -0
- data/examples/Gemfile +3 -0
- data/examples/Gemfile.lock +14 -0
- data/examples/README.md +5 -0
- data/examples/listUsers.rb +21 -0
- data/examples/panicButton.rb +154 -0
- data/lib/errors/errors.rb +85 -0
- data/lib/grpc/account_attachments_pb.rb +84 -0
- data/lib/grpc/account_attachments_services_pb.rb +44 -0
- data/lib/grpc/account_grants_pb.rb +82 -0
- data/lib/grpc/account_grants_services_pb.rb +44 -0
- data/lib/grpc/accounts_pb.rb +107 -0
- data/lib/grpc/accounts_services_pb.rb +49 -0
- data/lib/grpc/drivers_pb.rb +601 -0
- data/lib/grpc/nodes_pb.rb +107 -0
- data/lib/grpc/nodes_services_pb.rb +49 -0
- data/lib/grpc/options_pb.rb +60 -0
- data/lib/grpc/plumbing.rb +4283 -0
- data/lib/grpc/protoc-gen-swagger/options/annotations_pb.rb +15 -0
- data/lib/grpc/resources_pb.rb +85 -0
- data/lib/grpc/resources_services_pb.rb +45 -0
- data/lib/grpc/role_attachments_pb.rb +79 -0
- data/lib/grpc/role_attachments_services_pb.rb +47 -0
- data/lib/grpc/role_grants_pb.rb +79 -0
- data/lib/grpc/role_grants_services_pb.rb +47 -0
- data/lib/grpc/roles_pb.rb +91 -0
- data/lib/grpc/roles_services_pb.rb +50 -0
- data/lib/grpc/spec_pb.rb +95 -0
- data/lib/models/porcelain.rb +4033 -0
- data/lib/strongdm.rb +128 -0
- data/lib/svc.rb +1331 -0
- data/lib/version +3 -0
- data/lib/version.rb +17 -0
- data/strongdm.gemspec +23 -0
- metadata +318 -0
data/examples/Gemfile
ADDED
data/examples/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
require "strongdm"
|
|
16
|
+
|
|
17
|
+
client = SDM::Client.new(ENV['SDM_API_ACCESS_KEY'], ENV['SDM_API_SECRET_KEY'])
|
|
18
|
+
users = client.accounts.list('')
|
|
19
|
+
users.each { |user|
|
|
20
|
+
p user
|
|
21
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
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
|
+
#
|
|
17
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
# you may not use this file except in compliance with the License.
|
|
19
|
+
# You may obtain a copy of the License at
|
|
20
|
+
#
|
|
21
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
#
|
|
23
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
24
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
+
# See the License for the specific language governing permissions and
|
|
27
|
+
# limitations under the License.
|
|
28
|
+
#
|
|
29
|
+
|
|
30
|
+
require "strongdm"
|
|
31
|
+
require "OpenSSL"
|
|
32
|
+
require "JSON"
|
|
33
|
+
|
|
34
|
+
# panicButton.rb suspends all users except for one admin,
|
|
35
|
+
# in the fake use case of a critical break in or something
|
|
36
|
+
# usage:
|
|
37
|
+
# ruby panicButton.rb adminuser@email.com
|
|
38
|
+
# to revert back to pre-panic state:
|
|
39
|
+
# ruby panicButton.rb revert
|
|
40
|
+
def main
|
|
41
|
+
access_key = ENV["SDM_API_ACCESS_KEY"]
|
|
42
|
+
secret_key = ENV["SDM_API_SECRET_KEY"]
|
|
43
|
+
if access_key == nil or secret_key == nil
|
|
44
|
+
puts "SDM_API_ACCESS_KEY and SDM_API_SECRET_KEY must be provided"
|
|
45
|
+
return
|
|
46
|
+
end
|
|
47
|
+
client = SDM::Client.new(access_key, secret_key)
|
|
48
|
+
|
|
49
|
+
if ARGV.size == 1 and ARGV[0] == "revert"
|
|
50
|
+
state_file = File.open("state.json")
|
|
51
|
+
state = JSON.load(state_file)
|
|
52
|
+
|
|
53
|
+
reinstated_count = 0
|
|
54
|
+
|
|
55
|
+
users = client.accounts.list('')
|
|
56
|
+
users.each{ |user|
|
|
57
|
+
if user.suspended
|
|
58
|
+
reinstated_count += 1
|
|
59
|
+
user.suspended = false
|
|
60
|
+
client.accounts.update(user)
|
|
61
|
+
end
|
|
62
|
+
}
|
|
63
|
+
state["attachments"].each { |attachment|
|
|
64
|
+
begin
|
|
65
|
+
a = SDM::AccountAttachment.new()
|
|
66
|
+
a.account_id = attachment["account_id"]
|
|
67
|
+
a.role_id = attachment["role_id"]
|
|
68
|
+
client.account_attachments.create(a)
|
|
69
|
+
rescue SDM::AlreadyExistsError
|
|
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
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
puts "reinstated " + reinstated_count.to_s + " users"
|
|
87
|
+
puts "recreated " + state["attachments"].size.to_s + " account attachments"
|
|
88
|
+
puts "recreated " + state["grants"].size.to_s + " account grants"
|
|
89
|
+
|
|
90
|
+
return
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
admin_email = ""
|
|
94
|
+
if ARGV.size == 1
|
|
95
|
+
admin_email = ARGV[0]
|
|
96
|
+
else
|
|
97
|
+
puts "please provide an admin email to preserve"
|
|
98
|
+
return 1
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
admin_user_id = ""
|
|
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
|
+
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
main()
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
# This file was generated by protogen. DO NOT EDIT.
|
|
16
|
+
|
|
17
|
+
module SDM
|
|
18
|
+
|
|
19
|
+
# RPCError is a generic RPC error
|
|
20
|
+
class RPCError < StandardError
|
|
21
|
+
attr_reader :code
|
|
22
|
+
def initialize(msg, code)
|
|
23
|
+
@code = code
|
|
24
|
+
super(msg)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# DeadlineExceededError indicates an RPC call timed out
|
|
29
|
+
class DeadlineExceededError < RPCError
|
|
30
|
+
def initialize(msg)
|
|
31
|
+
super(msg, 4)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# AlreadyExistsError is used when an entity already exists in the system
|
|
36
|
+
class AlreadyExistsError < RPCError
|
|
37
|
+
def initialize(msg)
|
|
38
|
+
super(msg, 6)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# NotFoundError is used when an entity does not exist in the system
|
|
43
|
+
class NotFoundError < RPCError
|
|
44
|
+
def initialize(msg)
|
|
45
|
+
super(msg, 5)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# BadRequestError identifies a bad request sent by the client
|
|
50
|
+
class BadRequestError < RPCError
|
|
51
|
+
def initialize(msg)
|
|
52
|
+
super(msg, 3)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# AuthenticationError is used to specify an authentication failure condition
|
|
57
|
+
class AuthenticationError < RPCError
|
|
58
|
+
def initialize(msg)
|
|
59
|
+
super(msg, 16)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# PermissionError is used to specify a permissions violation
|
|
64
|
+
class PermissionError < RPCError
|
|
65
|
+
def initialize(msg)
|
|
66
|
+
super(msg, 7)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# InternalError is used to specify an internal system error
|
|
71
|
+
class InternalError < RPCError
|
|
72
|
+
def initialize(msg)
|
|
73
|
+
super(msg, 13)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# RateLimitError is used for rate limit excess condition
|
|
78
|
+
class RateLimitError < RPCError
|
|
79
|
+
attr_reader :rate_limit
|
|
80
|
+
def initialize(msg, rate_limit)
|
|
81
|
+
@rate_limit = rate_limit
|
|
82
|
+
super(msg, 8)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
16
|
+
# source: account_attachments.proto
|
|
17
|
+
|
|
18
|
+
require 'google/protobuf'
|
|
19
|
+
|
|
20
|
+
require 'google/api/annotations_pb'
|
|
21
|
+
require 'protoc-gen-swagger/options/annotations_pb'
|
|
22
|
+
require 'options_pb'
|
|
23
|
+
require 'spec_pb'
|
|
24
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
25
|
+
add_file("account_attachments.proto", :syntax => :proto3) do
|
|
26
|
+
add_message "v1.AccountAttachmentCreateRequest" do
|
|
27
|
+
optional :meta, :message, 1, "v1.CreateRequestMetadata"
|
|
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
|
+
end
|
|
34
|
+
add_message "v1.AccountAttachmentCreateResponse" do
|
|
35
|
+
optional :meta, :message, 1, "v1.CreateResponseMetadata"
|
|
36
|
+
optional :account_attachment, :message, 2, "v1.AccountAttachment"
|
|
37
|
+
optional :rate_limit, :message, 3, "v1.RateLimitMetadata"
|
|
38
|
+
end
|
|
39
|
+
add_message "v1.AccountAttachmentGetRequest" do
|
|
40
|
+
optional :meta, :message, 1, "v1.GetRequestMetadata"
|
|
41
|
+
optional :id, :string, 2
|
|
42
|
+
end
|
|
43
|
+
add_message "v1.AccountAttachmentGetResponse" do
|
|
44
|
+
optional :meta, :message, 1, "v1.GetResponseMetadata"
|
|
45
|
+
optional :account_attachment, :message, 2, "v1.AccountAttachment"
|
|
46
|
+
optional :rate_limit, :message, 3, "v1.RateLimitMetadata"
|
|
47
|
+
end
|
|
48
|
+
add_message "v1.AccountAttachmentDeleteRequest" do
|
|
49
|
+
optional :meta, :message, 1, "v1.DeleteRequestMetadata"
|
|
50
|
+
optional :id, :string, 2
|
|
51
|
+
end
|
|
52
|
+
add_message "v1.AccountAttachmentDeleteResponse" do
|
|
53
|
+
optional :meta, :message, 1, "v1.DeleteResponseMetadata"
|
|
54
|
+
optional :rate_limit, :message, 2, "v1.RateLimitMetadata"
|
|
55
|
+
end
|
|
56
|
+
add_message "v1.AccountAttachmentListRequest" do
|
|
57
|
+
optional :meta, :message, 1, "v1.ListRequestMetadata"
|
|
58
|
+
optional :filter, :string, 2
|
|
59
|
+
end
|
|
60
|
+
add_message "v1.AccountAttachmentListResponse" do
|
|
61
|
+
optional :meta, :message, 1, "v1.ListResponseMetadata"
|
|
62
|
+
repeated :account_attachments, :message, 2, "v1.AccountAttachment"
|
|
63
|
+
optional :rate_limit, :message, 3, "v1.RateLimitMetadata"
|
|
64
|
+
end
|
|
65
|
+
add_message "v1.AccountAttachment" do
|
|
66
|
+
optional :id, :string, 1
|
|
67
|
+
optional :account_id, :string, 2
|
|
68
|
+
optional :role_id, :string, 3
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
module V1
|
|
74
|
+
AccountAttachmentCreateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentCreateRequest").msgclass
|
|
75
|
+
AccountAttachmentCreateOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentCreateOptions").msgclass
|
|
76
|
+
AccountAttachmentCreateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentCreateResponse").msgclass
|
|
77
|
+
AccountAttachmentGetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentGetRequest").msgclass
|
|
78
|
+
AccountAttachmentGetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentGetResponse").msgclass
|
|
79
|
+
AccountAttachmentDeleteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentDeleteRequest").msgclass
|
|
80
|
+
AccountAttachmentDeleteResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentDeleteResponse").msgclass
|
|
81
|
+
AccountAttachmentListRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentListRequest").msgclass
|
|
82
|
+
AccountAttachmentListResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachmentListResponse").msgclass
|
|
83
|
+
AccountAttachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountAttachment").msgclass
|
|
84
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
16
|
+
# Source: account_attachments.proto for package 'v1'
|
|
17
|
+
|
|
18
|
+
require 'grpc'
|
|
19
|
+
require 'account_attachments_pb'
|
|
20
|
+
|
|
21
|
+
module V1
|
|
22
|
+
module AccountAttachments
|
|
23
|
+
# AccountAttachments assign an account to a role.
|
|
24
|
+
class Service
|
|
25
|
+
|
|
26
|
+
include GRPC::GenericService
|
|
27
|
+
|
|
28
|
+
self.marshal_class_method = :encode
|
|
29
|
+
self.unmarshal_class_method = :decode
|
|
30
|
+
self.service_name = 'v1.AccountAttachments'
|
|
31
|
+
|
|
32
|
+
# Create registers a new AccountAttachment.
|
|
33
|
+
rpc :Create, AccountAttachmentCreateRequest, AccountAttachmentCreateResponse
|
|
34
|
+
# Get reads one AccountAttachment by ID.
|
|
35
|
+
rpc :Get, AccountAttachmentGetRequest, AccountAttachmentGetResponse
|
|
36
|
+
# Delete removes a AccountAttachment by ID.
|
|
37
|
+
rpc :Delete, AccountAttachmentDeleteRequest, AccountAttachmentDeleteResponse
|
|
38
|
+
# List gets a list of AccountAttachments matching a given set of criteria.
|
|
39
|
+
rpc :List, AccountAttachmentListRequest, AccountAttachmentListResponse
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
Stub = Service.rpc_stub_class
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
16
|
+
# source: account_grants.proto
|
|
17
|
+
|
|
18
|
+
require 'google/protobuf'
|
|
19
|
+
|
|
20
|
+
require 'google/api/annotations_pb'
|
|
21
|
+
require 'protoc-gen-swagger/options/annotations_pb'
|
|
22
|
+
require 'google/protobuf/timestamp_pb'
|
|
23
|
+
require 'options_pb'
|
|
24
|
+
require 'spec_pb'
|
|
25
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
26
|
+
add_file("account_grants.proto", :syntax => :proto3) do
|
|
27
|
+
add_message "v1.AccountGrantCreateRequest" do
|
|
28
|
+
optional :meta, :message, 1, "v1.CreateRequestMetadata"
|
|
29
|
+
optional :account_grant, :message, 2, "v1.AccountGrant"
|
|
30
|
+
end
|
|
31
|
+
add_message "v1.AccountGrantCreateResponse" do
|
|
32
|
+
optional :meta, :message, 1, "v1.CreateResponseMetadata"
|
|
33
|
+
optional :account_grant, :message, 2, "v1.AccountGrant"
|
|
34
|
+
optional :rate_limit, :message, 3, "v1.RateLimitMetadata"
|
|
35
|
+
end
|
|
36
|
+
add_message "v1.AccountGrantGetRequest" do
|
|
37
|
+
optional :meta, :message, 1, "v1.GetRequestMetadata"
|
|
38
|
+
optional :id, :string, 2
|
|
39
|
+
end
|
|
40
|
+
add_message "v1.AccountGrantGetResponse" do
|
|
41
|
+
optional :meta, :message, 1, "v1.GetResponseMetadata"
|
|
42
|
+
optional :account_grant, :message, 2, "v1.AccountGrant"
|
|
43
|
+
optional :rate_limit, :message, 3, "v1.RateLimitMetadata"
|
|
44
|
+
end
|
|
45
|
+
add_message "v1.AccountGrantDeleteRequest" do
|
|
46
|
+
optional :meta, :message, 1, "v1.DeleteRequestMetadata"
|
|
47
|
+
optional :id, :string, 2
|
|
48
|
+
end
|
|
49
|
+
add_message "v1.AccountGrantDeleteResponse" do
|
|
50
|
+
optional :meta, :message, 1, "v1.DeleteResponseMetadata"
|
|
51
|
+
optional :rate_limit, :message, 2, "v1.RateLimitMetadata"
|
|
52
|
+
end
|
|
53
|
+
add_message "v1.AccountGrantListRequest" do
|
|
54
|
+
optional :meta, :message, 1, "v1.ListRequestMetadata"
|
|
55
|
+
optional :filter, :string, 2
|
|
56
|
+
end
|
|
57
|
+
add_message "v1.AccountGrantListResponse" do
|
|
58
|
+
optional :meta, :message, 1, "v1.ListResponseMetadata"
|
|
59
|
+
repeated :account_grants, :message, 2, "v1.AccountGrant"
|
|
60
|
+
optional :rate_limit, :message, 3, "v1.RateLimitMetadata"
|
|
61
|
+
end
|
|
62
|
+
add_message "v1.AccountGrant" do
|
|
63
|
+
optional :id, :string, 1
|
|
64
|
+
optional :resource_id, :string, 2
|
|
65
|
+
optional :account_id, :string, 3
|
|
66
|
+
optional :start_from, :message, 4, "google.protobuf.Timestamp"
|
|
67
|
+
optional :valid_until, :message, 5, "google.protobuf.Timestamp"
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
module V1
|
|
73
|
+
AccountGrantCreateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountGrantCreateRequest").msgclass
|
|
74
|
+
AccountGrantCreateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountGrantCreateResponse").msgclass
|
|
75
|
+
AccountGrantGetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountGrantGetRequest").msgclass
|
|
76
|
+
AccountGrantGetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountGrantGetResponse").msgclass
|
|
77
|
+
AccountGrantDeleteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountGrantDeleteRequest").msgclass
|
|
78
|
+
AccountGrantDeleteResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountGrantDeleteResponse").msgclass
|
|
79
|
+
AccountGrantListRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountGrantListRequest").msgclass
|
|
80
|
+
AccountGrantListResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountGrantListResponse").msgclass
|
|
81
|
+
AccountGrant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.AccountGrant").msgclass
|
|
82
|
+
end
|