0.0.20241025 • Published 8 months ago

@maxim_mazurok/gapi.client.binaryauthorization-v1beta1 v0.0.20241025

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

TypeScript typings for Binary Authorization API v1beta1

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. For detailed description please check documentation.

Installing

Install typings for Binary Authorization API:

npm install @types/gapi.client.binaryauthorization-v1beta1 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load(
  'https://binaryauthorization.googleapis.com/$discovery/rest?version=v1beta1',
  () => {
    // now we can use:
    // gapi.client.binaryauthorization
  }
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('binaryauthorization', 'v1beta1', () => {
  // now we can use:
  // gapi.client.binaryauthorization
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [
    // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
    'https://www.googleapis.com/auth/cloud-platform',
  ],
  immediate = true;
// ...

gapi.auth.authorize(
  {client_id: client_id, scope: scope, immediate: immediate},
  authResult => {
    if (authResult && !authResult.error) {
      /* handle successful authorization */
    } else {
      /* handle authorization error */
    }
  }
);

After that you can use Binary Authorization API resources:

/*
A policy specifies the 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 policy for this project. Returns a default policy if the project does not have one.
*/
await gapi.client.binaryauthorization.projects.getPolicy({name: 'name'});

/*
Creates or updates a project's policy, and returns a copy of the new 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.
*/
await gapi.client.binaryauthorization.projects.updatePolicy({name: 'name'});

/*
Gets the current system policy in the specified location.
*/
await gapi.client.binaryauthorization.systempolicy.getPolicy({name: 'name'});
0.0.20241025

8 months ago

0.0.20241018

9 months ago

0.0.20240927

9 months ago

0.0.20241004

9 months ago

0.0.20241011

9 months ago

0.0.20240920

10 months ago

0.0.20240906

10 months ago

0.0.20240830

10 months ago

0.0.20240531

1 year ago

0.0.20240809

11 months ago

0.0.20240607

1 year ago

0.0.20240802

11 months ago

0.0.20240726

11 months ago

0.0.20240524

1 year ago

0.0.20240816

11 months ago

0.0.20240614

1 year ago

0.0.20240705

12 months ago

0.0.20240701

1 year ago

0.0.20240823

10 months ago

0.0.20240621

1 year ago

0.0.20240719

12 months ago

0.0.20240712

12 months ago

0.0.20240517

1 year ago

0.0.20240510

1 year ago

0.0.20240503

1 year ago

0.0.20240426

1 year ago

0.0.20240419

1 year ago

0.0.20240412

1 year ago

0.0.20240329

1 year ago

0.0.20240322

1 year ago

0.0.20240315

1 year ago

0.0.20240311

1 year ago

0.0.20240301

1 year ago

0.0.20240223

1 year ago

0.0.20240220

1 year ago

0.0.20240209

1 year ago

0.0.20240126

1 year ago

0.0.20240119

1 year ago

0.0.20240112

1 year ago

0.0.20240105

1 year ago

0.0.20231215

2 years ago

0.0.20231208

2 years ago

0.0.20231130

2 years ago

0.0.20231110

2 years ago

0.0.20230929

2 years ago

0.0.20230728

2 years ago

0.0.20230721

2 years ago

0.0.20230804

2 years ago

0.0.20230922

2 years ago

0.0.20231020

2 years ago

0.0.20231027

2 years ago

0.0.20231103

2 years ago

0.0.20230915

2 years ago

0.0.20230711

2 years ago

0.0.20231006

2 years ago

0.0.20231013

2 years ago

0.0.20230707

2 years ago

0.0.20230908

2 years ago

0.0.20230901

2 years ago

0.0.20230630

2 years ago

0.0.20230519

2 years ago

0.0.20230620

2 years ago

0.0.20230526

2 years ago

0.0.20230505

2 years ago

0.0.20230414

2 years ago

0.0.20230316

2 years ago

0.0.20230224

2 years ago

0.0.20230420

2 years ago

0.0.20230324

2 years ago

0.0.20230303

2 years ago

0.0.20230407

2 years ago

0.0.20230331

2 years ago

0.0.20230310

2 years ago

0.0.20230215

2 years ago

0.0.20230218

2 years ago

0.0.20230203

2 years ago

0.0.20230127

2 years ago

0.0.20230210

2 years ago

0.0.20230106

2 years ago

0.0.20221104

3 years ago

0.0.20221202

3 years ago

0.0.20221111

3 years ago

0.0.20230120

2 years ago

0.0.20221209

3 years ago

0.0.20230113

2 years ago

0.0.20221028

3 years ago

0.0.20221014

3 years ago

0.0.20221021

3 years ago

0.0.20220922

3 years ago

0.0.20220916

3 years ago

0.0.20220819

3 years ago

0.0.20220909

3 years ago

0.0.20220902

3 years ago

0.0.20220826

3 years ago

0.0.20220812

3 years ago

0.0.20220729

3 years ago