0.0.20240513 • Published 7 days ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
7 days 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.20240513

7 days ago

0.0.20240506

14 days ago

0.0.20240430

19 days ago

0.0.20240419

27 days ago

0.0.20240412

1 month ago

0.0.20240322

2 months ago

0.0.20240315

2 months ago

0.0.20240311

2 months ago

0.0.20240301

3 months ago

0.0.20240224

3 months ago

0.0.20240220

3 months ago

0.0.20240212

3 months ago

0.0.20240126

4 months ago

0.0.20240119

4 months ago

0.0.20240112

4 months ago

0.0.20240105

4 months ago

0.0.20231229

5 months ago

0.0.20231215

5 months ago

0.0.20231208

5 months ago

0.0.20231204

6 months ago

0.0.20231201

6 months ago

0.0.20231107

7 months ago

0.0.20231113

6 months ago

0.0.20231030

7 months ago

0.0.20230929

8 months ago

0.0.20230721

10 months ago

0.0.20230727

10 months ago

0.0.20230922

8 months ago

0.0.20231020

7 months ago

0.0.20230915

8 months ago

0.0.20231006

7 months ago

0.0.20230714

10 months ago

0.0.20231013

7 months ago

0.0.20230707

11 months ago

0.0.20230908

8 months ago

0.0.20230901

9 months ago

0.0.20230627

11 months ago

0.0.20230519

12 months ago

0.0.20230619

11 months ago

0.0.20230612

11 months ago

0.0.20230512

1 year ago

0.0.20230606

12 months ago

0.0.20230526

12 months ago

0.0.20230505

1 year ago

0.0.20230428

1 year ago

0.0.20230414

1 year ago

0.0.20230315

1 year ago

0.0.20230317

1 year ago

0.0.20230421

1 year ago

0.0.20230224

1 year ago

0.0.20230324

1 year ago

0.0.20230303

1 year ago

0.0.20230407

1 year ago

0.0.20230427

1 year ago

0.0.20230331

1 year ago

0.0.20230203

1 year ago

0.0.20230127

1 year ago

0.0.20230220

1 year ago

0.0.20230210

1 year ago

0.0.20230118

1 year ago

0.0.20221104

2 years ago

0.0.20221202

1 year ago

0.0.20221111

2 years ago

0.0.20221209

1 year ago

0.0.20230125

1 year ago

0.0.20221028

2 years ago

0.0.20221014

2 years ago

0.0.20220923

2 years ago

0.0.20221021

2 years ago

0.0.20220916

2 years ago

0.0.20220829

2 years ago

0.0.20220822

2 years ago

0.0.20220912

2 years ago

0.0.20220901

2 years ago

0.0.20220805

2 years ago