epam / cloud-pipeline

Cloud agnostic genomics analysis, scientific computation and storage platform
https://cloud-pipeline.com
Apache License 2.0
144 stars 58 forks source link

Automatically refresh API tokens in pipe common #3584

Open tcibinan opened 4 days ago

tcibinan commented 4 days ago

Relates #3583.

Adds support for refreshable API tokens to pipe common. Additionally, it updates grid engine autoscaler and user synchronisation to use the new functionality.

from pipeline.api.api import PipelineAPI
from pipeline.api.token import StaticToken, RefreshingToken

# using a static token which will eventually expire
api = PipelineAPI()
api = PipelineAPI(token=StaticToken())

# using a refreshing token which will automatically update itself
api = PipelineAPI(token=RefreshingToken())