Skip to content

feat(pqc): add manual Apiary BigQuery PQC verification script#8902

Draft
danieljbruce wants to merge 1 commit into
mainfrom
jules-12686984612465946612-955c1c58
Draft

feat(pqc): add manual Apiary BigQuery PQC verification script#8902
danieljbruce wants to merge 1 commit into
mainfrom
jules-12686984612465946612-955c1c58

Conversation

@danieljbruce

Copy link
Copy Markdown
Contributor

This PR adds a standalone manual verification script pqc-apiary-test.cjs that connects to the Google Cloud BigQuery service using the Apiary clients / getAPI function and prints out the negotiated TLS protocol, cipher suite, and key exchange algorithm (such as X25519MLKEM768). This ensures verification of Post-Quantum Cryptography compliance for REST/Apiary node clients.


PR created automatically by Jules for task 12686984612465946612 started by @danieljbruce

Creates a Node.js verification script `pqc-apiary-test.cjs` that uses `getAPI` from `googleapis-common` to connect to the Google Cloud BigQuery service and extracts the negotiated TLS algorithm/group to ensure post-quantum cryptography compliance.

Co-authored-by: danieljbruce <8935272+danieljbruce@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a verification script, pqc-apiary-test.cjs, to test Post-Quantum Cryptography (PQC) connections to BigQuery by intercepting TLS handshakes. Feedback suggests moving the newly added googleapis dependency to devDependencies to prevent bloating production installs, and refactoring the tls.connect override to use rest parameters to robustly handle different signature variations.

Comment thread package.json
"chalk": "^5.0.0",
"figures": "^6.0.0",
"gaxios": "^7.0.0-rc",
"googleapis": "^173.0.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The googleapis package is a very large dependency. Since pqc-apiary-test.cjs is a manual verification script and not part of the production library code, googleapis should be listed under devDependencies instead of dependencies to avoid increasing the production install size for downstream users.

Comment thread pqc-apiary-test.cjs
Comment on lines +49 to +59
tls.connect = function (options, callback) {
const socket = originalConnect.call(tls, options, callback);
socket.on('secureConnect', () => {
socketInfo = {
protocol: socket.getProtocol(),
cipher: socket.getCipher(),
ephemeral: socket.getEphemeralKeyInfo(),
};
});
return socket;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Overriding tls.connect with fixed parameters (options, callback) can cause issues if the underlying HTTP client or Node.js internals call it with a different signature (e.g., tls.connect(port, host, options, callback)). Using rest parameters (...args) and forwarding them via apply is more robust and prevents potential signature mismatch errors.

tls.connect = function (...args) {
  const socket = originalConnect.apply(tls, args);
  socket.on('secureConnect', () => {
    socketInfo = {
      protocol: socket.getProtocol(),
      cipher: socket.getCipher(),
      ephemeral: socket.getEphemeralKeyInfo(),
    };
  });
  return socket;
};

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