Skip to content

feat(spotlight): Add self-contained spotlight binary creation#559

Merged
BYK merged 113 commits intomainfrom
byk/feat/sea
Nov 25, 2024
Merged

feat(spotlight): Add self-contained spotlight binary creation#559
BYK merged 113 commits intomainfrom
byk/feat/sea

Conversation

@BYK
Copy link
Member

@BYK BYK commented Nov 12, 2024

This PR adds a new release type which is a self-contained CLI akin to
running npx @spotlightjs/spotlight but without any node or npx
or any other requirements on the system.

It also changes how we serve the static assets: instead of serving the
entire folder, which can be dangerous as it allows access to arbitrary
files, we now use the manifest.json generated when compiling it and
only serve files listed there, directly from memory. This should also
increase the performance.

@vercel
Copy link

vercel bot commented Nov 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
spotlightjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 10:52am

@codecov
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 31.15%. Comparing base (ea666ac) to head (3a5ec6c).
Report is 135 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #559      +/-   ##
==========================================
+ Coverage   29.00%   31.15%   +2.14%     
==========================================
  Files          60       83      +23     
  Lines        4144     5030     +886     
  Branches       72       99      +27     
==========================================
+ Hits         1202     1567     +365     
- Misses       2942     3463     +521     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

console.warn(
"Missing required environment variables for macOS signing, you won't be able to use this binary until you sign it yourself.",
);
console.info({ APPLE_TEAM_ID, APPLE_CERT_PATH, APPLE_CERT_PASSWORD });

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information

This logs sensitive data returned by [an access to APPLE_CERT_PASSWORD](1) as clear text. This logs sensitive data returned by [an access to APPLE_CERT_PASSWORD](2) as clear text.

Copilot Autofix

AI over 1 year ago

To fix the problem, we need to ensure that sensitive information is not logged in clear text. Instead of logging the actual values of APPLE_TEAM_ID, APPLE_CERT_PATH, and APPLE_CERT_PASSWORD, we can log a message indicating that the required environment variables are missing without exposing their values.

  • Replace the logging of sensitive information with a generic message.
  • Specifically, change the code on line 113 to avoid logging the actual values of the sensitive environment variables.
  • No additional methods or imports are needed to implement this change.
Suggested changeset 1
packages/spotlight/bin/build.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/spotlight/bin/build.js b/packages/spotlight/bin/build.js
--- a/packages/spotlight/bin/build.js
+++ b/packages/spotlight/bin/build.js
@@ -112,3 +112,3 @@
         );
-        console.info({ APPLE_TEAM_ID, APPLE_CERT_PATH, APPLE_CERT_PASSWORD });
+        console.info("Missing required environment variables for macOS signing.");
         return;
@@ -134,3 +134,3 @@
         );
-        console.info({ APPLE_API_KEY_PATH });
+        console.info("Missing required environment variable for macOS notarization.");
         return;
EOF
@@ -112,3 +112,3 @@
);
console.info({ APPLE_TEAM_ID, APPLE_CERT_PATH, APPLE_CERT_PASSWORD });
console.info("Missing required environment variables for macOS signing.");
return;
@@ -134,3 +134,3 @@
);
console.info({ APPLE_API_KEY_PATH });
console.info("Missing required environment variable for macOS notarization.");
return;
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants