clientcapability

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package clientcapability owns the private /client/<capability> URL prefix that proves a request comes from a local client of this user. It creates and reads the secret in the data directory and rejects requests without it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(dataDirectory string) (string, error)

Create returns the existing client capability or publishes a new random one.

func PathPrefix

func PathPrefix(capability string) string

PathPrefix is the private URL prefix a local client must put in front of every Codex Switch request.

func Read

func Read(dataDirectory string) (string, error)

Read returns the existing client capability from a private data directory.

func RequirePathPrefix

func RequirePathPrefix(capability string, next http.Handler) http.Handler

RequirePathPrefix requires /client/{capability} at the start of every request path and removes those two path segments before passing the request to next. Any other path is answered with 404 without reaching next.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL