Skip to content

Skip api key verification for nl /version endpoint#1780

Open
clincoln8 wants to merge 1 commit intodatacommonsorg:masterfrom
clincoln8:nodejs-version
Open

Skip api key verification for nl /version endpoint#1780
clincoln8 wants to merge 1 commit intodatacommonsorg:masterfrom
clincoln8:nodejs-version

Conversation

@clincoln8
Copy link
Contributor

@clincoln8 clincoln8 commented Feb 18, 2026

Allow unauthenticated access to

Tested on nonprod:

  • before
    [~]:$ curl -X GET "https://staging.nl.datacommons.org/version"
    {"fault":{"faultstring":"Failed to resolve API Key variable request.header.x-api-key","detail":{"errorcode":"steps.oauth.v2.FailedToResolveAPIKey"}}}
    
  • after
    [~]:$ curl -X GET "https://staging.nl.datacommons.org/version"
    <returns the html doc>
    

This should not be deployed to apigee-prod until deployment freeze ends.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @clincoln8, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the accessibility of the /version endpoint for specific NL DataCommons instances by removing the requirement for API key authentication. This change allows external systems and users to check the service version without needing credentials, streamlining diagnostics and integration processes. The modification ensures that only the /version path is affected, maintaining security for other API endpoints.

Highlights

  • API Key Verification Bypass: Implemented a condition to skip API key verification for requests targeting the /version endpoint, allowing unauthenticated access.
  • Endpoint Accessibility: Enabled public access to the /version endpoint for staging.nl.datacommons.org and nl.datacommons.org, which previously required an API key.
Changelog
  • deploy/apigee/target_endpoints/nl.template.xml
    • Added a condition to the verify-api-key-in-header step to bypass API key verification for requests to the /version path.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 correctly implements the logic to skip API key verification for the /version endpoint by adding a condition to the Apigee proxy configuration. However, the current implementation does not account for requests that include a trailing slash in the path (e.g., /version/). I've provided a suggestion to use a regular expression to make the path matching more robust and handle both cases.

@clincoln8 clincoln8 marked this pull request as ready for review February 18, 2026 23:35
@clincoln8 clincoln8 requested a review from n-h-diaz February 18, 2026 23:35
Copy link
Contributor

@n-h-diaz n-h-diaz left a comment

Choose a reason for hiding this comment

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

Thanks!

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.

2 participants