claude-scionos 4.1.6 → 4.1.7
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/package.json +1 -1
- package/src/routerlab.js +6 -2
package/package.json
CHANGED
package/src/routerlab.js
CHANGED
|
@@ -207,6 +207,10 @@ function hasNonEmptyWindowsTokenFile(tokenFile) {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
function encodeTokenForPowerShell(token) {
|
|
211
|
+
return Buffer.from(token, 'utf8').toString('base64');
|
|
212
|
+
}
|
|
213
|
+
|
|
210
214
|
function getServiceStrategies(serviceValue = DEFAULT_SERVICE) {
|
|
211
215
|
const service = getServiceConfig(serviceValue);
|
|
212
216
|
if (!service?.strategyValues?.length) {
|
|
@@ -442,14 +446,14 @@ function storeToken(token, serviceValue = DEFAULT_SERVICE) {
|
|
|
442
446
|
|
|
443
447
|
if (process.platform === 'win32') {
|
|
444
448
|
const tokenFile = getWindowsTokenFile(service.value);
|
|
449
|
+
const encodedToken = encodeTokenForPowerShell(token);
|
|
445
450
|
fs.mkdirSync(path.dirname(tokenFile), {recursive: true});
|
|
446
451
|
runPowerShell(
|
|
447
|
-
|
|
452
|
+
`$token = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('${encodedToken}')); if ([string]::IsNullOrEmpty($token)) { throw "Token input is empty" }; $secure = ConvertTo-SecureString $token -AsPlainText -Force; $encrypted = ConvertFrom-SecureString $secure; Set-Content -Path $env:SCIONOS_TOKEN_FILE -Value $encrypted -NoNewline`,
|
|
448
453
|
{
|
|
449
454
|
env: {
|
|
450
455
|
SCIONOS_TOKEN_FILE: tokenFile,
|
|
451
456
|
},
|
|
452
|
-
input: token,
|
|
453
457
|
},
|
|
454
458
|
);
|
|
455
459
|
|