mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
A key now opens with what it is allowed to touch. `pk-` is publishable and safe in a browser; `sk-` is secret and never leaves a server. The five marks it replaces all began `ph` -- the upstream's initials -- and they were the last of its brand a customer read back to us, in every SDK snippet. No word rule could reach them, because `ph` is not a word. The marks were also not telling the truth. The constant said `phc_` while every live project token said `hi_`, so the middleware that routes on the constant matched no real token at all. Two spellings existed and one was fiction. Minting now happens in exactly one function and reading in exactly one, so a second spelling has nowhere to live. `phx_` (personal) and `phs_` (project secret) both become `sk-`. The mark now says only that a value is secret; which store holds it is settled by asking. That was already how personal keys worked -- keys minted before the marks carry none, so the store always decided -- and both secret resolvers already returned None on a miss and fell through, so one shared extractor replaces the two that could drift apart. OAuth's access and refresh tokens stay distinguishable as `at-` and `rt-`, because the parser tells them apart before either is looked up, and the domain-verification token becomes `vt-` rather than keeping a sixth mint of its own. `bin/debrand --check` now refuses the marks as a shape, so a seventh cannot be coined. Two rules that were about to rename things that are not ours to spell are bounded: `Lemon` no longer eats `LemonSqueezy`, and the `hog_flow` rules no longer reach a Postgres table, a Datastore table or a route. Keys are stored hashed, so a mark cannot be rewritten in place: the three live project tokens have to be reminted.
Toolbox Utility
A command line utility to connect to Insights toolbox pods in a Kubernetes environment.
Features
- Lists and switches between available Kubernetes contexts
- Automatically identifies the current user from Kubernetes authentication
- Finds and claims toolbox pods
- Sets expiration time for claimed pods
- Connects to claimed pods using kubectl exec
- Allows pod deletion after use
Package Structure
The toolbox utility uses a hybrid approach with modular functions in a package but the main entry point in the top-level script:
-
Main script:
toolbox.py- Main script with argument parsing and the core workflow
-
Support modules:
toolbox/kubernetes.py- Functions for working with Kubernetes contextstoolbox/user.py- User identification and ARN parsingtoolbox/pod.py- Pod management (finding, claiming, connecting, deleting)
This structure keeps the main flow in a single script for easy understanding while separating the implementation details into modular components.
Usage
# Basic usage (claims pod for 12 hours by default)
python toolbox.py
# Claim a pod for 24 hours
python toolbox.py --claim-duration 24
# Update the termination time of an existing claimed pod
python toolbox.py --update-claim
Before connecting to a pod, the utility now allows you to select a Kubernetes context, making it easier to work with multiple clusters.