Skip to content

revert: "fix: reject requests targeting a cachew playpen when not run…#206

Merged
alecthomas merged 1 commit intomainfrom
aat/revert-playpen-guard
Mar 20, 2026
Merged

revert: "fix: reject requests targeting a cachew playpen when not run…#206
alecthomas merged 1 commit intomainfrom
aat/revert-playpen-guard

Conversation

@alecthomas
Copy link
Collaborator

@alecthomas alecthomas commented Mar 20, 2026

…ning as one (#204)"

This reverts commit 2f3c5c3.

@jrobotham-square I'd prefer not to have anything bespoke in Cachew. We have OPA enforcement now, we can add an OPA policy to do the same thing:

opa {
  policy = <<EOF
    package cachew.authz
    
    default allow := false
    
    allow if {
        permitted
        not deny
    }
    
    permitted if input.method == "GET"
    permitted if input.method == "HEAD"
    permitted if startswith(input.remote_addr, "127.0.0.1:")
    
    deny if {
        data.IS_PLAYPEN != "true"
        contains(input.headers.baggage, "cachew-playpen=")
    }
  EOF
  data = <<EOF
    {"IS_PLAYPEN": "${IS_PLAYPEN}"}
  EOF
}

We can extend the OPA integration to support returning a message or a different HTTP status if required.

…ning as one (#204)"

This reverts commit 2f3c5c3.

Co-authored-by: Claude Code <noreply@anthropic.com>
@alecthomas alecthomas requested a review from a team as a code owner March 20, 2026 10:00
@alecthomas alecthomas requested review from joshfriend and removed request for a team March 20, 2026 10:00
@alecthomas alecthomas merged commit eb8b9bc into main Mar 20, 2026
8 checks passed
@alecthomas alecthomas deleted the aat/revert-playpen-guard branch March 20, 2026 10:03
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