googleapis / google-auth-library-nodejs

🔑 Google Auth Library for Node.js
Apache License 2.0
1.73k stars 381 forks source link

feat: Add impersonated signer #1694

Closed salrashid123 closed 11 months ago

salrashid123 commented 11 months ago

Adds ability to signblob and issue gcs signedurl using impersonated credentials

Fixes https://github.com/googleapis/google-auth-library-nodejs/issues/1443 🦕


added test cases to check generic client.sign()

  googleauth
    googleauth
      for impersonated types
        for impersonated credentials signing
          ✔ should use IAMCredentials signBlob endpoint when impersonation is used

  impersonated
    ✔ should sign a blob

coverage skips signer call when used with GCS clients (eg, googleauth.ts 1031-1032)

impersonated.ts | 100 | 63.63 | 100 | 100 | 122-125,127,188-195 googleauth.ts | 95.23 | 87.09 | 100 | 95.23 | 221,245-246,316,321-324,452-457,548-551,553-556,558-561,563-566,576-583,591-594,780-781,884,914-915,927-928,1031-1032 `