A terminal client for Tangled.
tui go tangled cli
6

Configure Feed

Select the types of activity you want to include in your feed.

atproto: add getrecord and listrecords methods, move serviceauth to struct, and implement ssh-key cli commands

Aly Raffauf (Jul 8, 2026, 11:38 AM EDT) 370174a1 bcab7a47

+284 -201
+67 -8
atproto/records.go
··· 8 8 "github.com/bluesky-social/indigo/atproto/syntax" 9 9 ) 10 10 11 - // PutRecordInput is the argument to a com.atproto.repo.putRecord call. 11 + // ATProto wraps an atproto PDS client. The client may be authenticated (from 12 + // AuthManager.APIClient) or a plain public client for read-only queries. 13 + type ATProto struct { 14 + Client *atclient.APIClient 15 + } 16 + 12 17 type PutRecordInput struct { 13 18 Repo string `json:"repo"` 14 19 Collection string `json:"collection"` ··· 16 21 Record any `json:"record"` 17 22 } 18 23 19 - // PutRecord writes a record to the PDS, returning its at:// URI and CID. The 20 - // record must include its $type field. 21 - func PutRecord(ctx context.Context, pds *atclient.APIClient, in PutRecordInput) (uri, cid string, err error) { 22 - if pds == nil { 23 - return "", "", fmt.Errorf("PDS client is required") 24 - } 24 + type GetRecordOutput struct { 25 + URI string `json:"uri"` 26 + CID string `json:"cid,omitempty"` 27 + Value any `json:"value"` 28 + } 29 + 30 + // RecordItem is a single record in a listRecords response. 31 + type RecordItem struct { 32 + URI string `json:"uri"` 33 + CID string `json:"cid,omitempty"` 34 + Value any `json:"value"` 35 + } 36 + 37 + type ListRecordsOutput struct { 38 + Records []RecordItem `json:"records"` 39 + Cursor *string `json:"cursor,omitempty"` 40 + } 41 + 42 + type ListRecordsOpts struct { 43 + Limit int64 44 + Cursor string 45 + Reverse bool 46 + } 47 + 48 + // PutRecord writes a record to the PDS, returning its at:// URI and CID. 49 + func (a *ATProto) PutRecord(ctx context.Context, in PutRecordInput) (uri, cid string, err error) { 25 50 var out struct { 26 51 URI string `json:"uri"` 27 52 CID string `json:"cid,omitempty"` 28 53 } 29 - if err := pds.Post(ctx, syntax.NSID("com.atproto.repo.putRecord"), in, &out); err != nil { 54 + if err := a.Client.Post(ctx, syntax.NSID("com.atproto.repo.putRecord"), in, &out); err != nil { 30 55 return "", "", fmt.Errorf("put %s/%s record: %w", in.Collection, in.Rkey, err) 31 56 } 32 57 return out.URI, out.CID, nil 33 58 } 59 + 60 + func (a *ATProto) GetRecord(ctx context.Context, repo, collection, rkey string) (*GetRecordOutput, error) { 61 + var out GetRecordOutput 62 + params := map[string]any{ 63 + "repo": repo, 64 + "collection": collection, 65 + "rkey": rkey, 66 + } 67 + if err := a.Client.Get(ctx, syntax.NSID("com.atproto.repo.getRecord"), params, &out); err != nil { 68 + return nil, fmt.Errorf("get %s/%s record for %q: %w", collection, rkey, repo, err) 69 + } 70 + return &out, nil 71 + } 72 + 73 + func (a *ATProto) ListRecords(ctx context.Context, repo, collection string, opts ListRecordsOpts) (*ListRecordsOutput, error) { 74 + params := map[string]any{ 75 + "repo": repo, 76 + "collection": collection, 77 + } 78 + if opts.Limit > 0 { 79 + params["limit"] = opts.Limit 80 + } 81 + if opts.Cursor != "" { 82 + params["cursor"] = opts.Cursor 83 + } 84 + if opts.Reverse { 85 + params["reverse"] = true 86 + } 87 + var out ListRecordsOutput 88 + if err := a.Client.Get(ctx, syntax.NSID("com.atproto.repo.listRecords"), params, &out); err != nil { 89 + return nil, fmt.Errorf("list %s records for %q: %w", collection, repo, err) 90 + } 91 + return &out, nil 92 + }
+4 -8
atproto/serviceauth.go
··· 5 5 "fmt" 6 6 "time" 7 7 8 - "github.com/bluesky-social/indigo/atproto/atclient" 9 8 "github.com/bluesky-social/indigo/atproto/syntax" 10 9 ) 11 10 12 - const serviceAuthTTL = 60 * time.Second 11 + const SERVICE_AUTH_TTL = 60 * time.Second 13 12 14 13 // GetServiceAuth mints a short-lived service-auth JWT scoped to one lexicon 15 14 // method on one audience (e.g. a knot's did:web). Present it to that audience 16 15 // as a Bearer token. 17 - func GetServiceAuth(ctx context.Context, pds *atclient.APIClient, audience, lexiconMethod string) (string, error) { 18 - if pds == nil { 19 - return "", fmt.Errorf("PDS client is required") 20 - } 16 + func (a *ATProto) GetServiceAuth(ctx context.Context, audience, lexiconMethod string) (string, error) { 21 17 var out struct { 22 18 Token string `json:"token"` 23 19 } 24 20 params := map[string]any{ 25 21 "aud": audience, 26 - "exp": time.Now().Add(serviceAuthTTL).Unix(), 22 + "exp": time.Now().Add(SERVICE_AUTH_TTL).Unix(), 27 23 "lxm": lexiconMethod, 28 24 } 29 - if err := pds.Get(ctx, syntax.NSID("com.atproto.server.getServiceAuth"), params, &out); err != nil { 25 + if err := a.Client.Get(ctx, syntax.NSID("com.atproto.server.getServiceAuth"), params, &out); err != nil { 30 26 return "", fmt.Errorf("get service auth for %q: %w", audience, err) 31 27 } 32 28 if out.Token == "" {
+1 -25
go.mod
··· 11 11 github.com/beorn7/perks v1.0.1 // indirect 12 12 github.com/cespare/xxhash/v2 v2.2.0 // indirect 13 13 github.com/earthboundkid/versioninfo/v2 v2.24.1 // indirect 14 - github.com/felixge/httpsnoop v1.0.4 // indirect 15 - github.com/go-logr/logr v1.4.1 // indirect 16 - github.com/go-logr/stdr v1.2.2 // indirect 17 - github.com/gogo/protobuf v1.3.2 // indirect 18 14 github.com/golang-jwt/jwt/v5 v5.2.2 // indirect 15 + github.com/google/go-cmp v0.6.0 // indirect 19 16 github.com/google/go-querystring v1.1.0 // indirect 20 - github.com/google/uuid v1.4.0 // indirect 21 - github.com/hashicorp/go-cleanhttp v0.5.2 // indirect 22 - github.com/hashicorp/go-retryablehttp v0.7.5 // indirect 23 - github.com/hashicorp/golang-lru v1.0.2 // indirect 24 17 github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect 25 18 github.com/inconshreveable/mousetrap v1.1.0 // indirect 26 - github.com/ipfs/bbloom v0.0.4 // indirect 27 19 github.com/ipfs/go-block-format v0.2.0 // indirect 28 20 github.com/ipfs/go-cid v0.4.1 // indirect 29 - github.com/ipfs/go-datastore v0.6.0 // indirect 30 - github.com/ipfs/go-ipfs-blockstore v1.3.1 // indirect 31 - github.com/ipfs/go-ipfs-ds-help v1.1.1 // indirect 32 21 github.com/ipfs/go-ipfs-util v0.0.3 // indirect 33 22 github.com/ipfs/go-ipld-cbor v0.1.0 // indirect 34 23 github.com/ipfs/go-ipld-format v0.6.0 // indirect 35 - github.com/ipfs/go-log v1.0.5 // indirect 36 - github.com/ipfs/go-log/v2 v2.5.1 // indirect 37 - github.com/ipfs/go-metrics-interface v0.0.1 // indirect 38 - github.com/jbenet/goprocess v0.1.4 // indirect 39 24 github.com/klauspost/cpuid/v2 v2.2.7 // indirect 40 - github.com/mattn/go-isatty v0.0.20 // indirect 41 25 github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect 42 26 github.com/minio/sha256-simd v1.0.1 // indirect 43 27 github.com/mr-tron/base58 v1.2.0 // indirect ··· 46 30 github.com/multiformats/go-multibase v0.2.0 // indirect 47 31 github.com/multiformats/go-multihash v0.2.3 // indirect 48 32 github.com/multiformats/go-varint v0.0.7 // indirect 49 - github.com/opentracing/opentracing-go v1.2.0 // indirect 50 33 github.com/polydawn/refmt v0.89.1-0.20221221234430-40501e09de1f // indirect 51 34 github.com/prometheus/client_golang v1.17.0 // indirect 52 35 github.com/prometheus/client_model v0.5.0 // indirect ··· 57 40 github.com/whyrusleeping/cbor-gen v0.2.1-0.20241030202151-b7a6831be65e // indirect 58 41 gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b // indirect 59 42 gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect 60 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect 61 - go.opentelemetry.io/otel v1.21.0 // indirect 62 - go.opentelemetry.io/otel/metric v1.21.0 // indirect 63 - go.opentelemetry.io/otel/trace v1.21.0 // indirect 64 - go.uber.org/atomic v1.11.0 // indirect 65 - go.uber.org/multierr v1.11.0 // indirect 66 - go.uber.org/zap v1.26.0 // indirect 67 43 golang.org/x/crypto v0.21.0 // indirect 68 44 golang.org/x/sys v0.22.0 // indirect 69 45 golang.org/x/time v0.3.0 // indirect
-138
go.sum
··· 1 1 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 2 - github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= 3 2 github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 4 3 github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= 5 4 github.com/bluesky-social/indigo v0.0.0-20260629160527-dfe5578fd537 h1:rHaND0argSxgbmE2ix/YuF11xXTtiP3oGUz4fS2Diqo= ··· 8 7 github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 9 8 github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 10 9 github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= 11 - github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 12 10 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 13 11 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 14 12 github.com/earthboundkid/versioninfo/v2 v2.24.1 h1:SJTMHaoUx3GzjjnUO1QzP3ZXK6Ee/nbWyCm58eY3oUg= 15 13 github.com/earthboundkid/versioninfo/v2 v2.24.1/go.mod h1:VcWEooDEuyUJnMfbdTh0uFN4cfEIg+kHMuWB2CDCLjw= 16 - github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= 17 - github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= 18 - github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= 19 - github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= 20 - github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= 21 - github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= 22 - github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= 23 14 github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= 24 - github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= 25 - github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= 26 15 github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= 27 16 github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= 28 17 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= ··· 30 19 github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 31 20 github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= 32 21 github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= 33 - github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 34 - github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= 35 - github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 36 22 github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= 37 23 github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= 38 - github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= 39 - github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= 40 - github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= 41 - github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= 42 - github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= 43 - github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= 44 - github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= 45 - github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= 46 24 github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= 47 25 github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= 48 26 github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= 49 27 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 50 - github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= 51 - github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= 52 28 github.com/ipfs/go-block-format v0.2.0 h1:ZqrkxBA2ICbDRbK8KJs/u0O3dlp6gmAuuXUJNiW1Ycs= 53 29 github.com/ipfs/go-block-format v0.2.0/go.mod h1:+jpL11nFx5A/SPpsoBn6Bzkra/zaArfSmsknbPMYgzM= 54 30 github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= 55 31 github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= 56 - github.com/ipfs/go-datastore v0.6.0 h1:JKyz+Gvz1QEZw0LsX1IBn+JFCJQH4SJVFtM4uWU0Myk= 57 - github.com/ipfs/go-datastore v0.6.0/go.mod h1:rt5M3nNbSO/8q1t4LNkLyUwRs8HupMeN/8O4Vn9YAT8= 58 - github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= 59 - github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= 60 - github.com/ipfs/go-ipfs-blockstore v1.3.1 h1:cEI9ci7V0sRNivqaOr0elDsamxXFxJMMMy7PTTDQNsQ= 61 - github.com/ipfs/go-ipfs-blockstore v1.3.1/go.mod h1:KgtZyc9fq+P2xJUiCAzbRdhhqJHvsw8u2Dlqy2MyRTE= 62 - github.com/ipfs/go-ipfs-ds-help v1.1.1 h1:B5UJOH52IbcfS56+Ul+sv8jnIV10lbjLF5eOO0C66Nw= 63 - github.com/ipfs/go-ipfs-ds-help v1.1.1/go.mod h1:75vrVCkSdSFidJscs8n4W+77AtTpCIAdDGAwjitJMIo= 64 32 github.com/ipfs/go-ipfs-util v0.0.3 h1:2RFdGez6bu2ZlZdI+rWfIdbQb1KudQp3VGwPtdNCmE0= 65 33 github.com/ipfs/go-ipfs-util v0.0.3/go.mod h1:LHzG1a0Ig4G+iZ26UUOMjHd+lfM84LZCrn17xAKWBvs= 66 34 github.com/ipfs/go-ipld-cbor v0.1.0 h1:dx0nS0kILVivGhfWuB6dUpMa/LAwElHPw1yOGYopoYs= 67 35 github.com/ipfs/go-ipld-cbor v0.1.0/go.mod h1:U2aYlmVrJr2wsUBU67K4KgepApSZddGRDWBYR0H4sCk= 68 36 github.com/ipfs/go-ipld-format v0.6.0 h1:VEJlA2kQ3LqFSIm5Vu6eIlSxD/Ze90xtc4Meten1F5U= 69 37 github.com/ipfs/go-ipld-format v0.6.0/go.mod h1:g4QVMTn3marU3qXchwjpKPKgJv+zF+OlaKMyhJ4LHPg= 70 - github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= 71 - github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= 72 - github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= 73 - github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= 74 - github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= 75 - github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg= 76 - github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j/b/tL7HTWtJ4VPgWY= 77 - github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= 78 - github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= 79 - github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= 80 38 github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= 81 39 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 82 - github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= 83 - github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 84 40 github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= 85 41 github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= 86 - github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 87 - github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= 88 - github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 89 - github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 90 - github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 91 - github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 92 - github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 93 - github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= 94 - github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= 95 - github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 96 42 github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= 97 43 github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= 98 44 github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= ··· 109 55 github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= 110 56 github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= 111 57 github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= 112 - github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= 113 - github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= 114 - github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 115 58 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 116 59 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 117 60 github.com/polydawn/refmt v0.89.1-0.20221221234430-40501e09de1f h1:VXTQfuJj9vKR4TCkEuWIckKvdHFeJH/huIFJ9/cXOB0= ··· 124 67 github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= 125 68 github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= 126 69 github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= 127 - github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 128 - github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= 129 - github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= 130 70 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 131 71 github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 132 72 github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= ··· 140 80 github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= 141 81 github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= 142 82 github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 143 - github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 144 - github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 145 - github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 146 - github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 147 - github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 148 83 github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= 149 84 github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= 150 85 github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= ··· 152 87 github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= 153 88 github.com/whyrusleeping/cbor-gen v0.2.1-0.20241030202151-b7a6831be65e h1:28X54ciEwwUxyHn9yrZfl5ojgF4CBNLWX7LR0rvBkf4= 154 89 github.com/whyrusleeping/cbor-gen v0.2.1-0.20241030202151-b7a6831be65e/go.mod h1:pM99HXyEbSQHcosHc0iW7YFmwnscr+t9Te4ibko05so= 155 - github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 156 - github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 157 - github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 158 90 gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b h1:CzigHMRySiX3drau9C6Q5CAbNIApmLdat5jPMqChvDA= 159 91 gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b/go.mod h1:/y/V339mxv2sZmYYR64O07VuCpdNZqCTwO8ZcouTMI8= 160 92 gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 h1:qwDnMxjkyLmAFgcfgTnfJrmYKWhHnci3GjDqcZp1M3Q= 161 93 gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02/go.mod h1:JTnUj0mpYiAsuZLmKjTx/ex3AtMowcCgnE7YNyCEP0I= 162 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= 163 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= 164 - go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= 165 - go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= 166 - go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= 167 - go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= 168 - go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= 169 - go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= 170 - go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= 171 - go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= 172 - go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= 173 - go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= 174 - go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= 175 - go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= 176 - go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= 177 - go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= 178 - go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= 179 - go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= 180 - go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= 181 - go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= 182 - go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= 183 - go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= 184 - go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= 185 - go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= 186 94 go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= 187 95 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 188 - golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 189 - golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 190 - golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 191 96 golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= 192 97 golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= 193 - golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 194 - golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 195 - golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 196 - golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 197 - golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 198 98 golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 199 - golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 200 - golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 201 - golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 202 - golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 203 - golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= 204 - golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 205 - golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 206 - golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 207 - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 208 99 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 209 - golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 210 - golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 211 - golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 212 - golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 213 - golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 214 - golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 215 100 golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 216 - golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 217 101 golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= 218 102 golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 219 - golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 220 103 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 221 - golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 222 104 golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= 223 105 golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 224 - golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 225 - golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 226 106 golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 227 - golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 228 - golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 229 - golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 230 - golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 231 - golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 232 - golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 233 - golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 234 - golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 235 - golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 236 107 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 237 - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 238 108 golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= 239 109 golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= 240 110 google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= 241 111 google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= 242 112 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 243 - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 244 - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= 245 - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= 246 - gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 247 113 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 248 - gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 249 - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 250 - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 251 114 gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 252 115 gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 253 - honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 254 116 lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= 255 117 lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k=
+15 -20
internal/cli/repo_create.go
··· 10 10 "github.com/alyraffauf/tg/internal/gitutil" 11 11 "github.com/alyraffauf/tg/knot" 12 12 "github.com/alyraffauf/tg/tangled" 13 - "github.com/bluesky-social/indigo/atproto/atclient" 14 13 "github.com/spf13/cobra" 15 14 ) 16 15 ··· 48 47 if err != nil { 49 48 return fmt.Errorf("get auth client: %w", err) 50 49 } 51 - did := pds.AccountDID.String() 50 + atClient := &atproto.ATProto{Client: pds} 51 + did := auth.CurrentDID().String() 52 52 53 53 knotHost := repoCreateKnot 54 54 if knotHost == "" { 55 55 knotHost = knot.DefaultKnot 56 56 } 57 57 58 - uri, err := provisionRepo(ctx, pds, provisionRepoInput{ 58 + uri, err := provisionRepo(ctx, atClient, provisionRepoInput{ 59 59 KnotHost: knotHost, 60 60 OwnerDID: did, 61 61 Name: args[0], ··· 78 78 } 79 79 } 80 80 if repoCreatePushPath != "" { 81 - if err := pushToNewRepo(ctx, pds, pushToNewRepoInput{ 81 + if err := pushToNewRepo(ctx, atClient, pushToNewRepoInput{ 82 82 KnotHost: knotHost, 83 83 RepoURI: uri, 84 84 Handle: handle, ··· 109 109 } 110 110 111 111 // provisionRepo creates the repo on the knot and writes the sh.tangled.repo 112 - // record to the PDS. 113 - func provisionRepo(ctx context.Context, pds *atclient.APIClient, in provisionRepoInput) (string, error) { 114 - token, err := atproto.GetServiceAuth(ctx, pds, "did:web:"+in.KnotHost, "sh.tangled.repo.create") 112 + // record to the user's PDS. 113 + func provisionRepo(ctx context.Context, atClient *atproto.ATProto, in provisionRepoInput) (string, error) { 114 + token, err := atClient.GetServiceAuth(ctx, "did:web:"+in.KnotHost, "sh.tangled.repo.create") 115 115 if err != nil { 116 116 return "", err 117 117 } ··· 122 122 if err != nil { 123 123 return "", err 124 124 } 125 - // Name omitted: it's the rkey, and the AppView derives it from there. 126 125 record := tangled.RepoRecord{ 127 126 Type: "sh.tangled.repo", 128 127 Knot: in.KnotHost, ··· 132 131 if in.Description != "" { 133 132 record.Description = in.Description 134 133 } 135 - uri, _, err := atproto.PutRecord(ctx, pds, atproto.PutRecordInput{ 134 + uri, _, err := atClient.PutRecord(ctx, atproto.PutRecordInput{ 136 135 Repo: in.OwnerDID, 137 136 Collection: "sh.tangled.repo", 138 137 Rkey: in.Name, ··· 153 152 RemoteName string 154 153 } 155 154 156 - // pushToNewRepo sets the default branch to the local repo's current branch, 157 - // then pushes. Default-branch failure is warned, not fatal. Set before push so 158 - // the knot's post-receive hook sees pushed == default and skips its PR 159 - // suggestion. 160 - func pushToNewRepo(ctx context.Context, pds *atclient.APIClient, in pushToNewRepoInput) error { 161 - branch, err := setDefaultBranch(ctx, pds, setDefaultBranchInput{ 155 + // pushToNewRepo sets the default branch then pushes. Default-branch failure is 156 + // warned, not fatal. Set before push so the knot's hook skips its PR suggestion. 157 + func pushToNewRepo(ctx context.Context, atClient *atproto.ATProto, in pushToNewRepoInput) error { 158 + branch, err := setDefaultBranch(ctx, atClient, setDefaultBranchInput{ 162 159 KnotHost: in.KnotHost, 163 160 RepoURI: in.RepoURI, 164 161 Dir: in.PushPath, ··· 186 183 } 187 184 188 185 // setDefaultBranch repoints the default branch to the local repo's current 189 - // branch. Mints a fresh token — the create token is lexicon-scoped and won't 190 - // authorize setDefaultBranch. 191 - func setDefaultBranch(ctx context.Context, pds *atclient.APIClient, in setDefaultBranchInput) (string, error) { 186 + // branch. Mints a fresh token because the create token is lexicon-scoped. 187 + func setDefaultBranch(ctx context.Context, atClient *atproto.ATProto, in setDefaultBranchInput) (string, error) { 192 188 branch, err := gitutil.CurrentBranch(ctx, in.Dir) 193 189 if err != nil { 194 190 return "", err 195 191 } 196 - token, err := atproto.GetServiceAuth(ctx, pds, "did:web:"+in.KnotHost, "sh.tangled.repo.setDefaultBranch") 192 + token, err := atClient.GetServiceAuth(ctx, "did:web:"+in.KnotHost, "sh.tangled.repo.setDefaultBranch") 197 193 if err != nil { 198 194 return "", err 199 195 } ··· 206 202 return branch, nil 207 203 } 208 204 209 - // ownerHandle resolves an owner DID to a handle, falling back to the DID. 210 205 func ownerHandle(ctx context.Context, did string) string { 211 206 if ident, err := resolver.ResolveDID(ctx, did); err == nil { 212 207 return ident.Handle.String()
+16
internal/cli/repo_list.go
··· 57 57 return rc.Handle, nil 58 58 } 59 59 60 + // resolveHandleOrSelf returns the handle from an explicit argument, or the 61 + // authenticated user's handle. It does not fall back to CWD git detection. 62 + func resolveHandleOrSelf(ctx context.Context, args []string) (string, error) { 63 + if len(args) == 1 { 64 + return args[0], nil 65 + } 66 + if auth == nil || !auth.IsAuthenticated() { 67 + return "", fmt.Errorf("not logged in; provide a handle or run \"tg auth login\"") 68 + } 69 + ident, err := resolver.ResolveDID(ctx, auth.CurrentDID().String()) 70 + if err != nil { 71 + return "", fmt.Errorf("resolve your DID: %w", err) 72 + } 73 + return ident.Handle.String(), nil 74 + } 75 + 60 76 type repoRow struct { 61 77 name string 62 78 knot string
+5 -1
internal/cli/root.go
··· 20 20 var ( 21 21 resolver = &atproto.Resolver{Directory: identity.DefaultDirectory()} 22 22 client = &tangled.Tangled{ 23 - Client: &atclient.APIClient{Host: "https://api.tangled.org"}, 23 + Client: &atclient.APIClient{Host: "https://bobbin.klbr.net"}, 24 24 Logger: slog.Default(), 25 25 } 26 26 auth *atproto.AuthManager ··· 54 54 repoCmd.AddCommand(repoCloneCmd) 55 55 repoCmd.AddCommand(repoCreateCmd) 56 56 repoCmd.AddCommand(repoListCmd) 57 + 58 + rootCmd.AddCommand(sshKeyCmd) 59 + sshKeyCmd.AddCommand(sshKeyAddCmd) 60 + sshKeyCmd.AddCommand(sshKeyListCmd) 57 61 } 58 62 59 63 func initAuth() {
+16
internal/cli/ssh_key.go
··· 1 + package cli 2 + 3 + import "github.com/spf13/cobra" 4 + 5 + // sshKeyRecord is the value of a sh.tangled.publicKey record. 6 + type sshKeyRecord struct { 7 + Type string `json:"$type"` 8 + Key string `json:"key"` 9 + Name string `json:"name"` 10 + CreatedAt string `json:"createdAt"` 11 + } 12 + 13 + var sshKeyCmd = &cobra.Command{ 14 + Use: "ssh-key", 15 + Short: "Manage SSH keys on Tangled", 16 + }
+87
internal/cli/ssh_key_add.go
··· 1 + package cli 2 + 3 + import ( 4 + "fmt" 5 + "os" 6 + "path/filepath" 7 + "strings" 8 + "time" 9 + 10 + "github.com/alyraffauf/tg/atproto" 11 + "github.com/bluesky-social/indigo/atproto/syntax" 12 + "github.com/spf13/cobra" 13 + ) 14 + 15 + var sshKeyAddTitle string 16 + 17 + var sshKeyAddCmd = &cobra.Command{ 18 + Use: "add [<key-file>]", 19 + Short: "Add an SSH key to your Tangled account", 20 + Long: `Add an SSH public key to your Tangled account. 21 + 22 + If no key file is given, defaults to ~/.ssh/id_ed25519.pub. 23 + Requires authentication (run "tg auth login" first).`, 24 + Args: cobra.MaximumNArgs(1), 25 + RunE: func(cmd *cobra.Command, args []string) error { 26 + ctx := cmd.Context() 27 + 28 + if auth == nil || !auth.IsAuthenticated() { 29 + return fmt.Errorf("not logged in; run \"tg auth login\" first") 30 + } 31 + 32 + keyPath := "~/.ssh/id_ed25519.pub" 33 + if len(args) == 1 { 34 + keyPath = args[0] 35 + } 36 + if strings.HasPrefix(keyPath, "~/") { 37 + home, err := os.UserHomeDir() 38 + if err != nil { 39 + return fmt.Errorf("resolve home directory: %w", err) 40 + } 41 + keyPath = filepath.Join(home, keyPath[2:]) 42 + } 43 + 44 + keyBytes, err := os.ReadFile(keyPath) 45 + if err != nil { 46 + return fmt.Errorf("read key file %q: %w", keyPath, err) 47 + } 48 + key := strings.TrimSpace(string(keyBytes)) 49 + if key == "" { 50 + return fmt.Errorf("key file %q is empty", keyPath) 51 + } 52 + 53 + title := sshKeyAddTitle 54 + if title == "" { 55 + title = filepath.Base(keyPath) 56 + } 57 + 58 + pds, err := auth.APIClient(ctx) 59 + if err != nil { 60 + return fmt.Errorf("get auth client: %w", err) 61 + } 62 + atClient := &atproto.ATProto{Client: pds} 63 + did := auth.CurrentDID().String() 64 + 65 + uri, _, err := atClient.PutRecord(ctx, atproto.PutRecordInput{ 66 + Repo: did, 67 + Collection: "sh.tangled.publicKey", 68 + Rkey: string(syntax.NewTIDNow(0)), 69 + Record: sshKeyRecord{ 70 + Type: "sh.tangled.publicKey", 71 + Key: key, 72 + Name: title, 73 + CreatedAt: time.Now().UTC().Format(time.RFC3339), 74 + }, 75 + }) 76 + if err != nil { 77 + return fmt.Errorf("add SSH key: %w", err) 78 + } 79 + 80 + fmt.Printf("Added SSH key %q (%s)\n", title, uri) 81 + return nil 82 + }, 83 + } 84 + 85 + func init() { 86 + sshKeyAddCmd.Flags().StringVarP(&sshKeyAddTitle, "title", "t", "", "Title for the new key") 87 + }
+72
internal/cli/ssh_key_list.go
··· 1 + package cli 2 + 3 + import ( 4 + "encoding/json" 5 + "fmt" 6 + "os" 7 + "text/tabwriter" 8 + 9 + "github.com/alyraffauf/tg/atproto" 10 + "github.com/bluesky-social/indigo/atproto/atclient" 11 + "github.com/spf13/cobra" 12 + ) 13 + 14 + var sshKeyListCmd = &cobra.Command{ 15 + Use: "list [handle]", 16 + Short: "List SSH keys on a Tangled account", 17 + Long: `List SSH keys on a Tangled account. 18 + 19 + If no argument is given, lists the authenticated user's keys 20 + (run "tg auth login" first).`, 21 + Args: cobra.MaximumNArgs(1), 22 + RunE: func(cmd *cobra.Command, args []string) error { 23 + ctx := cmd.Context() 24 + 25 + handle, err := resolveHandleOrSelf(ctx, args) 26 + if err != nil { 27 + return err 28 + } 29 + 30 + ident, err := resolver.ResolveHandle(ctx, handle) 31 + if err != nil { 32 + return fmt.Errorf("resolve handle %q: %w", handle, err) 33 + } 34 + 35 + pdsURL, err := resolver.ResolvePDS(ctx, ident.DID.String()) 36 + if err != nil { 37 + return fmt.Errorf("resolve PDS for %q: %w", handle, err) 38 + } 39 + 40 + atClient := &atproto.ATProto{Client: &atclient.APIClient{Host: pdsURL}} 41 + out, err := atClient.ListRecords(ctx, ident.DID.String(), "sh.tangled.publicKey", atproto.ListRecordsOpts{Limit: defaultListLimit}) 42 + if err != nil { 43 + return fmt.Errorf("list SSH keys for %q: %w", handle, err) 44 + } 45 + 46 + renderSSHKeys(out.Records) 47 + return nil 48 + }, 49 + } 50 + 51 + func renderSSHKeys(items []atproto.RecordItem) { 52 + if len(items) == 0 { 53 + fmt.Println("No SSH keys found.") 54 + return 55 + } 56 + 57 + tw := tabwriter.NewWriter(os.Stdout, 0, 0, 3, ' ', tabwriter.TabIndent) 58 + fmt.Fprintln(tw, "NAME\tKEY\tADDED") 59 + 60 + for _, item := range items { 61 + var rec sshKeyRecord 62 + data, err := json.Marshal(item.Value) 63 + if err != nil { 64 + continue 65 + } 66 + if err := json.Unmarshal(data, &rec); err != nil { 67 + continue 68 + } 69 + fmt.Fprintf(tw, "%s\t%s\t%s\n", rec.Name, rec.Key, shortDate(rec.CreatedAt)) 70 + } 71 + tw.Flush() 72 + }
+1 -1
nix/tg.nix
··· 6 6 pname = "tg"; 7 7 version = "dev"; 8 8 src = ../.; 9 - vendorHash = "sha256-7kiyK6Bxlkgw7qHGiQbHJGv0nu53L8xLvDk6S06ahTM="; 9 + vendorHash = "sha256-4e3RU0z5rh8cDSW7fQSfQM8sqeD53PA0BYGTTjtF23E="; 10 10 subPackages = ["cmd/tg"]; 11 11 env.CGO_ENABLED = "0"; 12 12