MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / VerifyDomain

Method VerifyDomain

internal/identity/store.go:734–747  ·  view source on GitHub ↗

VerifyDomain marks a domain as verified, only if owned by the given user.

(ctx context.Context, domain, userID string)

Source from the content-addressed store, hash-verified

732
733// VerifyDomain marks a domain as verified, only if owned by the given user.
734func (s *Store) VerifyDomain(ctx context.Context, domain, userID string) error {
735 tag, err := s.pool.Exec(ctx,
736 `UPDATE domains SET verified = true, verified_at = now()
737 WHERE domain = $1 AND user_id = $2 AND verified = false`,
738 normalizeDomain(domain), userID,
739 )
740 if err != nil {
741 return err
742 }
743 if tag.RowsAffected() == 0 {
744 return fmt.Errorf("domain not found, not owned by user, or already verified")
745 }
746 return nil
747}
748
749// ListDomainsByUser returns all domains owned by the user (excludes system rows).
750// AgentCount is computed inline via a correlated subquery — one round-trip

Implementers 1

Storeinternal/identity/store.go

Calls 2

normalizeDomainFunction · 0.85
ExecMethod · 0.65