Skip to content

OpenConceptLab/ocl_online#51 | Block Anonymous API usage except from approved clients#845

Open
snyaggarwal wants to merge 2 commits intomasterfrom
ocl_online/issues#51
Open

OpenConceptLab/ocl_online#51 | Block Anonymous API usage except from approved clients#845
snyaggarwal wants to merge 2 commits intomasterfrom
ocl_online/issues#51

Conversation

@snyaggarwal
Copy link
Copy Markdown
Contributor

@snyaggarwal snyaggarwal commented Apr 9, 2026

Linked Issue

Closes OpenConceptLab/ocl_online#51

@snyaggarwal snyaggarwal requested a review from paynejd April 9, 2026 06:30
@snyaggarwal snyaggarwal changed the title OpenConceptLab/ocl_online#51 | Block Anonymouse API usage except from… OpenConceptLab/ocl_online#51 | Block Anonymouse API usage except from approved clients Apr 9, 2026
@paynejd paynejd changed the title OpenConceptLab/ocl_online#51 | Block Anonymouse API usage except from approved clients OpenConceptLab/ocl_online#51 | Block Anonymous API usage except from approved clients Apr 9, 2026
Copy link
Copy Markdown
Member

@paynejd paynejd left a comment

Choose a reason for hiding this comment

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

Overall the design is clean and well-structured — each bypass mechanism is a separate method, easy to test and extend. Good test coverage too. A few things to address before merging, most importantly the X-Forwarded-For spoofing risk.

Typo in PR title: "Anonymouse" → "Anonymous"

Copy link
Copy Markdown
Member

@paynejd paynejd left a comment

Choose a reason for hiding this comment

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

All six review comments addressed cleanly:

  • X-Forwarded-For spoofing — resolved by only trusting REMOTE_ADDR
  • Query string API keys — removed; header-only (X-API-KEY / Authorization)
  • Short-circuit evaluationor chains instead of any() tuple
  • Dead '' in exempt_exact_paths — removed
  • get_set_from_env — renamed + returns a set for O(1) lookups
  • Test coverage gaps — all four added (query param rejection, forwarded IP rejection, whitespace header, disabled setting)

Minor nit: first commit message still has "Anonymouse" typo — not blocking.

LGTM 👍

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