nodejs-sdk
nodejs-sdk copied to clipboard
bug: Add to src/token-service/metadata-token-service.ts regular token updates
Right now the token is not renewed, and after 12 hours Iam token gets expired
Token needs to be refreshed every 1 hour (~10% of 12 hours as recommended in Iam documentation)
The refresh should be done at the time the token is requested. With timer based implementation, two problems arise:
- It is not known when the objectmetadata-token-service.ts class object becomes unnecessary, so there is no a place where to clear a timer
- In serverless functions a timer behaves specifically - it doesn't work at all between serverless function calls.