keybase / keybase/client

Support for arbitrary headers in per_path_config in keybase pages

Open
#25,256 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
9.2k
Forks
1.3k
Avg merge
12h 58m
Merged PRs (30d)
56

Description

It would be great to be able to set arbitrary response headers in per-path, just as it is done with Access-Control-Allow-Origin for CORS.

The use case I'm thinking of, specifically, is to be able to set Cache-Control: public, no-transform to disallow html modification by intermediates such as Cloudflare (which adds a js beacon to track page views and the like)

However, this could open up other use cases such as Content-Security-Policy and whatnot.

I imagine this can be achieved with .kbp_config:

{
	"version": "v1",
	"per_path_configs": {
		"/": {
			"anonymous_permissions": "read",
			"Content-Security-Policy": "default-src: 'none'",
			"Cache-Control": "public, no-transform",
			"Access-Control-Allow-Origin": "*"
		},
	}
}

As a side effect, this could allow setting values other than "*" for CORS headers.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Keybase Pages handling for .kbp_config and per_path_configs, using the existing Access-Control-Allow-Origin behavior as the entry point. Verify how arbitrary header names and values would be validated and applied, then confirm that Cache-Control, Content-Security-Policy, and existing CORS responses are emitted for the configured path.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.