Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/rest.rb",
"lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/rest/client.rb",
"lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/rest/service_stub.rb",
"lib/google/cloud/binary_authorization/v1beta1/bindings_override.rb",
"lib/google/cloud/binary_authorization/v1beta1/rest.rb",
"lib/google/cloud/binary_authorization/v1beta1/system_policy.rb",
"lib/google/cloud/binary_authorization/v1beta1/system_policy/client.rb",
Expand All @@ -45,7 +46,9 @@
"proto_docs/google/cloud/binaryauthorization/v1beta1/service.rb",
"proto_docs/google/protobuf/duration.rb",
"proto_docs/google/protobuf/empty.rb",
"proto_docs/google/protobuf/field_mask.rb",
"proto_docs/google/protobuf/timestamp.rb",
"proto_docs/google/type/expr.rb",
"snippets/Gemfile",
"snippets/binauthz_management_service/create_attestor.rb",
"snippets/binauthz_management_service/delete_attestor.rb",
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-binary_authorization-v1beta1/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ruby Client for the Binary Authorization V1beta1 API

The management interface for Binary Authorization, a system providing policy control for images deployed to Kubernetes Engine clusters, Anthos clusters on VMware, and Cloud Run.
The management interface for Binary Authorization, a service that provides policy-based deployment validation and control for images deployed to Google Kubernetes Engine (GKE), Anthos Service Mesh, Anthos Clusters, and Cloud Run.

Binary Authorization is a service on Google Cloud that provides centralized software supply-chain security for applications that run on Google Kubernetes Engine (GKE) and GKE on-prem.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
gem.authors = ["Google LLC"]
gem.email = "googleapis-packages@google.com"
gem.description = "Binary Authorization is a service on Google Cloud that provides centralized software supply-chain security for applications that run on Google Kubernetes Engine (GKE) and GKE on-prem. Note that google-cloud-binary_authorization-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-binary_authorization instead. See the readme for more details."
gem.summary = "The management interface for Binary Authorization, a system providing policy control for images deployed to Kubernetes Engine clusters, Anthos clusters on VMware, and Cloud Run."
gem.summary = "The management interface for Binary Authorization, a service that provides policy-based deployment validation and control for images deployed to Google Kubernetes Engine (GKE), Anthos Service Mesh, Anthos Clusters, and Cloud Run."
gem.homepage = "https://github.com/googleapis/google-cloud-ruby"
gem.license = "Apache-2.0"

Expand All @@ -25,4 +25,5 @@ Gem::Specification.new do |gem|

gem.add_dependency "gapic-common", "~> 1.3"
gem.add_dependency "google-cloud-errors", "~> 1.0"
gem.add_dependency "google-iam-v1", "~> 1.3"
end
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

require "google/cloud/errors"
require "google/cloud/binaryauthorization/v1beta1/service_pb"
require "google/iam/v1"

module Google
module Cloud
Expand Down Expand Up @@ -208,8 +209,23 @@ def initialize
entry.set "defaultTimeout", @config.timeout if @config.timeout
entry.set "quotaProject", @quota_project_id if @quota_project_id
end

@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
config.credentials = credentials
config.quota_project = @quota_project_id
config.endpoint = @binauthz_management_service_stub.endpoint
config.universe_domain = @binauthz_management_service_stub.universe_domain
config.logger = @binauthz_management_service_stub.logger if config.respond_to? :logger=
end
end

##
# Get the associated client for mix-in of the IAMPolicy.
#
# @return [Google::Iam::V1::IAMPolicy::Client]
#
attr_reader :iam_policy_client

##
# The logger used for request/response debug logging.
#
Expand All @@ -222,13 +238,16 @@ def logger
# Service calls

##
# A {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} specifies the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} that must attest to
# a container image, before the project is allowed to deploy that
# A {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} specifies the
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} that must
# attest to a container image, before the project is allowed to deploy that
# image. There is at most one policy per project. All image admission
# requests are permitted if a project has no policy.
#
# Gets the {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} for this project. Returns a default
# {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} if the project does not have one.
# Gets the {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} for this
# project. Returns a default
# {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} if the project
# does not have one.
#
# @overload get_policy(request, options = nil)
# Pass arguments to `get_policy` via a request object, either of type
Expand All @@ -246,8 +265,9 @@ def logger
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param name [::String]
# Required. The resource name of the {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} to retrieve,
# in the format `projects/*/policy`.
# Required. The resource name of the
# {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} to retrieve, in
# the format `projects/*/policy`.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Policy]
Expand Down Expand Up @@ -314,11 +334,13 @@ def get_policy request, options = nil
end

##
# Creates or updates a project's {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy}, and returns a copy of the
# new {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy}. A policy is always updated as a whole, to avoid race
# conditions with concurrent policy enforcement (or management!)
# requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT
# if the request is malformed.
# Creates or updates a project's
# {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy}, and returns a
# copy of the new {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy}.
# A policy is always updated as a whole, to avoid race conditions with
# concurrent policy enforcement (or management!) requests. Returns NOT_FOUND
# if the project does not exist, INVALID_ARGUMENT if the request is
# malformed.
#
# @overload update_policy(request, options = nil)
# Pass arguments to `update_policy` via a request object, either of type
Expand All @@ -336,9 +358,11 @@ def get_policy request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param policy [::Google::Cloud::BinaryAuthorization::V1beta1::Policy, ::Hash]
# Required. A new or updated {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} value. The service will
# overwrite the {::Google::Cloud::BinaryAuthorization::V1beta1::Policy#name policy name} field with the resource name in
# the request URL, in the format `projects/*/policy`.
# Required. A new or updated
# {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} value. The
# service will overwrite the [policy
# name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the
# resource name in the request URL, in the format `projects/*/policy`.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Policy]
Expand Down Expand Up @@ -405,10 +429,13 @@ def update_policy request, options = nil
end

##
# Creates an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}, and returns a copy of the new
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}. Returns NOT_FOUND if the project does not exist,
# INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} already exists.
# Creates an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor},
# and returns a copy of the new
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}. Returns
# NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is
# malformed, ALREADY_EXISTS if the
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} already
# exists.
#
# @overload create_attestor(request, options = nil)
# Pass arguments to `create_attestor` via a request object, either of type
Expand All @@ -426,13 +453,17 @@ def update_policy request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param parent [::String]
# Required. The parent of this {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}.
# Required. The parent of this
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}.
# @param attestor_id [::String]
# Required. The {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} ID.
# Required. The
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} ID.
# @param attestor [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor, ::Hash]
# Required. The initial {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} value. The service will
# overwrite the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor#name attestor name} field with the resource name,
# in the format `projects/*/attestors/*`.
# Required. The initial
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} value. The
# service will overwrite the [attestor
# name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
# the resource name, in the format `projects/*/attestors/*`.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor]
Expand Down Expand Up @@ -500,7 +531,9 @@ def create_attestor request, options = nil

##
# Gets an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}.
# Returns NOT_FOUND if the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not exist.
# Returns NOT_FOUND if the
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not
# exist.
#
# @overload get_attestor(request, options = nil)
# Pass arguments to `get_attestor` via a request object, either of type
Expand All @@ -518,8 +551,9 @@ def create_attestor request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param name [::String]
# Required. The name of the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} to retrieve, in the format
# `projects/*/attestors/*`.
# Required. The name of the
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} to retrieve,
# in the format `projects/*/attestors/*`.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor]
Expand Down Expand Up @@ -587,7 +621,9 @@ def get_attestor request, options = nil

##
# Updates an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}.
# Returns NOT_FOUND if the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not exist.
# Returns NOT_FOUND if the
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not
# exist.
#
# @overload update_attestor(request, options = nil)
# Pass arguments to `update_attestor` via a request object, either of type
Expand All @@ -605,9 +641,12 @@ def get_attestor request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param attestor [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor, ::Hash]
# Required. The updated {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} value. The service will
# overwrite the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor#name attestor name} field with the resource name
# in the request URL, in the format `projects/*/attestors/*`.
# Required. The updated
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} value. The
# service will overwrite the [attestor
# name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with
# the resource name in the request URL, in the format
# `projects/*/attestors/*`.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor]
Expand Down Expand Up @@ -694,14 +733,16 @@ def update_attestor request, options = nil
#
# @param parent [::String]
# Required. The resource name of the project associated with the
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors}, in the format `projects/*`.
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors}, in the
# format `projects/*`.
# @param page_size [::Integer]
# Requested page size. The server may return fewer results than requested. If
# unspecified, the server will pick an appropriate default.
# @param page_token [::String]
# A token identifying a page of results the server should return. Typically,
# this is the value of {::Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsResponse#next_page_token ListAttestorsResponse.next_page_token} returned
# from the previous call to the `ListAttestors` method.
# this is the value of
# {::Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsResponse#next_page_token ListAttestorsResponse.next_page_token}
# returned from the previous call to the `ListAttestors` method.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BinaryAuthorization::V1beta1::Attestor>]
Expand Down Expand Up @@ -774,8 +815,10 @@ def list_attestors request, options = nil
end

##
# Deletes an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}. Returns NOT_FOUND if the
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not exist.
# Deletes an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}.
# Returns NOT_FOUND if the
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not
# exist.
#
# @overload delete_attestor(request, options = nil)
# Pass arguments to `delete_attestor` via a request object, either of type
Expand All @@ -793,8 +836,9 @@ def list_attestors request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param name [::String]
# Required. The name of the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} to delete, in the format
# `projects/*/attestors/*`.
# Required. The name of the
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} to delete,
# in the format `projects/*/attestors/*`.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Protobuf::Empty]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
require "gapic/config/method"

require "google/cloud/binary_authorization/v1beta1/version"
require "google/cloud/binary_authorization/v1beta1/bindings_override"

require "google/cloud/binary_authorization/v1beta1/binauthz_management_service/credentials"
require "google/cloud/binary_authorization/v1beta1/binauthz_management_service/paths"
Expand Down
Loading
Loading