vaultfs 1.0.8 → 1.0.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vaultfs",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "A CLI-based secure file system simulator with OAuth 2.0 authentication and advanced data structures",
5
5
  "bin": {
6
6
  "vaultfs": "bin/vaultfs-npm.js"
@@ -105,8 +105,10 @@ public class AuthManager {
105
105
  URL url = URI.create(AuthConfig.AUTH_SERVER_URL + "/auth/session/new").toURL();
106
106
  HttpURLConnection conn = (HttpURLConnection) url.openConnection();
107
107
  conn.setRequestMethod("GET");
108
- conn.setConnectTimeout(5000);
109
- conn.setReadTimeout(5000);
108
+ conn.setConnectTimeout(10000);
109
+ conn.setReadTimeout(10000);
110
+ int responseCode = conn.getResponseCode();
111
+ if (responseCode != 200) return null;
110
112
  String response = readStream(conn.getInputStream());
111
113
  return extractJsonValue(response, "sessionId");
112
114
  } catch (Exception e) {
@@ -170,29 +172,17 @@ public class AuthManager {
170
172
  /** Opens a URL in the default browser using platform-specific commands. */
171
173
  private static void openBrowser(String url) {
172
174
  String os = System.getProperty("os.name").toLowerCase();
173
- Runtime rt = Runtime.getRuntime();
174
175
  try {
175
176
  if (os.contains("win")) {
176
- rt.exec(new String[]{"rundll32", "url.dll,FileProtocolHandler", url});
177
+ Runtime.getRuntime().exec(new String[]{"cmd", "/c", "start", "", url});
177
178
  } else if (os.contains("mac")) {
178
- rt.exec(new String[]{"open", url});
179
+ Runtime.getRuntime().exec(new String[]{"open", url});
179
180
  } else {
180
- String[] browsers = {"xdg-open", "firefox", "google-chrome", "chromium-browser"};
181
- boolean opened = false;
182
- for (String browser : browsers) {
183
- try {
184
- rt.exec(new String[]{browser, url});
185
- opened = true;
186
- break;
187
- } catch (Exception ignored) {}
188
- }
189
- if (!opened) {
190
- System.out.println("Please open this URL manually: " + url);
191
- }
181
+ Runtime.getRuntime().exec(new String[]{"xdg-open", url});
192
182
  }
193
183
  } catch (Exception e) {
194
- System.out.println("Could not open browser automatically.");
195
- System.out.println("Please open this URL manually: " + url);
184
+ System.out.println(" Could not open browser: " + e.getMessage());
185
+ System.out.println(" Please visit manually: " + url);
196
186
  }
197
187
  }
198
188
 
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.8
1
+ 1.0.9