~bigbes/sr-ht-dolt

ref: c82f106f9e36a8ce14539fdc64d0083b98a90773 sr-ht-dolt/core/internal.go -rw-r--r-- 1.2 KiB
c82f106f — Eugene Blikh beads: stop flattening a stored NULL string 5 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package core

// The identity dolt.sr.ht's companion-provisioning call travels under: the
// "Authorization: Internal <token>" payload cmd/dolt-git-hook mints and the
// caller web's guard on /internal/repos pins.
//
// They are two constants in the pure domain package rather than two string
// literals in two commands because the guard now *pins* them (it refuses a
// token naming anyone else), and a pin whose two ends are spelled separately is
// a pin that can be half-changed. Renaming the hook's node id in one file would
// not fail to compile and would not fail a test — companion databases would
// simply stop being provisioned on the next push, which is the failure mode
// sr-ht-ecore/internalauth exists to make impossible. Here it is a compile-time
// fact shared by both ends.
const (
	// InternalClientID names the calling service. It is git.sr.ht's, not
	// dolt.sr.ht's: the hook runs as git.sr.ht's post-update script and calls
	// in on git.sr.ht's behalf.
	InternalClientID = "git.sr.ht"

	// InternalNodeID names the program within that service — the hook binary,
	// which is the only thing on the instance that may drive /internal/repos.
	InternalNodeID = "dolt-git-hook"
)