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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f93fb7220ed41b9c8f2c9bee1fcd91cc621bcacdbdee45e30b3fae34a14d53a2
4
- data.tar.gz: 2903a5624826e557958aef4866ce25e578bbcf11179cdfd50c80e6df8289e6b6
3
+ metadata.gz: 8ba9ab8fd7f04335a2b07eb1c05be2f0c2edb48ee3c96ce69b252dfec2ecebf2
4
+ data.tar.gz: fbbd6499a7b669ed206f610502cf064ad14d3dc39323877383c1a9bf5a88a542
5
5
  SHA512:
6
- metadata.gz: 51ec1c43b9753ef3926a98c931fab3d71ff2eb5c2274af5d0846a2ba61c2e18e8b1531d6acaba5d8641f6e91e6ff1421b703fe4e12ca652efd96839d307ab19f
7
- data.tar.gz: c425bf8d64824680695fc75b5336ecd98b2240015bb599a382d4fc7de094a5c341433da006c1fcf04581d3793e47e7aaaa2f3835fc99c9e307e51d8324e24228
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
@@ -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(url, tls_credentials, timeout: timeout)
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(url, tls_credentials, timeout: timeout)
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module CloudFoundry
4
4
  module Perm
5
- VERSION = '0.0.9'
5
+ VERSION = '0.0.10'
6
6
  end
7
7
  end
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.9
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-05-01 00:00:00.000000000 Z
11
+ date: 2018-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc