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

Method userOwnsAgent

internal/identity/store.go:3453–3460  ·  view source on GitHub ↗

userOwnsAgent reports whether agentID exists and is owned by userID.

(ctx context.Context, agentID, userID string)

Source from the content-addressed store, hash-verified

3451
3452// userOwnsAgent reports whether agentID exists and is owned by userID.
3453func (s *Store) userOwnsAgent(ctx context.Context, agentID, userID string) (bool, error) {
3454 var exists bool
3455 err := s.pool.QueryRow(ctx,
3456 `SELECT EXISTS(SELECT 1 FROM agent_identities WHERE id = $1 AND user_id = $2)`,
3457 agentID, userID,
3458 ).Scan(&exists)
3459 return exists, err
3460}
3461
3462func (s *Store) ListAPIKeys(ctx context.Context, userID string) ([]APIKey, error) {
3463 rows, err := s.pool.Query(ctx,

Callers 1

CreateScopedAPIKeyMethod · 0.95

Implementers 1

Storeinternal/identity/store.go

Calls 2

ScanMethod · 0.80
QueryRowMethod · 0.80

Tested by

no test coverage detected