Skip to content

chore: (cy.prompt) add manifest for all of the cloud delivered files #31922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: feat/cy-prompt
Choose a base branch
from

Conversation

ryanthemanuel
Copy link
Collaborator

@ryanthemanuel ryanthemanuel commented Jun 21, 2025

Additional details

The general idea behind the manifest is:

  • We add a manifest to the cloud delivered bundles containing each file and a sha-256 hash for that file
  • At upload time, we sign the manifest using our encryption key and stores it alongside other bundle information
  • When requested from the app, we send the manifest signature along as a header
  • In the app at download time, we read the manifest into memory and then validates it using the signature
  • The in-memory manifest is then used to validate every file that is read from the bundle to ensure it has not been modified

Steps to test

How has the user experience changed?

PR Tasks

@ryanthemanuel ryanthemanuel changed the title Create cy-prompt-development.md chore: (cy.prompt) add manifest for all of the cloud delivered files Jun 21, 2025
@ryanthemanuel ryanthemanuel self-assigned this Jun 21, 2025
Copy link

cypress bot commented Jun 21, 2025

cypress    Run #63438

Run Properties:  status check passed Passed #63438  •  git commit 16cdd322e6: refactor
Project cypress
Branch Review ryanm/chore/add-manifest-for-cy-prompt
Run status status check passed Passed #63438
Run duration 18m 52s
Commit git commit 16cdd322e6: refactor
Committer Ryan Manuel
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 12
Tests that did not run due to a developer annotating a test with .skip  Pending 1232
Tests that did not run due to a failure in a mocha hook  Skipped 3
Tests that passed  Passing 32204
View all changes introduced in this branch ↗︎

Warning

Partial Report: The results for the Application Quality reports may be incomplete.

UI Coverage  45.71%
  Untested elements 191  
  Tested elements 165  
Accessibility  92.89%
  Failed rules  3 critical   9 serious   2 moderate   2 minor
  Failed elements 686  

Copilot

This comment was marked as outdated.

@ryanthemanuel ryanthemanuel requested a review from Copilot June 30, 2025 23:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a manifest for cloud-delivered cy prompt bundles to ensure file integrity through SHA-256 hashing and signature verification. It adds new functions for obtaining and validating cy prompt file sources, updates the encryption and API layers to handle manifest and signature headers, and extends test coverage to verify these changes.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/binary/binary-sources.js Introduced getCyPromptFileSource and validateCyPromptFile to handle cy prompt files similar to studio files.
scripts/after-pack-hook.js Incorporated cy prompt file processing into the after-pack hook by writing and validating the updated files.
packages/types/src/cy-prompt/cy-prompt-server-types.ts Extended type definitions with manifest information and verifyHash functionality.
packages/server/test/unit/cloud/cy-prompt/* Added and updated tests to account for manifest presence, signature validation, and error conditions.
packages/server/lib/cloud/encryption.ts Modified verifySignature to handle BinaryLike inputs to support manifest validation.
packages/server/lib/cloud/cy-prompt/ensure_cy_prompt_bundle.ts Implemented manifest file reading and signature verification with appropriate error handling.
packages/server/lib/cloud/cy-prompt/CyPromptManager.ts Updated setup to pass manifest data and a verifyHash callback to the cy prompt server.
packages/server/lib/cloud/cy-prompt/CyPromptLifecycleManager.ts Refactored logic to load and validate the manifest, including checking for the server script’s hash.
packages/server/lib/cloud/api/cy-prompt/get_cy_prompt_bundle.ts Added logic to retrieve and verify the manifest signature from response headers.
packages/driver/src/cypress/error_messages.ts Updated error message formatting to handle cases where error codes may be undefined.

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.

1 participant