@chevre/domain 21.30.0-alpha.27 → 21.30.0-alpha.28
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.
|
@@ -54,7 +54,19 @@ exports.credentials = {
|
|
|
54
54
|
},
|
|
55
55
|
jwt: {
|
|
56
56
|
secret: process.env.TOKEN_SECRET,
|
|
57
|
-
|
|
57
|
+
// RESOURCE_SERVER_IDENTIFIERとは分離して指定可能に拡張(2024-05-02~)
|
|
58
|
+
/**
|
|
59
|
+
* トークン発行時の発行者
|
|
60
|
+
*/
|
|
61
|
+
issuer: (typeof process.env.TOKEN_ISSUER_BY_AUTHORIZATION === 'string')
|
|
62
|
+
? process.env.TOKEN_ISSUER_BY_AUTHORIZATION
|
|
63
|
+
: process.env.RESOURCE_SERVER_IDENTIFIER,
|
|
64
|
+
/**
|
|
65
|
+
* トークン検証時の発行者リスト
|
|
66
|
+
*/
|
|
67
|
+
issuers: (typeof process.env.TOKEN_ISSUERS_BY_AUTHORIZATION === 'string')
|
|
68
|
+
? process.env.TOKEN_ISSUERS_BY_AUTHORIZATION.split(' ')
|
|
69
|
+
: [],
|
|
58
70
|
version: (typeof process.env.TOKEN_VERSION === 'string') ? process.env.TOKEN_VERSION : '2024-05-02' // 追加(2024-05-02~)
|
|
59
71
|
}
|
|
60
72
|
};
|
|
@@ -76,7 +76,10 @@ function verifyToken(params) {
|
|
|
76
76
|
}
|
|
77
77
|
try {
|
|
78
78
|
payload = yield new Promise((resolve, reject) => {
|
|
79
|
-
jwt.verify(params.token, credentials_1.credentials.jwt.secret, Object.assign({
|
|
79
|
+
jwt.verify(params.token, credentials_1.credentials.jwt.secret, Object.assign({
|
|
80
|
+
// 互換性維持のために複数対応(2024-05-02~)
|
|
81
|
+
// issuer: credentials.jwt.issuer,
|
|
82
|
+
issuer: credentials_1.credentials.jwt.issuers }, (Array.isArray(params.audience)) ? { audience: params.audience } : undefined), (err, decoded) => {
|
|
80
83
|
if (err instanceof Error) {
|
|
81
84
|
reject(err);
|
|
82
85
|
}
|
package/package.json
CHANGED