0

I'm struggling to get a solid flow with a temporary acces token and an refresh token to update the acces token.

Background:

I've build an middleware function in NodeJS running on GCF to get data from system A to B. This done with the help of 5 cloud functions that has an event driven workflow. Basically: could scheduler -> function -> pub/sub -> function.

  • System A: "Fixed" bearer token, stored in Secret Manager.
  • System B: Access token (DB) and refresh token(SM).

Current flow: Get access token from different functions

Now i notice that my token function not always works, sometimes an secret manager error that the api is not enabled (out of the blue... and it is enabled) only thing that works is delete the function and redeploy. Is this due the fact that i'm over the 3000 versions?

I hope somebody can give me some insight.

RemcoE33
  • 1,551
  • 1
  • 4
  • 11
  • What problem are you trying to solve? Can you share the error message you're getting? Where are the workloads that call this Cloud Function running? – sethvargo Jul 05 '21 at 12:33
  • After some digging i found out that if GCF A & GCF B calles the TOKEN FUNCTION on the same time and the token is expired. Then updating the refresh token in SM does not go well. So maybe just make a dedicated function that updates the tokens every 10 minutes. And let all the other functions get the token directly. – RemcoE33 Jul 05 '21 at 13:15
  • @sethvargo the error: Secret Manager API has not been used in project 1111111 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/secretmanager.googleapis.com/overview?project=11111 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. – RemcoE33 Jul 06 '21 at 09:49
  • Does the project number match your project number? I'd still like to understand what problem you're trying to solve. How and where are these tokens going to be used? – sethvargo Jul 06 '21 at 17:49

0 Answers0