0.0.20220822 • Published 4 years ago

@maxim_mazurok/gapi.client.iap-v1beta1 v0.0.20220822

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

TypeScript typings for Cloud Identity-Aware Proxy API v1beta1

Controls access to cloud applications running on Google Cloud Platform. For detailed description please check documentation.

Installing

Install typings for Cloud Identity-Aware Proxy API:

npm install @types/gapi.client.iap-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://iap.googleapis.com/$discovery/rest?version=v1beta1',
  () => {
    // now we can use:
    // gapi.client.iap
  },
);
// 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('iap', 'v1beta1', () => {
  // now we can use:
  // gapi.client.iap
});

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 Cloud Identity-Aware Proxy API resources:

/*
Gets the access control policy for an Identity-Aware Proxy protected resource. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api
*/
await gapi.client.iap.getIamPolicy({resource: 'resource'});

/*
Sets the access control policy for an Identity-Aware Proxy protected resource. Replaces any existing policy. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api
*/
await gapi.client.iap.setIamPolicy({resource: 'resource'});

/*
Returns permissions that a caller has on the Identity-Aware Proxy protected resource. If the resource does not exist or the caller does not have Identity-Aware Proxy permissions a [google.rpc.Code.PERMISSION_DENIED] will be returned. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api
*/
await gapi.client.iap.testIamPermissions({resource: 'resource'});
0.0.20250407

1 year ago

0.0.20250524

1 year ago

0.0.20250128

1 year ago

0.0.20250414

1 year ago

0.0.20250531

1 year ago

0.0.20241202

2 years ago

0.0.20250303

1 year ago

0.0.20250430

1 year ago

0.0.20250310

1 year ago

0.0.20250317

1 year ago

0.0.20241205

2 years ago

0.0.20250608

1 year ago

0.0.20250324

1 year ago

0.0.20250203

1 year ago

0.0.20250210

1 year ago

0.0.20241216

1 year ago

0.0.20241111

2 years ago

0.0.20250217

1 year ago

0.0.20250504

1 year ago

0.0.20250106

1 year ago

0.0.20250224

1 year ago

0.0.20241118

2 years ago

0.0.20250511

1 year ago

0.0.20250113

1 year ago

0.0.20250120

1 year ago

0.0.20241028

2 years ago

0.0.20241021

2 years ago

0.0.20240930

2 years ago

0.0.20241014

2 years ago

0.0.20241007

2 years ago

0.0.20240923

2 years ago

0.0.20240916

2 years ago

0.0.20240909

2 years ago

0.0.20240823

2 years ago

0.0.20240902

2 years ago

0.0.20240805

2 years ago

0.0.20240729

2 years ago

0.0.20240603

2 years ago

0.0.20240527

2 years ago

0.0.20240819

2 years ago

0.0.20240617

2 years ago

0.0.20240812

2 years ago

0.0.20240610

2 years ago

0.0.20240708

2 years ago

0.0.20240701

2 years ago

0.0.20240623

2 years ago

0.0.20240520

2 years ago

0.0.20240715

2 years ago

0.0.20240513

2 years ago

0.0.20240506

2 years ago

0.0.20240430

2 years ago

0.0.20240419

2 years ago

0.0.20240412

2 years ago

0.0.20240322

2 years ago

0.0.20240315

2 years ago

0.0.20240311

2 years ago

0.0.20240301

2 years ago

0.0.20240224

2 years ago

0.0.20240220

2 years ago

0.0.20240212

2 years ago

0.0.20240126

2 years ago

0.0.20240119

2 years ago

0.0.20240112

2 years ago

0.0.20240105

2 years ago

0.0.20231229

2 years ago

0.0.20231215

2 years ago

0.0.20231208

2 years ago

0.0.20231204

3 years ago

0.0.20231201

3 years ago

0.0.20231107

3 years ago

0.0.20231113

3 years ago

0.0.20231030

3 years ago

0.0.20230929

3 years ago

0.0.20230721

3 years ago

0.0.20230727

3 years ago

0.0.20230922

3 years ago

0.0.20231020

3 years ago

0.0.20230915

3 years ago

0.0.20231006

3 years ago

0.0.20230714

3 years ago

0.0.20231013

3 years ago

0.0.20230707

3 years ago

0.0.20230908

3 years ago

0.0.20230901

3 years ago

0.0.20230627

3 years ago

0.0.20230519

3 years ago

0.0.20230619

3 years ago

0.0.20230612

3 years ago

0.0.20230512

3 years ago

0.0.20230606

3 years ago

0.0.20230526

3 years ago

0.0.20230505

3 years ago

0.0.20230428

3 years ago

0.0.20230414

3 years ago

0.0.20230315

3 years ago

0.0.20230317

3 years ago

0.0.20230421

3 years ago

0.0.20230224

3 years ago

0.0.20230324

3 years ago

0.0.20230303

3 years ago

0.0.20230407

3 years ago

0.0.20230427

3 years ago

0.0.20230331

3 years ago

0.0.20230203

3 years ago

0.0.20230127

3 years ago

0.0.20230220

3 years ago

0.0.20230210

3 years ago

0.0.20230118

3 years ago

0.0.20221104

4 years ago

0.0.20221202

4 years ago

0.0.20221111

4 years ago

0.0.20221209

3 years ago

0.0.20230125

3 years ago

0.0.20221028

4 years ago

0.0.20221014

4 years ago

0.0.20220923

4 years ago

0.0.20221021

4 years ago

0.0.20220916

4 years ago

0.0.20220829

4 years ago

0.0.20220822

4 years ago

0.0.20220912

4 years ago

0.0.20220901

4 years ago

0.0.20220805

4 years ago