@vibe-lark/larkpal 0.1.12 → 0.1.14
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/dist/main.mjs +13 -3
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -1029,18 +1029,28 @@ var SessionProcessManager = class {
|
|
|
1029
1029
|
processEnv.LARKPAL_USER_NAME = userContext.userName;
|
|
1030
1030
|
processEnv.LARKPAL_CREDENTIAL_DIR = userContext.credentialDir;
|
|
1031
1031
|
processEnv.LARKPAL_IS_TENANT = userContext.isTenantIdentity ? "1" : "0";
|
|
1032
|
+
const disableUserAuth = process.env.LARKPAL_DISABLE_USER_AUTH === "1" || process.env.LARKPAL_DISABLE_USER_AUTH === "true";
|
|
1032
1033
|
if (!userContext.isTenantIdentity) try {
|
|
1033
1034
|
const vault = new CredentialVault(userContext.credentialDir);
|
|
1034
1035
|
await vault.load();
|
|
1035
1036
|
const credentialEnvVars = await vault.getAllCredentialsAsEnv();
|
|
1036
1037
|
Object.assign(processEnv, credentialEnvVars);
|
|
1037
|
-
|
|
1038
|
-
|
|
1038
|
+
if (!disableUserAuth) {
|
|
1039
|
+
const larkCred = await vault.getCredential("lark");
|
|
1040
|
+
if (larkCred?.user_access_token && typeof larkCred.user_access_token === "string") processEnv.LARK_USER_ACCESS_TOKEN = larkCred.user_access_token;
|
|
1041
|
+
} else {
|
|
1042
|
+
delete processEnv.LARK_USER_ACCESS_TOKEN;
|
|
1043
|
+
log$25.info("LARKPAL_DISABLE_USER_AUTH 已启用,跳过飞书 user_access_token 注入", {
|
|
1044
|
+
sessionId,
|
|
1045
|
+
userId: userContext.userId
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1039
1048
|
log$25.info("用户凭证已注入到 CC 进程环境", {
|
|
1040
1049
|
sessionId,
|
|
1041
1050
|
userId: userContext.userId,
|
|
1042
1051
|
credentialCount: Object.keys(credentialEnvVars).length,
|
|
1043
|
-
hasLarkUserToken: !!processEnv.LARK_USER_ACCESS_TOKEN
|
|
1052
|
+
hasLarkUserToken: !!processEnv.LARK_USER_ACCESS_TOKEN,
|
|
1053
|
+
disableUserAuth
|
|
1044
1054
|
});
|
|
1045
1055
|
} catch (err) {
|
|
1046
1056
|
log$25.warn("用户凭证加载失败,CC 进程将使用默认环境", {
|