Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bnewbold/rainbow safe account fix #880

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
e8c9d2e
identity: default dir with 100 max idle conns, and 1sec idle
bnewbold Nov 15, 2024
ed0a5c6
identity: drop default HTTP timeout from 15s to 10s
bnewbold Nov 15, 2024
d88346a
identity: drop default DNS timeout from 5s to 3s
bnewbold Nov 15, 2024
0fc4c7e
identity package default tweaks (#811)
bnewbold Nov 15, 2024
1b7e54e
allow carstore to use multiple directories, round robin style
whyrusleeping Nov 15, 2024
fd6ae47
fixup build
whyrusleeping Nov 15, 2024
ffe7fb6
more test fixups
whyrusleeping Nov 15, 2024
ea1aca3
:bug: Fix typo in moderation review state check
foysalit Nov 16, 2024
d7fd302
:bug: Use actual value of review state
foysalit Nov 16, 2024
05b8751
allow carstore to use multiple directories, round robin style (#812)
whyrusleeping Nov 16, 2024
0fb485d
add a user cache on the bgs
whyrusleeping Nov 16, 2024
7057577
fixup refactor
whyrusleeping Nov 16, 2024
4a15b38
fix lint
whyrusleeping Nov 16, 2024
a422903
add a user cache on the bgs (#816)
whyrusleeping Nov 16, 2024
30a2725
Add more metrics to the relay
ericvolp12 Nov 17, 2024
15004ab
whoops
ericvolp12 Nov 17, 2024
3a4136f
Rename series
ericvolp12 Nov 17, 2024
1eeb496
Track disk vs meta write durations
ericvolp12 Nov 17, 2024
be57b0d
Add more metrics to the relay (#817)
ericvolp12 Nov 17, 2024
83811b9
Merge remote-tracking branch 'origin/main' into feat/splitter-rebase
brianolson Nov 18, 2024
1a4cf37
Bolson/rainbow (#818)
bnewbold Nov 18, 2024
cdb910d
tiny HACKING entry
bnewbold Nov 19, 2024
9883734
rainbow README
bnewbold Nov 19, 2024
eb257e5
tweak dockerfile description
bnewbold Nov 19, 2024
646117f
import ordering
bnewbold Nov 19, 2024
3c7c769
have daemon refer to itself as rainbow (not splitter)
bnewbold Nov 19, 2024
2ddae12
some args as env vars
bnewbold Nov 19, 2024
e3e8d70
defaults for file paths (and env vars)
bnewbold Nov 19, 2024
2c8d601
drop default persist window to 72hr (matching bigsky)
bnewbold Nov 19, 2024
655eb49
add root path handler for rainbow
bnewbold Nov 19, 2024
c0181b6
Bnewbold/readme rainbow (#822)
bnewbold Nov 19, 2024
65fa60b
rainbow service setup tweaks (#821)
bnewbold Nov 19, 2024
fa1eb34
Rewind cursor a bit before reconnection for some relay hosts to smoot…
ericvolp12 Nov 19, 2024
966c093
Rewind cursor a bit before reconnection for some relay hosts to smoot…
whyrusleeping Nov 19, 2024
eec59cd
add --next-crawler to forward requestCrawl calls to
brianolson Nov 19, 2024
af8753c
configurable circuit breakers
haileyok Nov 19, 2024
23deea7
fix test
haileyok Nov 19, 2024
40a55ce
default values
haileyok Nov 19, 2024
cd076e2
one more default value
haileyok Nov 19, 2024
9198b79
automod: configurable circuit breaker thresholds (#830)
haileyok Nov 19, 2024
85b52dd
stream resync to indexer crawler
brianolson Nov 19, 2024
8635797
Merge remote-tracking branch 'origin/main' into bolson/requestCrawl-f…
brianolson Nov 20, 2024
7cf0290
forward requestCrawl to multiple nexts
brianolson Nov 20, 2024
e1f818e
set crawlRequest http client timeout
brianolson Nov 20, 2024
6b6afc0
add --next-crawler to forward requestCrawl calls to (#829)
bnewbold Nov 20, 2024
a954f91
fix requestCrawl forwarding
bnewbold Nov 20, 2024
d619a37
fix requestCrawl forwarding (#835)
bnewbold Nov 20, 2024
aff0005
add memcached for did cache to relay
brianolson Nov 21, 2024
8eb0d80
fix a segfault when passing on requestCrawl fails
bnewbold Nov 22, 2024
b6f34c7
fix a segfault when passing on requestCrawl fails (#841)
bnewbold Nov 22, 2024
07de0a0
properly pass sequences for repo account events
whyrusleeping Nov 22, 2024
8a5b99c
properly pass sequences for repo account events (#843)
ericvolp12 Nov 22, 2024
6a25c33
handle response nil, close response.Body
brianolson Nov 22, 2024
b13c675
handle response nil, close response.Body (#844)
bnewbold Nov 22, 2024
e91260a
tool for relay pds resync, and copy pds state from one relay to another
brianolson Nov 20, 2024
091ab9e
fixes
brianolson Nov 20, 2024
de95893
use .HasActiveConnection to re-start crawl on target as needed
brianolson Nov 20, 2024
feceb36
logging tweak
brianolson Nov 20, 2024
2b814e8
direct DID syntax validation helper
bnewbold Nov 29, 2024
1e2f969
syntax: fast-path for did:plc parsing
bnewbold Nov 29, 2024
de950cc
syntax: ParseDID performance (#853)
bnewbold Nov 29, 2024
54f7649
backfill: basic PDS repo fetching fallback
bnewbold Nov 29, 2024
6b00e55
updates to PDS backfill; and search integration
bnewbold Nov 29, 2024
8d81824
add PDS backfill log line
bnewbold Nov 29, 2024
ef5b0b8
add metric indexer_catchup_events_failed, add "how" tag to indexer_ca…
brianolson Nov 19, 2024
a3802a8
better logging
brianolson Nov 20, 2024
911ab8c
repo_commits_received_counter for every way a commit finishes
brianolson Nov 21, 2024
0372220
fix copy-pasteo
brianolson Nov 21, 2024
01fd015
1am typo
brianolson Nov 21, 2024
bc9dea4
repo_commits_result_counter{status=ok}
brianolson Nov 21, 2024
58c1cd2
add gauge indexer_catchup_repos; fix bigsky NewIndexer usage
brianolson Nov 21, 2024
7b183a0
pr feedback: .Shudown() instead of Context
brianolson Nov 22, 2024
6373ce4
add gauge bgs_connected_inbound
brianolson Nov 29, 2024
4b2f8dc
fix Shutdown for test
brianolson Nov 29, 2024
9bb22ba
fix did memcached metrics
brianolson Nov 29, 2024
4989d79
fix staticcheck SA2000
egonelbre Nov 21, 2024
82af8d8
fix staticcheck S1011
egonelbre Nov 21, 2024
59538a1
fix unnecssary fmt.Sprintf (staticcheck S1039)
egonelbre Nov 21, 2024
72b4acb
automod/rules: remove unused fmt import
egonelbre Nov 21, 2024
7fd5887
backfill: add failback to fetch CAR file from PDS (if relay errors) (…
bnewbold Dec 3, 2024
c26ef95
better get-record
whyrusleeping Dec 3, 2024
9ea7870
better get-record (#861)
whyrusleeping Dec 3, 2024
e0efa19
add warn log line for unexpected review state
bnewbold Dec 4, 2024
ff209b5
:bug: Fix typo in moderation review state check (#814)
bnewbold Dec 4, 2024
5a7d037
fix RWLock usage
brianolson Dec 4, 2024
2105fe0
lexicon: nsid rkey type
bnewbold Dec 5, 2024
767cd56
lexicon: nsid rkey type (#865)
bnewbold Dec 5, 2024
a5a00fc
replace github.com/ipfs/go-log with stdlib log/slog
brianolson Dec 4, 2024
0a3197d
SetupSlog
brianolson Nov 30, 2024
39f5b5f
SetIpfsWriter, GOLOG_* env to BSKYLOG_*
brianolson Dec 2, 2024
dd43c55
also respond to GOLOG_{LOG_LEVEL,LOG_FMT,FILE}
brianolson Dec 5, 2024
46ac1b8
make fmt
bnewbold Dec 6, 2024
1cdcd10
make fmt (#867)
bnewbold Dec 6, 2024
817bfc8
move Directory interface to separate file
bnewbold Dec 6, 2024
28d2ee4
move DID doc code out to separate file
bnewbold Dec 6, 2024
5ee8937
re-organize identity package files (#871)
bnewbold Dec 6, 2024
cc407d9
Update backfill package to use HTTP/HTTPS for getRepo always
ericvolp12 Dec 12, 2024
749cc07
Update backfill package to use HTTP/HTTPS for getRepo always (#875)
ericvolp12 Dec 12, 2024
07dc376
hack: non-archival relay work
whyrusleeping Nov 19, 2024
5c7f937
config flag
whyrusleeping Nov 19, 2024
cc76378
add missing file
whyrusleeping Nov 19, 2024
2a07798
be okay missing revs
whyrusleeping Nov 19, 2024
f9f6e8c
fixing up a few more tests
whyrusleeping Nov 22, 2024
d30a1e0
rm deadcode
whyrusleeping Nov 22, 2024
aa67633
run more tests on both archive/nonarchive
whyrusleeping Nov 22, 2024
8f492f7
return written blocks in closing deltasession
whyrusleeping Dec 3, 2024
23e9628
Use keyed field in DbCID initialization.
audreyt Dec 13, 2024
51af58f
small review updates
whyrusleeping Dec 16, 2024
62578eb
fixup logging now
whyrusleeping Dec 16, 2024
e495daf
more logging fixup
whyrusleeping Dec 16, 2024
86719b0
non-archival relay (#827)
whyrusleeping Dec 16, 2024
b6b25f9
syntax: path parsing helper
bnewbold Dec 6, 2024
9a20ba2
start agnostic sub-package
bnewbold Dec 6, 2024
bbd751c
add existing 'agnostic' helpers
bnewbold Dec 6, 2024
855fc0d
add agnostic version of repo applyWrites
bnewbold Dec 6, 2024
7455486
fix refs to original files
bnewbold Dec 17, 2024
378cbbc
goat: update to use agnostic helpers
bnewbold Dec 6, 2024
7a4e0dc
astrolabe: updates to use agnostic API helpers
bnewbold Dec 6, 2024
8f12acf
Merge remote-tracking branch 'origin/main' into bnewbold/rainbow-safe…
brianolson Dec 17, 2024
259ded3
slog fix
brianolson Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Run with, eg, `go run ./cmd/bigsky`):
- `cmd/supercollider`: event stream load generation tool
- `cmd/sonar`: event stream monitoring tool
- `cmd/hepa`: auto-moderation rule engine service
- `cmd/rainbow`: firehose fanout service
- `gen`: dev tool to run CBOR type codegen

Packages:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copied from indigo:api/atproto/actorgetPreferences.go
// Copied from indigo:api/bsky/actorgetPreferences.go

package main
package agnostic

// schema: app.bsky.actor.getPreferences

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copied from indigo:api/atproto/actorputPreferences.go
// Copied from indigo:api/bsky/actorputPreferences.go

package main
package agnostic

// schema: app.bsky.actor.putPreferences

Expand Down
4 changes: 4 additions & 0 deletions api/agnostic/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Package indigo/api/agnositc provides schema-agnostic helpers for fetching records from the network.
//
// These are variants of endpoints in indigo/api/atproto.
package agnostic
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copied from indigo:api/atproto/identitygetRecommendedDidCredentials.go

package main
package agnostic

// schema: com.atproto.identity.getRecommendedDidCredentials

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copied from indigo:api/atproto/identitysignPlcOperation.go

package main
package agnostic

// schema: com.atproto.identity.signPlcOperation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copied from indigo:api/atproto/identitysubmitPlcOperation.go

package main
package agnostic

// schema: com.atproto.identity.submitPlcOperation

Expand Down
189 changes: 189 additions & 0 deletions api/agnostic/repoapplyWrites.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
// Copied from indigo:api/atproto/repoapplyWrites.go

package agnostic

// schema: com.atproto.repo.applyWrites

import (
"context"
"encoding/json"
"fmt"

"github.com/bluesky-social/indigo/lex/util"
"github.com/bluesky-social/indigo/xrpc"
)

// RepoApplyWrites_Create is a "create" in the com.atproto.repo.applyWrites schema.
//
// Operation which creates a new record.
//
// RECORDTYPE: RepoApplyWrites_Create
type RepoApplyWrites_Create struct {
LexiconTypeID string `json:"$type,const=com.atproto.repo.applyWrites#create" cborgen:"$type,const=com.atproto.repo.applyWrites#create"`
Collection string `json:"collection" cborgen:"collection"`
Rkey *string `json:"rkey,omitempty" cborgen:"rkey,omitempty"`
Value *json.RawMessage `json:"value" cborgen:"value"`
}

// RepoApplyWrites_CreateResult is a "createResult" in the com.atproto.repo.applyWrites schema.
//
// RECORDTYPE: RepoApplyWrites_CreateResult
type RepoApplyWrites_CreateResult struct {
LexiconTypeID string `json:"$type,const=com.atproto.repo.applyWrites#createResult" cborgen:"$type,const=com.atproto.repo.applyWrites#createResult"`
Cid string `json:"cid" cborgen:"cid"`
Uri string `json:"uri" cborgen:"uri"`
ValidationStatus *string `json:"validationStatus,omitempty" cborgen:"validationStatus,omitempty"`
}

// RepoApplyWrites_Delete is a "delete" in the com.atproto.repo.applyWrites schema.
//
// Operation which deletes an existing record.
//
// RECORDTYPE: RepoApplyWrites_Delete
type RepoApplyWrites_Delete struct {
LexiconTypeID string `json:"$type,const=com.atproto.repo.applyWrites#delete" cborgen:"$type,const=com.atproto.repo.applyWrites#delete"`
Collection string `json:"collection" cborgen:"collection"`
Rkey string `json:"rkey" cborgen:"rkey"`
}

// RepoApplyWrites_DeleteResult is a "deleteResult" in the com.atproto.repo.applyWrites schema.
//
// RECORDTYPE: RepoApplyWrites_DeleteResult
type RepoApplyWrites_DeleteResult struct {
LexiconTypeID string `json:"$type,const=com.atproto.repo.applyWrites#deleteResult" cborgen:"$type,const=com.atproto.repo.applyWrites#deleteResult"`
}

// RepoApplyWrites_Input is the input argument to a com.atproto.repo.applyWrites call.
type RepoApplyWrites_Input struct {
// repo: The handle or DID of the repo (aka, current account).
Repo string `json:"repo" cborgen:"repo"`
// swapCommit: If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.
SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"`
// validate: Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons.
Validate *bool `json:"validate,omitempty" cborgen:"validate,omitempty"`
Writes []*RepoApplyWrites_Input_Writes_Elem `json:"writes" cborgen:"writes"`
}

type RepoApplyWrites_Input_Writes_Elem struct {
RepoApplyWrites_Create *RepoApplyWrites_Create
RepoApplyWrites_Update *RepoApplyWrites_Update
RepoApplyWrites_Delete *RepoApplyWrites_Delete
}

func (t *RepoApplyWrites_Input_Writes_Elem) MarshalJSON() ([]byte, error) {
if t.RepoApplyWrites_Create != nil {
t.RepoApplyWrites_Create.LexiconTypeID = "com.atproto.repo.applyWrites#create"
return json.Marshal(t.RepoApplyWrites_Create)
}
if t.RepoApplyWrites_Update != nil {
t.RepoApplyWrites_Update.LexiconTypeID = "com.atproto.repo.applyWrites#update"
return json.Marshal(t.RepoApplyWrites_Update)
}
if t.RepoApplyWrites_Delete != nil {
t.RepoApplyWrites_Delete.LexiconTypeID = "com.atproto.repo.applyWrites#delete"
return json.Marshal(t.RepoApplyWrites_Delete)
}
return nil, fmt.Errorf("cannot marshal empty enum")
}
func (t *RepoApplyWrites_Input_Writes_Elem) UnmarshalJSON(b []byte) error {
typ, err := util.TypeExtract(b)
if err != nil {
return err
}

switch typ {
case "com.atproto.repo.applyWrites#create":
t.RepoApplyWrites_Create = new(RepoApplyWrites_Create)
return json.Unmarshal(b, t.RepoApplyWrites_Create)
case "com.atproto.repo.applyWrites#update":
t.RepoApplyWrites_Update = new(RepoApplyWrites_Update)
return json.Unmarshal(b, t.RepoApplyWrites_Update)
case "com.atproto.repo.applyWrites#delete":
t.RepoApplyWrites_Delete = new(RepoApplyWrites_Delete)
return json.Unmarshal(b, t.RepoApplyWrites_Delete)

default:
return fmt.Errorf("closed enums must have a matching value")
}
}

// RepoApplyWrites_Output is the output of a com.atproto.repo.applyWrites call.
type RepoApplyWrites_Output struct {
Commit *RepoDefs_CommitMeta `json:"commit,omitempty" cborgen:"commit,omitempty"`
Results []*RepoApplyWrites_Output_Results_Elem `json:"results,omitempty" cborgen:"results,omitempty"`
}

type RepoApplyWrites_Output_Results_Elem struct {
RepoApplyWrites_CreateResult *RepoApplyWrites_CreateResult
RepoApplyWrites_UpdateResult *RepoApplyWrites_UpdateResult
RepoApplyWrites_DeleteResult *RepoApplyWrites_DeleteResult
}

func (t *RepoApplyWrites_Output_Results_Elem) MarshalJSON() ([]byte, error) {
if t.RepoApplyWrites_CreateResult != nil {
t.RepoApplyWrites_CreateResult.LexiconTypeID = "com.atproto.repo.applyWrites#createResult"
return json.Marshal(t.RepoApplyWrites_CreateResult)
}
if t.RepoApplyWrites_UpdateResult != nil {
t.RepoApplyWrites_UpdateResult.LexiconTypeID = "com.atproto.repo.applyWrites#updateResult"
return json.Marshal(t.RepoApplyWrites_UpdateResult)
}
if t.RepoApplyWrites_DeleteResult != nil {
t.RepoApplyWrites_DeleteResult.LexiconTypeID = "com.atproto.repo.applyWrites#deleteResult"
return json.Marshal(t.RepoApplyWrites_DeleteResult)
}
return nil, fmt.Errorf("cannot marshal empty enum")
}
func (t *RepoApplyWrites_Output_Results_Elem) UnmarshalJSON(b []byte) error {
typ, err := util.TypeExtract(b)
if err != nil {
return err
}

switch typ {
case "com.atproto.repo.applyWrites#createResult":
t.RepoApplyWrites_CreateResult = new(RepoApplyWrites_CreateResult)
return json.Unmarshal(b, t.RepoApplyWrites_CreateResult)
case "com.atproto.repo.applyWrites#updateResult":
t.RepoApplyWrites_UpdateResult = new(RepoApplyWrites_UpdateResult)
return json.Unmarshal(b, t.RepoApplyWrites_UpdateResult)
case "com.atproto.repo.applyWrites#deleteResult":
t.RepoApplyWrites_DeleteResult = new(RepoApplyWrites_DeleteResult)
return json.Unmarshal(b, t.RepoApplyWrites_DeleteResult)

default:
return fmt.Errorf("closed enums must have a matching value")
}
}

// RepoApplyWrites_Update is a "update" in the com.atproto.repo.applyWrites schema.
//
// Operation which updates an existing record.
//
// RECORDTYPE: RepoApplyWrites_Update
type RepoApplyWrites_Update struct {
LexiconTypeID string `json:"$type,const=com.atproto.repo.applyWrites#update" cborgen:"$type,const=com.atproto.repo.applyWrites#update"`
Collection string `json:"collection" cborgen:"collection"`
Rkey string `json:"rkey" cborgen:"rkey"`
Value *json.RawMessage `json:"value" cborgen:"value"`
}

// RepoApplyWrites_UpdateResult is a "updateResult" in the com.atproto.repo.applyWrites schema.
//
// RECORDTYPE: RepoApplyWrites_UpdateResult
type RepoApplyWrites_UpdateResult struct {
LexiconTypeID string `json:"$type,const=com.atproto.repo.applyWrites#updateResult" cborgen:"$type,const=com.atproto.repo.applyWrites#updateResult"`
Cid string `json:"cid" cborgen:"cid"`
Uri string `json:"uri" cborgen:"uri"`
ValidationStatus *string `json:"validationStatus,omitempty" cborgen:"validationStatus,omitempty"`
}

// RepoApplyWrites calls the XRPC method "com.atproto.repo.applyWrites".
func RepoApplyWrites(ctx context.Context, c *xrpc.Client, input *RepoApplyWrites_Input) (*RepoApplyWrites_Output, error) {
var out RepoApplyWrites_Output
if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.repo.applyWrites", nil, input, &out); err != nil {
return nil, err
}

return &out, nil
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copied from indigo:api/atproto/repocreateRecords.go

package main
package agnostic

// schema: com.atproto.repo.createRecord

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copied from indigo:api/atproto/repolistRecords.go

package main
package agnostic

// schema: com.atproto.repo.getRecord

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copied from indigo:api/atproto/repolistRecords.go

package main
package agnostic

// schema: com.atproto.repo.listRecords

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copied from indigo:api/atproto/repoputRecords.go

package main
package agnostic

// schema: com.atproto.repo.putRecord

Expand Down
10 changes: 2 additions & 8 deletions atproto/data/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,11 @@ func extractBlobsAtom(atom any) []Blob {
out = append(out, v)
case []any:
for _, el := range v {
down := extractBlobsAtom(el)
for _, d := range down {
out = append(out, d)
}
out = append(out, extractBlobsAtom(el)...)
}
case map[string]any:
for _, val := range v {
down := extractBlobsAtom(val)
for _, d := range down {
out = append(out, d)
}
out = append(out, extractBlobsAtom(val)...)
}
default:
}
Expand Down
20 changes: 0 additions & 20 deletions atproto/identity/did.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,6 @@ import (
"github.com/bluesky-social/indigo/atproto/syntax"
)

type DIDDocument struct {
DID syntax.DID `json:"id"`
AlsoKnownAs []string `json:"alsoKnownAs,omitempty"`
VerificationMethod []DocVerificationMethod `json:"verificationMethod,omitempty"`
Service []DocService `json:"service,omitempty"`
}

type DocVerificationMethod struct {
ID string `json:"id"`
Type string `json:"type"`
Controller string `json:"controller"`
PublicKeyMultibase string `json:"publicKeyMultibase"`
}

type DocService struct {
ID string `json:"id"`
Type string `json:"type"`
ServiceEndpoint string `json:"serviceEndpoint"`
}

// WARNING: this does *not* bi-directionally verify account metadata; it only implements direct DID-to-DID-document lookup for the supported DID methods, and parses the resulting DID Doc into an Identity struct
func (d *BaseDirectory) ResolveDID(ctx context.Context, did syntax.DID) (*DIDDocument, error) {
start := time.Now()
Expand Down
25 changes: 25 additions & 0 deletions atproto/identity/diddoc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package identity

import (
"github.com/bluesky-social/indigo/atproto/syntax"
)

type DIDDocument struct {
DID syntax.DID `json:"id"`
AlsoKnownAs []string `json:"alsoKnownAs,omitempty"`
VerificationMethod []DocVerificationMethod `json:"verificationMethod,omitempty"`
Service []DocService `json:"service,omitempty"`
}

type DocVerificationMethod struct {
ID string `json:"id"`
Type string `json:"type"`
Controller string `json:"controller"`
PublicKeyMultibase string `json:"publicKeyMultibase"`
}

type DocService struct {
ID string `json:"id"`
Type string `json:"type"`
ServiceEndpoint string `json:"serviceEndpoint"`
}
File renamed without changes.
Loading
Loading