axexec 1.1.1 → 1.1.2
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.
|
@@ -16,7 +16,9 @@ function getCredentialEnvironment(credentials) {
|
|
|
16
16
|
// Extract API key from credentials data
|
|
17
17
|
const apiKey = resolveStringField(credentials.data, "apiKey", "key");
|
|
18
18
|
// Extract OAuth token from credentials data
|
|
19
|
-
|
|
19
|
+
// axauth uses "accessToken", but also check legacy "oauthToken" and "token" keys
|
|
20
|
+
const oauthToken = resolveStringField(credentials.data, "accessToken", "oauthToken") ??
|
|
21
|
+
resolveStringField(credentials.data, "token", "token");
|
|
20
22
|
switch (credentials.agent) {
|
|
21
23
|
case "claude": {
|
|
22
24
|
if (credentials.type === "api-key" && apiKey) {
|
|
@@ -63,11 +65,17 @@ function getCredentialEnvironment(credentials) {
|
|
|
63
65
|
}
|
|
64
66
|
case "copilot": {
|
|
65
67
|
// Copilot uses GitHub token as its credential
|
|
68
|
+
// axauth returns oauth-token type with accessToken field
|
|
66
69
|
if (credentials.type === "api-key" && apiKey) {
|
|
67
70
|
environment["COPILOT_GITHUB_TOKEN"] = apiKey;
|
|
68
71
|
environment["GH_TOKEN"] = apiKey;
|
|
69
72
|
environment["GITHUB_TOKEN"] = apiKey;
|
|
70
73
|
}
|
|
74
|
+
else if (credentials.type === "oauth-token" && oauthToken) {
|
|
75
|
+
environment["COPILOT_GITHUB_TOKEN"] = oauthToken;
|
|
76
|
+
environment["GH_TOKEN"] = oauthToken;
|
|
77
|
+
environment["GITHUB_TOKEN"] = oauthToken;
|
|
78
|
+
}
|
|
71
79
|
break;
|
|
72
80
|
}
|
|
73
81
|
}
|
package/package.json
CHANGED