Skip to content

Feature/team rollup reporting#896

Closed
Lanhubs wants to merge 4 commits into
Disciplr-Org:mainfrom
Lanhubs:feature/team-rollup-reporting
Closed

Feature/team rollup reporting#896
Lanhubs wants to merge 4 commits into
Disciplr-Org:mainfrom
Lanhubs:feature/team-rollup-reporting

Conversation

@Lanhubs

@Lanhubs Lanhubs commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Lanhubs added 4 commits June 27, 2026 17:51
Add comprehensive security tests for step-up middleware proving:
- Tokens are bound to user and cannot be used by different users
- Tokens are bound to action context and cannot be replayed across endpoints
- Tokens are rejected immediately after expiry window (including boundary)
- Tokens are single-use and cannot be replayed even within validity window

Tests cover:
- User binding (4 tests)
- Action/context binding (5 tests)
- Replay window edge cases (7 tests)
- Security attack prevention (7 tests)
- Middleware integration (7 tests)

Enhanced AuthService to support optional action binding in tokens.
Enhanced requireStepUp middleware to extract and validate action context.

Fixed existing test file imports for Jest globals compatibility.
Added abuseMonitor test helper function for taxonomy tests.

Closes Disciplr-Org#739
- Add getTeamRollup(orgId) to src/services/team.ts with single-query CTE
  that joins teams, vaults, milestones, and memberships under strict
  org-scoped tenant isolation
- Deduplicate vaults shared across teams via ROW_NUMBER partitioning
- Compute per-team and org-wide vault counts, capital totals, milestone
  completion, and slash rates
- Wire GET /:orgId/teams/rollup route in src/routes/orgAnalytics.ts with
  requireOrgRole(owner,admin) auth and rate limiting
- Add docs/team-rollup.md documenting rollup shape and isolation guarantees
- Add src/tests/team.rollup.test.ts covering zero teams, empty metrics,
  cross-org leakage prevention, dedup, and slash rate calculation
Remove stray backtick and misplaced closing brace that broke the
handler object literal, causing TS1136/TS1005 errors on every
subsequent handler entry.
Add 'sessions.cleanup', 'outbox.relay', 'embeddings.reindex' to
JOB_TYPES union, JobPayloadByType, and add payload interfaces.
Fix broken switch case in isPayloadForJobType (vault.reconcile
missing closing paren). Import cleanupExpiredSessions, relayOutboxBatch,
and runReindexBatches in handlers.ts.
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

Hey @Lanhubs! 👋 It looks like this PR isn't linked to any issue.

If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g., Closes #123), or by clicking a button below:

Issue Title
#727 Add idempotency-key support to milestone check-in submissions in src/routes/verifications.ts Link to this issue
#709 Add cross-organization team aggregation and rollup reporting service in src/services/team.ts Link to this issue
#739 Add stepUp middleware token-binding and replay-window tests in src/tests/stepUp.binding.test.ts Link to this issue

ℹ️ Learn more about linking PRs to issues

@1nonlypiece

Copy link
Copy Markdown
Contributor

thanks for the PR — i couldn't find a linked issue it addresses, and our flow needs each PR tied to an issue you're assigned to. closing for now; open it against an issue you've claimed (add 'Closes #N') and we'll review. https://discord.gg/xvNAvMJf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants