zmanda / amanda

Amanda Network Backup
https://www.zmanda.com/downloads/
Other
214 stars 107 forks source link

Fix parsing of `access_token` key from response JSON for `OAUTH2` #216

Open prajwaltr93 opened 1 year ago

prajwaltr93 commented 1 year ago

when using OAUTH2 as STORAGE_API with use of credentials such as client_id, client_secret etc, access_token is first fetched and further requests use fetched token to perform request until it expires.

regex used to parse response and get access_token had an extra trailing space, which is not present in response causing amanda to not parse it hence sending empty access_token i.e Authorization : Bearer (null).

this fixes parsing, further enables users using OAUTH2 as authentication mechanism.

fixes #214.

Changes: