google-cloud-binary_authorization-v1 0.1.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/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +201 -0
- data/README.md +139 -0
- data/lib/google/cloud/binary_authorization/v1/binauthz_management_service/client.rb +897 -0
- data/lib/google/cloud/binary_authorization/v1/binauthz_management_service/credentials.rb +51 -0
- data/lib/google/cloud/binary_authorization/v1/binauthz_management_service/paths.rb +97 -0
- data/lib/google/cloud/binary_authorization/v1/binauthz_management_service.rb +55 -0
- data/lib/google/cloud/binary_authorization/v1/system_policy/client.rb +371 -0
- data/lib/google/cloud/binary_authorization/v1/system_policy/credentials.rb +51 -0
- data/lib/google/cloud/binary_authorization/v1/system_policy/paths.rb +66 -0
- data/lib/google/cloud/binary_authorization/v1/system_policy.rb +49 -0
- data/lib/google/cloud/binary_authorization/v1/validation_helper/client.rb +382 -0
- data/lib/google/cloud/binary_authorization/v1/validation_helper/credentials.rb +51 -0
- data/lib/google/cloud/binary_authorization/v1/validation_helper.rb +48 -0
- data/lib/google/cloud/binary_authorization/v1/version.rb +28 -0
- data/lib/google/cloud/binary_authorization/v1.rb +40 -0
- data/lib/google/cloud/binaryauthorization/v1/resources_pb.rb +111 -0
- data/lib/google/cloud/binaryauthorization/v1/service_pb.rb +84 -0
- data/lib/google/cloud/binaryauthorization/v1/service_services_pb.rb +115 -0
- data/lib/google-cloud-binary_authorization-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +71 -0
- data/proto_docs/google/api/resource.rb +283 -0
- data/proto_docs/google/cloud/binaryauthorization/v1/resources.rb +370 -0
- data/proto_docs/google/cloud/binaryauthorization/v1/service.rb +189 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/timestamp.rb +129 -0
- data/proto_docs/grafeas/v1/attestation.rb +77 -0
- data/proto_docs/grafeas/v1/common.rb +118 -0
- metadata +242 -0
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module BinaryAuthorization
|
23
|
+
module V1
|
24
|
+
module SystemPolicy
|
25
|
+
# Path helper methods for the SystemPolicy API.
|
26
|
+
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Policy resource string.
|
29
|
+
#
|
30
|
+
# @overload policy_path(project:)
|
31
|
+
# The resource will be in the following format:
|
32
|
+
#
|
33
|
+
# `projects/{project}/policy`
|
34
|
+
#
|
35
|
+
# @param project [String]
|
36
|
+
#
|
37
|
+
# @overload policy_path(location:)
|
38
|
+
# The resource will be in the following format:
|
39
|
+
#
|
40
|
+
# `locations/{location}/policy`
|
41
|
+
#
|
42
|
+
# @param location [String]
|
43
|
+
#
|
44
|
+
# @return [::String]
|
45
|
+
def policy_path **args
|
46
|
+
resources = {
|
47
|
+
"project" => (proc do |project:|
|
48
|
+
"projects/#{project}/policy"
|
49
|
+
end),
|
50
|
+
"location" => (proc do |location:|
|
51
|
+
"locations/#{location}/policy"
|
52
|
+
end)
|
53
|
+
}
|
54
|
+
|
55
|
+
resource = resources[args.keys.sort.join(":")]
|
56
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
57
|
+
resource.call(**args)
|
58
|
+
end
|
59
|
+
|
60
|
+
extend self
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/binary_authorization/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/binary_authorization/v1/system_policy/credentials"
|
26
|
+
require "google/cloud/binary_authorization/v1/system_policy/paths"
|
27
|
+
require "google/cloud/binary_authorization/v1/system_policy/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module BinaryAuthorization
|
32
|
+
module V1
|
33
|
+
##
|
34
|
+
# API for working with the system policy.
|
35
|
+
#
|
36
|
+
# To load this service and instantiate a client:
|
37
|
+
#
|
38
|
+
# require "google/cloud/binary_authorization/v1/system_policy"
|
39
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Client.new
|
40
|
+
#
|
41
|
+
module SystemPolicy
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
helper_path = ::File.join __dir__, "system_policy", "helpers.rb"
|
49
|
+
require "google/cloud/binary_authorization/v1/system_policy/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,382 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/binaryauthorization/v1/service_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module BinaryAuthorization
|
25
|
+
module V1
|
26
|
+
module ValidationHelper
|
27
|
+
##
|
28
|
+
# Client for the ValidationHelper service.
|
29
|
+
#
|
30
|
+
# BinAuthz Attestor verification
|
31
|
+
#
|
32
|
+
class Client
|
33
|
+
# @private
|
34
|
+
attr_reader :validation_helper_stub
|
35
|
+
|
36
|
+
##
|
37
|
+
# Configure the ValidationHelper Client class.
|
38
|
+
#
|
39
|
+
# See {::Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Client::Configuration}
|
40
|
+
# for a description of the configuration fields.
|
41
|
+
#
|
42
|
+
# @example
|
43
|
+
#
|
44
|
+
# # Modify the configuration for all ValidationHelper clients
|
45
|
+
# ::Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Client.configure do |config|
|
46
|
+
# config.timeout = 10.0
|
47
|
+
# end
|
48
|
+
#
|
49
|
+
# @yield [config] Configure the Client client.
|
50
|
+
# @yieldparam config [Client::Configuration]
|
51
|
+
#
|
52
|
+
# @return [Client::Configuration]
|
53
|
+
#
|
54
|
+
def self.configure
|
55
|
+
@configure ||= begin
|
56
|
+
namespace = ["Google", "Cloud", "BinaryAuthorization", "V1"]
|
57
|
+
parent_config = while namespace.any?
|
58
|
+
parent_name = namespace.join "::"
|
59
|
+
parent_const = const_get parent_name
|
60
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
61
|
+
namespace.pop
|
62
|
+
end
|
63
|
+
default_config = Client::Configuration.new parent_config
|
64
|
+
|
65
|
+
default_config
|
66
|
+
end
|
67
|
+
yield @configure if block_given?
|
68
|
+
@configure
|
69
|
+
end
|
70
|
+
|
71
|
+
##
|
72
|
+
# Configure the ValidationHelper Client instance.
|
73
|
+
#
|
74
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
75
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
76
|
+
# should be made on {Client.configure}.
|
77
|
+
#
|
78
|
+
# See {::Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Client::Configuration}
|
79
|
+
# for a description of the configuration fields.
|
80
|
+
#
|
81
|
+
# @yield [config] Configure the Client client.
|
82
|
+
# @yieldparam config [Client::Configuration]
|
83
|
+
#
|
84
|
+
# @return [Client::Configuration]
|
85
|
+
#
|
86
|
+
def configure
|
87
|
+
yield @config if block_given?
|
88
|
+
@config
|
89
|
+
end
|
90
|
+
|
91
|
+
##
|
92
|
+
# Create a new ValidationHelper client object.
|
93
|
+
#
|
94
|
+
# @example
|
95
|
+
#
|
96
|
+
# # Create a client using the default configuration
|
97
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Client.new
|
98
|
+
#
|
99
|
+
# # Create a client using a custom configuration
|
100
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Client.new do |config|
|
101
|
+
# config.timeout = 10.0
|
102
|
+
# end
|
103
|
+
#
|
104
|
+
# @yield [config] Configure the ValidationHelper client.
|
105
|
+
# @yieldparam config [Client::Configuration]
|
106
|
+
#
|
107
|
+
def initialize
|
108
|
+
# These require statements are intentionally placed here to initialize
|
109
|
+
# the gRPC module only when it's required.
|
110
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
111
|
+
require "gapic/grpc"
|
112
|
+
require "google/cloud/binaryauthorization/v1/service_services_pb"
|
113
|
+
|
114
|
+
# Create the configuration object
|
115
|
+
@config = Configuration.new Client.configure
|
116
|
+
|
117
|
+
# Yield the configuration if needed
|
118
|
+
yield @config if block_given?
|
119
|
+
|
120
|
+
# Create credentials
|
121
|
+
credentials = @config.credentials
|
122
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
123
|
+
# but only if the default endpoint does not have a region prefix.
|
124
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
125
|
+
!@config.endpoint.split(".").first.include?("-")
|
126
|
+
credentials ||= Credentials.default scope: @config.scope,
|
127
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
128
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
129
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
130
|
+
end
|
131
|
+
@quota_project_id = @config.quota_project
|
132
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
133
|
+
|
134
|
+
@validation_helper_stub = ::Gapic::ServiceStub.new(
|
135
|
+
::Google::Cloud::BinaryAuthorization::V1::ValidationHelperV1::Stub,
|
136
|
+
credentials: credentials,
|
137
|
+
endpoint: @config.endpoint,
|
138
|
+
channel_args: @config.channel_args,
|
139
|
+
interceptors: @config.interceptors
|
140
|
+
)
|
141
|
+
end
|
142
|
+
|
143
|
+
# Service calls
|
144
|
+
|
145
|
+
##
|
146
|
+
# Returns whether the given Attestation for the given image URI
|
147
|
+
# was signed by the given Attestor
|
148
|
+
#
|
149
|
+
# @overload validate_attestation_occurrence(request, options = nil)
|
150
|
+
# Pass arguments to `validate_attestation_occurrence` via a request object, either of type
|
151
|
+
# {::Google::Cloud::BinaryAuthorization::V1::ValidateAttestationOccurrenceRequest} or an equivalent Hash.
|
152
|
+
#
|
153
|
+
# @param request [::Google::Cloud::BinaryAuthorization::V1::ValidateAttestationOccurrenceRequest, ::Hash]
|
154
|
+
# A request object representing the call parameters. Required. To specify no
|
155
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
156
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
157
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
158
|
+
#
|
159
|
+
# @overload validate_attestation_occurrence(attestor: nil, attestation: nil, occurrence_note: nil, occurrence_resource_uri: nil)
|
160
|
+
# Pass arguments to `validate_attestation_occurrence` via keyword arguments. Note that at
|
161
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
162
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
163
|
+
#
|
164
|
+
# @param attestor [::String]
|
165
|
+
# Required. The resource name of the {::Google::Cloud::BinaryAuthorization::V1::Attestor Attestor} of the
|
166
|
+
# [occurrence][grafeas.v1.Occurrence], in the format
|
167
|
+
# `projects/*/attestors/*`.
|
168
|
+
# @param attestation [::Grafeas::V1::AttestationOccurrence, ::Hash]
|
169
|
+
# Required. An {::Grafeas::V1::AttestationOccurrence AttestationOccurrence} to
|
170
|
+
# be checked that it can be verified by the Attestor. It does not have to be
|
171
|
+
# an existing entity in Container Analysis. It must otherwise be a valid
|
172
|
+
# AttestationOccurrence.
|
173
|
+
# @param occurrence_note [::String]
|
174
|
+
# Required. The resource name of the [Note][grafeas.v1.Note] to which the
|
175
|
+
# containing [Occurrence][grafeas.v1.Occurrence] is associated.
|
176
|
+
# @param occurrence_resource_uri [::String]
|
177
|
+
# Required. The URI of the artifact (e.g. container image) that is the
|
178
|
+
# subject of the containing [Occurrence][grafeas.v1.Occurrence].
|
179
|
+
#
|
180
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
181
|
+
# @yieldparam response [::Google::Cloud::BinaryAuthorization::V1::ValidateAttestationOccurrenceResponse]
|
182
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
183
|
+
#
|
184
|
+
# @return [::Google::Cloud::BinaryAuthorization::V1::ValidateAttestationOccurrenceResponse]
|
185
|
+
#
|
186
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
187
|
+
#
|
188
|
+
def validate_attestation_occurrence request, options = nil
|
189
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
190
|
+
|
191
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BinaryAuthorization::V1::ValidateAttestationOccurrenceRequest
|
192
|
+
|
193
|
+
# Converts hash and nil to an options object
|
194
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
195
|
+
|
196
|
+
# Customize the options with defaults
|
197
|
+
metadata = @config.rpcs.validate_attestation_occurrence.metadata.to_h
|
198
|
+
|
199
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
200
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
201
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
202
|
+
gapic_version: ::Google::Cloud::BinaryAuthorization::V1::VERSION
|
203
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
204
|
+
|
205
|
+
header_params = {
|
206
|
+
"attestor" => request.attestor
|
207
|
+
}
|
208
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
209
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
210
|
+
|
211
|
+
options.apply_defaults timeout: @config.rpcs.validate_attestation_occurrence.timeout,
|
212
|
+
metadata: metadata,
|
213
|
+
retry_policy: @config.rpcs.validate_attestation_occurrence.retry_policy
|
214
|
+
|
215
|
+
options.apply_defaults timeout: @config.timeout,
|
216
|
+
metadata: @config.metadata,
|
217
|
+
retry_policy: @config.retry_policy
|
218
|
+
|
219
|
+
@validation_helper_stub.call_rpc :validate_attestation_occurrence, request, options: options do |response, operation|
|
220
|
+
yield response, operation if block_given?
|
221
|
+
return response
|
222
|
+
end
|
223
|
+
rescue ::GRPC::BadStatus => e
|
224
|
+
raise ::Google::Cloud::Error.from_error(e)
|
225
|
+
end
|
226
|
+
|
227
|
+
##
|
228
|
+
# Configuration class for the ValidationHelper API.
|
229
|
+
#
|
230
|
+
# This class represents the configuration for ValidationHelper,
|
231
|
+
# providing control over timeouts, retry behavior, logging, transport
|
232
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
233
|
+
# applied individually to specific RPCs. See
|
234
|
+
# {::Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Client::Configuration::Rpcs}
|
235
|
+
# for a list of RPCs that can be configured independently.
|
236
|
+
#
|
237
|
+
# Configuration can be applied globally to all clients, or to a single client
|
238
|
+
# on construction.
|
239
|
+
#
|
240
|
+
# @example
|
241
|
+
#
|
242
|
+
# # Modify the global config, setting the timeout for
|
243
|
+
# # validate_attestation_occurrence to 20 seconds,
|
244
|
+
# # and all remaining timeouts to 10 seconds.
|
245
|
+
# ::Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Client.configure do |config|
|
246
|
+
# config.timeout = 10.0
|
247
|
+
# config.rpcs.validate_attestation_occurrence.timeout = 20.0
|
248
|
+
# end
|
249
|
+
#
|
250
|
+
# # Apply the above configuration only to a new client.
|
251
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Client.new do |config|
|
252
|
+
# config.timeout = 10.0
|
253
|
+
# config.rpcs.validate_attestation_occurrence.timeout = 20.0
|
254
|
+
# end
|
255
|
+
#
|
256
|
+
# @!attribute [rw] endpoint
|
257
|
+
# The hostname or hostname:port of the service endpoint.
|
258
|
+
# Defaults to `"binaryauthorization.googleapis.com"`.
|
259
|
+
# @return [::String]
|
260
|
+
# @!attribute [rw] credentials
|
261
|
+
# Credentials to send with calls. You may provide any of the following types:
|
262
|
+
# * (`String`) The path to a service account key file in JSON format
|
263
|
+
# * (`Hash`) A service account key as a Hash
|
264
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
265
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
266
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
267
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
268
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
269
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
270
|
+
# * (`nil`) indicating no credentials
|
271
|
+
# @return [::Object]
|
272
|
+
# @!attribute [rw] scope
|
273
|
+
# The OAuth scopes
|
274
|
+
# @return [::Array<::String>]
|
275
|
+
# @!attribute [rw] lib_name
|
276
|
+
# The library name as recorded in instrumentation and logging
|
277
|
+
# @return [::String]
|
278
|
+
# @!attribute [rw] lib_version
|
279
|
+
# The library version as recorded in instrumentation and logging
|
280
|
+
# @return [::String]
|
281
|
+
# @!attribute [rw] channel_args
|
282
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
283
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
284
|
+
# @return [::Hash]
|
285
|
+
# @!attribute [rw] interceptors
|
286
|
+
# An array of interceptors that are run before calls are executed.
|
287
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
288
|
+
# @!attribute [rw] timeout
|
289
|
+
# The call timeout in seconds.
|
290
|
+
# @return [::Numeric]
|
291
|
+
# @!attribute [rw] metadata
|
292
|
+
# Additional gRPC headers to be sent with the call.
|
293
|
+
# @return [::Hash{::Symbol=>::String}]
|
294
|
+
# @!attribute [rw] retry_policy
|
295
|
+
# The retry policy. The value is a hash with the following keys:
|
296
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
297
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
298
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
299
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
300
|
+
# trigger a retry.
|
301
|
+
# @return [::Hash]
|
302
|
+
# @!attribute [rw] quota_project
|
303
|
+
# A separate project against which to charge quota.
|
304
|
+
# @return [::String]
|
305
|
+
#
|
306
|
+
class Configuration
|
307
|
+
extend ::Gapic::Config
|
308
|
+
|
309
|
+
config_attr :endpoint, "binaryauthorization.googleapis.com", ::String
|
310
|
+
config_attr :credentials, nil do |value|
|
311
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
312
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
313
|
+
allowed.any? { |klass| klass === value }
|
314
|
+
end
|
315
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
316
|
+
config_attr :lib_name, nil, ::String, nil
|
317
|
+
config_attr :lib_version, nil, ::String, nil
|
318
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
319
|
+
config_attr :interceptors, nil, ::Array, nil
|
320
|
+
config_attr :timeout, nil, ::Numeric, nil
|
321
|
+
config_attr :metadata, nil, ::Hash, nil
|
322
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
323
|
+
config_attr :quota_project, nil, ::String, nil
|
324
|
+
|
325
|
+
# @private
|
326
|
+
def initialize parent_config = nil
|
327
|
+
@parent_config = parent_config unless parent_config.nil?
|
328
|
+
|
329
|
+
yield self if block_given?
|
330
|
+
end
|
331
|
+
|
332
|
+
##
|
333
|
+
# Configurations for individual RPCs
|
334
|
+
# @return [Rpcs]
|
335
|
+
#
|
336
|
+
def rpcs
|
337
|
+
@rpcs ||= begin
|
338
|
+
parent_rpcs = nil
|
339
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
340
|
+
Rpcs.new parent_rpcs
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
##
|
345
|
+
# Configuration RPC class for the ValidationHelper API.
|
346
|
+
#
|
347
|
+
# Includes fields providing the configuration for each RPC in this service.
|
348
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
349
|
+
# the following configuration fields:
|
350
|
+
#
|
351
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
352
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
353
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
354
|
+
# include the following keys:
|
355
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
356
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
357
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
358
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
359
|
+
# trigger a retry.
|
360
|
+
#
|
361
|
+
class Rpcs
|
362
|
+
##
|
363
|
+
# RPC-specific configuration for `validate_attestation_occurrence`
|
364
|
+
# @return [::Gapic::Config::Method]
|
365
|
+
#
|
366
|
+
attr_reader :validate_attestation_occurrence
|
367
|
+
|
368
|
+
# @private
|
369
|
+
def initialize parent_rpcs = nil
|
370
|
+
validate_attestation_occurrence_config = parent_rpcs.validate_attestation_occurrence if parent_rpcs.respond_to? :validate_attestation_occurrence
|
371
|
+
@validate_attestation_occurrence = ::Gapic::Config::Method.new validate_attestation_occurrence_config
|
372
|
+
|
373
|
+
yield self if block_given?
|
374
|
+
end
|
375
|
+
end
|
376
|
+
end
|
377
|
+
end
|
378
|
+
end
|
379
|
+
end
|
380
|
+
end
|
381
|
+
end
|
382
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "googleauth"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module BinaryAuthorization
|
24
|
+
module V1
|
25
|
+
module ValidationHelper
|
26
|
+
# Credentials for the ValidationHelper API.
|
27
|
+
class Credentials < ::Google::Auth::Credentials
|
28
|
+
self.scope = [
|
29
|
+
"https://www.googleapis.com/auth/cloud-platform"
|
30
|
+
]
|
31
|
+
self.env_vars = [
|
32
|
+
"BINARY_AUTHORIZATION_CREDENTIALS",
|
33
|
+
"BINARY_AUTHORIZATION_KEYFILE",
|
34
|
+
"GOOGLE_CLOUD_CREDENTIALS",
|
35
|
+
"GOOGLE_CLOUD_KEYFILE",
|
36
|
+
"GCLOUD_KEYFILE",
|
37
|
+
"BINARY_AUTHORIZATION_CREDENTIALS_JSON",
|
38
|
+
"BINARY_AUTHORIZATION_KEYFILE_JSON",
|
39
|
+
"GOOGLE_CLOUD_CREDENTIALS_JSON",
|
40
|
+
"GOOGLE_CLOUD_KEYFILE_JSON",
|
41
|
+
"GCLOUD_KEYFILE_JSON"
|
42
|
+
]
|
43
|
+
self.paths = [
|
44
|
+
"~/.config/google_cloud/application_default_credentials.json"
|
45
|
+
]
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/binary_authorization/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/binary_authorization/v1/validation_helper/credentials"
|
26
|
+
require "google/cloud/binary_authorization/v1/validation_helper/client"
|
27
|
+
|
28
|
+
module Google
|
29
|
+
module Cloud
|
30
|
+
module BinaryAuthorization
|
31
|
+
module V1
|
32
|
+
##
|
33
|
+
# BinAuthz Attestor verification
|
34
|
+
#
|
35
|
+
# To load this service and instantiate a client:
|
36
|
+
#
|
37
|
+
# require "google/cloud/binary_authorization/v1/validation_helper"
|
38
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Client.new
|
39
|
+
#
|
40
|
+
module ValidationHelper
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
helper_path = ::File.join __dir__, "validation_helper", "helpers.rb"
|
48
|
+
require "google/cloud/binary_authorization/v1/validation_helper/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module BinaryAuthorization
|
23
|
+
module V1
|
24
|
+
VERSION = "0.1.0"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/binary_authorization/v1/binauthz_management_service"
|
20
|
+
require "google/cloud/binary_authorization/v1/system_policy"
|
21
|
+
require "google/cloud/binary_authorization/v1/validation_helper"
|
22
|
+
require "google/cloud/binary_authorization/v1/version"
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module BinaryAuthorization
|
27
|
+
##
|
28
|
+
# To load this package, including all its services, and instantiate a client:
|
29
|
+
#
|
30
|
+
# require "google/cloud/binary_authorization/v1"
|
31
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new
|
32
|
+
#
|
33
|
+
module V1
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
helper_path = ::File.join __dir__, "v1", "_helpers.rb"
|
40
|
+
require "google/cloud/binary_authorization/v1/_helpers" if ::File.file? helper_path
|