Skip to content

Removing surface_header_value validation#277

Merged
lucyking140 merged 4 commits intodatacommonsorg:masterfrom
lucyking140:lucysking/remove-surface-valid
Oct 21, 2025
Merged

Removing surface_header_value validation#277
lucyking140 merged 4 commits intodatacommonsorg:masterfrom
lucyking140:lucysking/remove-surface-valid

Conversation

@lucyking140
Copy link
Copy Markdown
Contributor

@lucyking140 lucyking140 commented Oct 21, 2025

Completes b/453012979

We originally validated that the incoming surface header was either in the form "mcp-<some version number" or "datagemma", to avoid public use of this field that is supposed to only identify data commons surfaces for mixer logs.

However, this makes it challenging to change the surface header or introduce new surfaces, and doesn't allow release candidate versions of the MCP server because the version number contains letters. I removed this validation entirely and will instead validate that the surface is an actual DC feature in my usage logs in mixer, where I can loosen validation without releasing a new PyPi package.

(also updates version bump because of a previous change)

@lucyking140 lucyking140 requested a review from hqpho October 21, 2025 18:37
This value is used in the DC usage logs in Mixer.
"""
default_message = "The surface header value should only to indicate a call made from Data Commons surfaces like the MCP server or DataGemma."
VALID_SURFACE_HEADER_VALUES = ["mcp", r"mcp-[\d\.]+", "datagemma"] No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we remove this constant entirely?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah yes, will do!

@lucyking140 lucyking140 requested a review from hqpho October 21, 2025 18:59
Copy link
Copy Markdown
Collaborator

@hqpho hqpho left a comment

Choose a reason for hiding this comment

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

LGTM! May also want to call out in the description the version bump for the past release as an unrelated change

@lucyking140 lucyking140 merged commit c6ad15b into datacommonsorg:master Oct 21, 2025
2 checks passed
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