@adobe/helix-google-support 1.3.3 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/package.json +2 -2
- package/src/GoogleClient.js +4 -1
- package/src/GoogleTokenCache.js +14 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [1.4.1](https://github.com/adobe/helix-google-support/compare/v1.4.0...v1.4.1) (2022-05-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* save refresh token ([#19](https://github.com/adobe/helix-google-support/issues/19)) ([f3fea7b](https://github.com/adobe/helix-google-support/commit/f3fea7ba0d868fd96288579463c842410b956dd5))
|
|
7
|
+
|
|
8
|
+
# [1.4.0](https://github.com/adobe/helix-google-support/compare/v1.3.4...v1.4.0) (2022-05-04)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* log token cache operations ([#18](https://github.com/adobe/helix-google-support/issues/18)) ([8ceb35d](https://github.com/adobe/helix-google-support/commit/8ceb35db0856da3c28992fb435e6409341775456))
|
|
14
|
+
|
|
15
|
+
## [1.3.4](https://github.com/adobe/helix-google-support/compare/v1.3.3...v1.3.4) (2022-05-04)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* use latest onedrive support ([6a266ff](https://github.com/adobe/helix-google-support/commit/6a266ff3e692f32a938daf405c475c8d0325773f))
|
|
21
|
+
|
|
1
22
|
## [1.3.3](https://github.com/adobe/helix-google-support/compare/v1.3.2...v1.3.3) (2022-05-03)
|
|
2
23
|
|
|
3
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-google-support",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Helix Google Support",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"reporter-options": "configFile=.mocha-multi.json"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@adobe/helix-onedrive-support": "
|
|
34
|
+
"@adobe/helix-onedrive-support": "8.0.0",
|
|
35
35
|
"googleapis": "100.0.0",
|
|
36
36
|
"lru-cache": "7.9.0"
|
|
37
37
|
},
|
package/src/GoogleClient.js
CHANGED
|
@@ -107,7 +107,10 @@ export class GoogleClient {
|
|
|
107
107
|
const originalRefreshTokenNoCache = this.auth.refreshTokenNoCache.bind(this.auth);
|
|
108
108
|
this.auth.refreshTokenNoCache = async (...args) => {
|
|
109
109
|
const ret = await originalRefreshTokenNoCache(...args);
|
|
110
|
-
await this.cache.store(
|
|
110
|
+
await this.cache.store({
|
|
111
|
+
refresh_token: this.auth.credentials.refresh_token,
|
|
112
|
+
...ret.tokens,
|
|
113
|
+
});
|
|
111
114
|
return ret;
|
|
112
115
|
};
|
|
113
116
|
}
|
package/src/GoogleTokenCache.js
CHANGED
|
@@ -40,12 +40,25 @@ export class GoogleTokenCache {
|
|
|
40
40
|
this.tokens = JSON.parse(str);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
logTokens(msg) {
|
|
44
|
+
const {
|
|
45
|
+
access_token: accessToken,
|
|
46
|
+
refresh_token: refreshToken,
|
|
47
|
+
expiry_date: expiryDate,
|
|
48
|
+
} = this.tokens;
|
|
49
|
+
const exp = expiryDate ? new Date(expiryDate).toISOString() : '?';
|
|
50
|
+
this.log.info(`${msg}: access_token=${accessToken ? '***' : '?'} refresh_token=${refreshToken ? '***' : '?'} expires=${exp}`);
|
|
51
|
+
}
|
|
52
|
+
|
|
43
53
|
async load() {
|
|
44
|
-
|
|
54
|
+
const ret = await this.plugin.beforeCacheAccess(this.context);
|
|
55
|
+
this.logTokens('GoogleTokenCache loaded');
|
|
56
|
+
return ret;
|
|
45
57
|
}
|
|
46
58
|
|
|
47
59
|
async store(tokens) {
|
|
48
60
|
this.tokens = tokens;
|
|
61
|
+
this.logTokens('GoogleTokenCache stored');
|
|
49
62
|
this.context.cacheHasChanged = true;
|
|
50
63
|
try {
|
|
51
64
|
await this.plugin.afterCacheAccess(this.context);
|