Skip to main content

attestors

Creates, updates, deletes, gets or lists an attestors resource.

Overview

Nameattestors
TypeResource
Idgoogle.binaryauthorization.attestors

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringRequired. The resource name, in the format: projects/*/attestors/*. This field may not be updated.
descriptionstringOptional. A descriptive comment. This field may be updated. The field may be displayed in chooser dialogs.
etagstringOptional. A checksum, returned by the server, that can be sent on update requests to ensure the attestor has an up-to-date value before attempting to update it. See https://google.aip.dev/154.
updateTimestring (google-datetime)Output only. Time when the attestor was last updated.
userOwnedGrafeasNoteobjectThis specifies how an attestation will be read, and how it will be used during policy enforcement. (id: UserOwnedGrafeasNote)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, attestorsIdGets an attestor. Returns NOT_FOUND if the attestor does not exist.
listselectprojectsIdpageSize, pageTokenLists attestors. Returns INVALID_ARGUMENT if the project does not exist.
createinsertprojectsIdattestorIdCreates an attestor, and returns a copy of the new attestor. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the attestor already exists.
updatereplaceprojectsId, attestorsIdUpdates an attestor. Returns NOT_FOUND if the attestor does not exist.
deletedeleteprojectsId, attestorsIdDeletes an attestor. Returns NOT_FOUND if the attestor does not exist.
validate_attestation_occurrenceexecprojectsId, attestorsIdReturns whether the given Attestation for the given image URI was signed by the given Attestor

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
attestorsIdstring
projectsIdstring
attestorIdstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets an attestor. Returns NOT_FOUND if the attestor does not exist.

SELECT
name,
description,
etag,
updateTime,
userOwnedGrafeasNote
FROM google.binaryauthorization.attestors
WHERE projectsId = '{{ projectsId }}' -- required
AND attestorsId = '{{ attestorsId }}' -- required;

INSERT examples

Creates an attestor, and returns a copy of the new attestor. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the attestor already exists.

INSERT INTO google.binaryauthorization.attestors (
data__name,
data__description,
data__userOwnedGrafeasNote,
data__etag,
projectsId,
attestorId
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ userOwnedGrafeasNote }}',
'{{ etag }}',
'{{ projectsId }}',
'{{ attestorId }}'
RETURNING
name,
description,
etag,
updateTime,
userOwnedGrafeasNote
;

REPLACE examples

Updates an attestor. Returns NOT_FOUND if the attestor does not exist.

REPLACE google.binaryauthorization.attestors
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__userOwnedGrafeasNote = '{{ userOwnedGrafeasNote }}',
data__etag = '{{ etag }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND attestorsId = '{{ attestorsId }}' --required
RETURNING
name,
description,
etag,
updateTime,
userOwnedGrafeasNote;

DELETE examples

Deletes an attestor. Returns NOT_FOUND if the attestor does not exist.

DELETE FROM google.binaryauthorization.attestors
WHERE projectsId = '{{ projectsId }}' --required
AND attestorsId = '{{ attestorsId }}' --required;

Lifecycle Methods

Returns whether the given Attestation for the given image URI was signed by the given Attestor

EXEC google.binaryauthorization.attestors.validate_attestation_occurrence 
@projectsId='{{ projectsId }}' --required,
@attestorsId='{{ attestorsId }}' --required
@@json=
'{
"attestation": "{{ attestation }}",
"occurrenceNote": "{{ occurrenceNote }}",
"occurrenceResourceUri": "{{ occurrenceResourceUri }}"
}';