cf-perm 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/perm/protos/permission_service_pb.rb +1 -0
- data/lib/perm/v1/client.rb +29 -4
- data/lib/perm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ba9ab8fd7f04335a2b07eb1c05be2f0c2edb48ee3c96ce69b252dfec2ecebf2
|
4
|
+
data.tar.gz: fbbd6499a7b669ed206f610502cf064ad14d3dc39323877383c1a9bf5a88a542
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50e67217925655567cbb4cb35e5b4b3aa07b0b2cbe6982a210763672d5e7a5e89fba2c5a301ed194772a6213ad2cc306ed5a43052e9cf11e93dc6f18cafbbbc7
|
7
|
+
data.tar.gz: b045c6a846cd5d17f11ec2a3524d445b937ddb01eb43d81816d169be303f1d2dbbb7b3b8c5c9a5bda6f1e3d383a6bcc5c19004e06cab7f176bbd48fd57cdabd3
|
@@ -18,6 +18,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
18
18
|
add_message "cloud_foundry.perm.protos.ListResourcePatternsRequest" do
|
19
19
|
optional :actor, :message, 2, "cloud_foundry.perm.protos.Actor"
|
20
20
|
optional :action, :string, 3
|
21
|
+
repeated :groups, :message, 4, "cloud_foundry.perm.protos.Group"
|
21
22
|
end
|
22
23
|
add_message "cloud_foundry.perm.protos.ListResourcePatternsResponse" do
|
23
24
|
repeated :resource_patterns, :string, 2
|
data/lib/perm/v1/client.rb
CHANGED
@@ -139,11 +139,18 @@ module CloudFoundry
|
|
139
139
|
raise Errors.from_grpc_error(e)
|
140
140
|
end
|
141
141
|
|
142
|
-
def list_resource_patterns(actor_id:, namespace:, action:)
|
142
|
+
def list_resource_patterns(actor_id:, namespace:, action:, group_ids: [])
|
143
143
|
actor = Protos::Actor.new(id: actor_id, namespace: namespace)
|
144
|
+
|
145
|
+
groups = []
|
146
|
+
group_ids.each do |group_id|
|
147
|
+
groups.push(Protos::Group.new(id: group_id))
|
148
|
+
end
|
149
|
+
|
144
150
|
request = Protos::ListResourcePatternsRequest.new(
|
145
151
|
actor: actor,
|
146
|
-
action: action
|
152
|
+
action: action,
|
153
|
+
groups: groups
|
147
154
|
)
|
148
155
|
|
149
156
|
response = grpc_permission_service.list_resource_patterns(request)
|
@@ -161,12 +168,30 @@ module CloudFoundry
|
|
161
168
|
@tls_credentials ||= GRPC::Core::ChannelCredentials.new(trusted_cas.join("\n"))
|
162
169
|
end
|
163
170
|
|
171
|
+
def shared_channel
|
172
|
+
@shared_channel ||= GRPC::Core::Channel.new(
|
173
|
+
url,
|
174
|
+
{ 'grpc.primary_user_agent' => "grpc-ruby/#{GRPC::VERSION}" },
|
175
|
+
tls_credentials
|
176
|
+
)
|
177
|
+
end
|
178
|
+
|
164
179
|
def grpc_role_service
|
165
|
-
@grpc_role_service ||= Protos::RoleService::Stub.new(
|
180
|
+
@grpc_role_service ||= Protos::RoleService::Stub.new(
|
181
|
+
url,
|
182
|
+
tls_credentials,
|
183
|
+
timeout: timeout,
|
184
|
+
channel_override: shared_channel
|
185
|
+
)
|
166
186
|
end
|
167
187
|
|
168
188
|
def grpc_permission_service
|
169
|
-
@grpc_permission_service ||= Protos::PermissionService::Stub.new(
|
189
|
+
@grpc_permission_service ||= Protos::PermissionService::Stub.new(
|
190
|
+
url,
|
191
|
+
tls_credentials,
|
192
|
+
timeout: timeout,
|
193
|
+
channel_override: shared_channel
|
194
|
+
)
|
170
195
|
end
|
171
196
|
end
|
172
197
|
end
|
data/lib/perm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cf-perm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CloudFoundry Permissions Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grpc
|