From 353a7f19f00b0413558eaffb8e1fd658ccccb1f3 Mon Sep 17 00:00:00 2001 From: Eugene Blikh Date: Sun, 9 Aug 2026 12:14:44 +0300 Subject: [PATCH] follow cover.sr.ht's rename to cov.sr.ht MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The section in ecoretest's synthetic config.ini, and the grant vocabulary the grants package uses for its examples — cover:upload was the stock example of a well-formed grant, and the service that defines it now spells it cov:upload. --- README.md | 4 ++-- chrome/chrome.go | 4 ++-- ecoretest/ecoretest.go | 4 ++-- ecoretest/ecoretest_test.go | 2 +- grants/grants.go | 8 ++++---- grants/grants_test.go | 32 ++++++++++++++++---------------- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 18a0801bf7884605b8017cc89542d2b8cd736a8a..8ab46ad69d07e6412a76adc92f07a1372fa44c93 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # sr-ht-ecore Extended core for the custom services of a self-hosted SourceHut instance -(diff, spec, dolt, cover, bench, ...). Everything these services share that +(diff, spec, dolt, cov, bench, ...). Everything these services share that is *ours* — not upstream's — lives here, so the sr-ht-core fork can stay a clean mirror of upstream core-go, and so the services stop carrying drifting copies of the same code. @@ -164,7 +164,7 @@ both live in that package's globals. Two of those arms are the ones to get right. `ErrNotOurs` is deliberately not decided by the validator: SPEC ch. 6 step 2 leaves it to each service whether a foreign bearer token is a meta PAT to accept (dolt) or something to refuse -(bench, cover). And `ErrUnavailable` is **503, never 401** — reading an +(bench, cov). And `ErrUnavailable` is **503, never 401** — reading an unreachable daemon as "revoked" would refuse live tokens across the instance for the length of a tokens.sr.ht restart. diff --git a/chrome/chrome.go b/chrome/chrome.go index c9198c6b9298c7d1a6ecaf5f51789a9ce016c587..c6888d7244ee123403066c524c91679319382315 100644 --- a/chrome/chrome.go +++ b/chrome/chrome.go @@ -1,5 +1,5 @@ // Package chrome is the shared page chrome for the custom services of a -// self-hosted SourceHut instance (diff, spec, dolt, cover, bench, ...). +// self-hosted SourceHut instance (diff, spec, dolt, cov, bench, ...). // // Every one of those services renders the same top strip: the brand (circle // icon + site name + red service label), the service switcher derived from the @@ -172,7 +172,7 @@ type Page struct { // // Updated and Meta are optional, and deliberately so. Four services wanted a // listing here and disagreed about its shape: bench and spec needed a -// modification time, dolt has no timestamp in its schema at all, and cover's +// modification time, dolt has no timestamp in its schema at all, and cov's // index is a table of percentages and sparklines that no shared partial will // ever render. A required column would have pushed dolt back onto a local // copy; a zero Updated and a nil Meta render nothing, which is what keeps all diff --git a/ecoretest/ecoretest.go b/ecoretest/ecoretest.go index 8da69e87c807cfa45dbc4c36b673645cb2af1cbe..e0596ab27adff8427fb9ccfc48ba21c938561449 100644 --- a/ecoretest/ecoretest.go +++ b/ecoretest/ecoretest.go @@ -1,5 +1,5 @@ // Package ecoretest is the test bootstrap shared by the custom services of a -// self-hosted SourceHut instance (diff, spec, dolt, cover, bench, tokens). +// self-hosted SourceHut instance (diff, spec, dolt, cov, bench, tokens). // // Every one of those services opens its web tests with the same two things: a // hand-built ini.File standing in for the instance's config.ini, and a TestMain @@ -115,7 +115,7 @@ var customSections = []string{ "spec.sr.ht", "dolt.sr.ht", "bench.sr.ht", - "cover.sr.ht", + "cov.sr.ht", "tokens.sr.ht", } diff --git a/ecoretest/ecoretest_test.go b/ecoretest/ecoretest_test.go index 2a305b378b5879023503fcbbe97ce290eee2b412..e8ff1d05883108b018f043c6205fe0a383b2b36f 100644 --- a/ecoretest/ecoretest_test.go +++ b/ecoretest/ecoretest_test.go @@ -27,7 +27,7 @@ func TestConfigHasTheSectionsTheNavRulesNeed(t *testing.T) { } assert.Equal(t, []string{ "git", "lists", "todo", "builds", "man", "meta", - "bench", "cover", "diff", "dolt", "spec", "tokens", + "bench", "cov", "diff", "dolt", "spec", "tokens", }, names) for _, item := range nav { diff --git a/grants/grants.go b/grants/grants.go index a057273ef2aed5a50aa3c5ca36c47d90589966d8..9400c09759a235dab6e187e556cda80c45d36408 100644 --- a/grants/grants.go +++ b/grants/grants.go @@ -14,7 +14,7 @@ // This package parses that string and answers questions about it. It does not // know which services exist or which actions they define, and it must not learn: // SPEC ch. 3 gives the vocabulary to the services and keeps the daemon out of -// it, so that adding cover:download to cover.sr.ht is a change to cover.sr.ht. +// it, so that adding cov:download to cov.sr.ht is a change to cov.sr.ht. // An unknown grant is therefore not an error — it is a grant that happens to // admit nobody anywhere, which is the safe direction for a string the daemon // only ever passes through. @@ -160,7 +160,7 @@ func parse(s string, allowID bool) (Grants, error) { g.members[m] = struct{}{} } - // "* cover:upload" is the universal set with a redundant member spelled out; + // "* cov:upload" is the universal set with a redundant member spelled out; // keeping the member would make String round-trip to something longer than // what it means, and Has already answers true for everything. if g.all { @@ -233,8 +233,8 @@ func (g Grants) Empty() bool { return !g.all && len(g.members) == 0 } // Has reports whether the set admits one named action, e.g. "bench:upload". // -// There is no wildcard below the universal one: "cover:*" is a member like any -// other and matches only a validator asking for exactly "cover:*". SPEC ch. 3 +// There is no wildcard below the universal one: "cov:*" is a member like any +// other and matches only a validator asking for exactly "cov:*". SPEC ch. 3 // defines "*" and nothing else, and a per-service wildcard invented here would // be a permission the services do not know they are honouring. func (g Grants) Has(grant string) bool { diff --git a/grants/grants_test.go b/grants/grants_test.go index 69c171e30f3b55eaf48703cafc5ddc51ecae01f4..3f777534a032856bf745df653fc3ccf5ac056149 100644 --- a/grants/grants_test.go +++ b/grants/grants_test.go @@ -21,14 +21,14 @@ import ( var nbsp = string(rune(0x00a0)) func TestParseReadsTheVocabularyOfTheSpec(t *testing.T) { - g, err := Parse("cover:upload bench:upload spec:propose") + g, err := Parse("cov:upload bench:upload spec:propose") require.NoError(t, err) assert.False(t, g.All()) - assert.True(t, g.Has("cover:upload")) + assert.True(t, g.Has("cov:upload")) assert.True(t, g.Has("bench:upload")) assert.True(t, g.Has("spec:propose")) - assert.False(t, g.Has("cover:read"), "a grant not named is not held") + assert.False(t, g.Has("cov:read"), "a grant not named is not held") assert.Equal(t, 0, g.TokenID(), "no id: member, so no row id") } @@ -61,20 +61,20 @@ func TestZeroGrantsAdmitNothing(t *testing.T) { assert.Equal(t, "", g.String()) } -// "* cover:upload" is the universal set with one member spelled out redundantly. +// "* cov:upload" is the universal set with one member spelled out redundantly. // Keeping the member would make String render something longer than what it // means. func TestUniversalAbsorbsNamedMembers(t *testing.T) { - g, err := Parse("cover:upload * bench:read") + g, err := Parse("cov:upload * bench:read") require.NoError(t, err) assert.True(t, g.All()) assert.Equal(t, "*", g.String()) } func TestStringIsSortedAndDeduplicated(t *testing.T) { - g, err := Parse("spec:propose cover:upload bench:upload cover:upload") + g, err := Parse("spec:propose cov:upload bench:upload cov:upload") require.NoError(t, err) - assert.Equal(t, "bench:upload cover:upload spec:propose", g.String(), + assert.Equal(t, "bench:upload cov:upload spec:propose", g.String(), "one permission set must have one spelling: the string is both a column and a token payload") } @@ -92,13 +92,13 @@ func TestMalformedGrantsAreRefused(t *testing.T) { for name, s := range map[string]string{ "no colon": "coverupload", "leading colon": ":upload", - "trailing colon": "cover:", - "empty segment": "cover::upload", + "trailing colon": "cov:", + "empty segment": "cov::upload", "upper case": "Cover:upload", - "non-ascii": "cover:upload" + nbsp, + "non-ascii": "cov:upload" + nbsp, "lone nbsp": nbsp, - "control byte": "cover:up\x01load", - "bare wildcard 2": "cover:upload **", + "control byte": "cov:up\x01load", + "bare wildcard 2": "cov:upload **", } { t.Run(name, func(t *testing.T) { _, err := Parse(s) @@ -130,7 +130,7 @@ func TestOverlongGrantsAreRefused(t *testing.T) { // caller who could choose it could point their token's revocation check at // somebody else's live row and make their own revoke a no-op. func TestRequestedGrantsRefuseTheReservedIDMember(t *testing.T) { - for _, s := range []string{"id:7", "cover:upload id:7", "id:0", "id:nope"} { + for _, s := range []string{"id:7", "cov:upload id:7", "id:0", "id:nope"} { _, err := ParseRequested(s) require.Error(t, err, "should refuse %q", s) assert.True(t, errors.Is(err, ErrInvalid), "%q: %v", s, err) @@ -183,10 +183,10 @@ func TestIsSubsetOfIsTheNarrowingRule(t *testing.T) { return g } - parent := parse("cover:upload bench:upload") + parent := parse("cov:upload bench:upload") assert.True(t, parse("bench:upload").IsSubsetOf(parent), "dropping a grant narrows") - assert.True(t, parse("cover:upload bench:upload").IsSubsetOf(parent), "asking for all of them") + assert.True(t, parse("cov:upload bench:upload").IsSubsetOf(parent), "asking for all of them") assert.True(t, Grants{}.IsSubsetOf(parent), "the empty set is a subset of anything") assert.False(t, parse("spec:propose").IsSubsetOf(parent), "a grant the parent lacks") @@ -201,7 +201,7 @@ func TestIsSubsetOfIsTheNarrowingRule(t *testing.T) { // A stamped child is still a narrowing of its parent: the id: is not a // permission and must take no part in the comparison. func TestSubsetIgnoresTheIDMember(t *testing.T) { - parent, err := Parse("cover:upload bench:upload") + parent, err := Parse("cov:upload bench:upload") require.NoError(t, err) child, err := Parse("bench:upload id:42") require.NoError(t, err)