Google Cloud Platform Cloud Run service-to-service authentication, through axios interceptors, by adding token from the internal metadata server to headers
npm install axios-cloudrun-authenticatorService-to-service authentification for your Cloud Run instances
axios-cloudrun-authenticator allow you to securize your Cloud Run instances by managing authentication between them. Be sure to follow the first point in Cloud Run Docs > Authenticating service-to-service.
``ts
import axiosCloudRunAuth from "axios-cloudrun-authenticator";
import axios from "axios";
const instance = axios.create(/axiosOptions/);
axiosCloudRunAuth(
instance,
serviceUrl //optionnal, default to origin of instance.defaults.baseURL, e.g.: https://myinstance.a.run.app if baseURL is https://myinstance.a.run.app or https://myinstance.a.run.app/path
);
`
`shell``
$ npm i axios-cloudrun-authenticator
This project is licensed under the ISC License