···
func (h *Handle) processPublicKey(ctx context.Context, did string, record tangled.PublicKey) error {
l := log.FromContext(ctx)
···
// presently: we only process PRs from collaborators for pipelines
if !slices.Contains(allDids, did) {
reason := "not a known did"
-
l.Info("rejecting pull record", "reason", reason)
-
return fmt.Errorf("rejected pull record: %s, %s", reason, did)
repoAt, err := syntax.ParseATURI(record.TargetRepo)
···
if repo.Knot != h.c.Server.Hostname {
reason := "not this knot"
-
l.Info("rejecting pull record", "reason", reason)
-
return fmt.Errorf("rejected pull record: %s", reason)
didSlashRepo, err := securejoin.SecureJoin(repo.Owner, repo.Name)
···
func (h *Handle) processPublicKey(ctx context.Context, did string, record tangled.PublicKey) error {
l := log.FromContext(ctx)
+
allDids, err := h.db.GetAllDids()
+
// only process public keys from known DIDs
+
if !slices.Contains(allDids, did) {
+
reason := "not a known did"
+
l.Debug("rejecting public key record", "reason", reason, "did", did)
···
// presently: we only process PRs from collaborators for pipelines
if !slices.Contains(allDids, did) {
reason := "not a known did"
+
l.Debug("rejecting pull record", "reason", reason)
repoAt, err := syntax.ParseATURI(record.TargetRepo)
···
if repo.Knot != h.c.Server.Hostname {
reason := "not this knot"
+
l.Debug("rejecting pull record", "reason", reason)
didSlashRepo, err := securejoin.SecureJoin(repo.Owner, repo.Name)