Commit Graph

59 Commits

Author SHA1 Message Date
Wells Bunker 68043841b3
tests 2025-09-24 13:42:45 -06:00
Wells Bunker 9927808704
check for public permissions on any check 2025-09-24 13:17:08 -06:00
Nate Kelley de54e28f2e
Added output for the builds 2025-09-23 22:40:45 -06:00
Nate Kelley 6748819e39
error handling for auth login 2025-09-23 21:06:40 -06:00
dal f81a524279
make test more stable and add ssl requirement on migration 2025-09-20 16:24:39 -06:00
Nate Kelley 2519e84c0f
update permission cache 2025-09-20 15:48:44 -06:00
Nate Kelley 3cdd0bfa57
reset permission stuff 2025-09-20 14:30:17 -06:00
Nate Kelley f406dd5ca3
permission check update 2025-09-20 13:40:42 -06:00
Nate Kelley 9efdf2c67b
pass through asset check 2025-09-20 13:22:52 -06:00
wellsbunk5 ba93511536
Merge pull request #1007 from buster-so/wells-bus-1841-migrate-get-dashboard-endpoint-to-v2
Migrate dashboards/[id] GET endpoint over to v2
2025-09-19 11:52:08 -06:00
Wells Bunker 4293093669
Migrate dashboards/[id] GET endpoint over to v2 2025-09-19 11:42:52 -06:00
dal 2df6b234ac
Merge remote-tracking branch 'origin/staging' into dallin-bus-1816-dataset-sample-endpoint-not-working
# Conflicts:
#	packages/access-controls/src/datasets/permissions.ts
2025-09-19 10:16:14 -06:00
dal d6d18f3fca
Update dataset sample handling and add new API routes
- Added new API routes for fetching dataset samples by ID, including validation and error handling.
- Implemented `getDatasetSampleHandler` to manage dataset access and sample query execution.
- Introduced `executeSampleQuery` utility for executing read-only SQL queries with retry logic.
- Created new schemas for dataset sample request and response types.
- Updated existing dataset access control logic to ensure proper permissions are enforced.
- Added tests for the new dataset sample functionality to ensure reliability.
2025-09-19 10:06:03 -06:00
Nate Kelley 688fb36270
fix broken unit tests 2025-09-18 14:15:24 -06:00
Nate Kelley 33073e6729
Move to scoped database imports 2025-09-18 12:36:37 -06:00
Nate Kelley 6bcd9e7b9e
scope down more types 2025-09-17 16:42:47 -06:00
Wells Bunker fd4ff6216f
AssetTypeEnum rework 2025-09-17 14:37:14 -06:00
dal 85a8c96056
lint and fix 2025-09-17 07:49:41 -06:00
dal e92b610ed2
Refactor BigQuery adapter to include schema metadata in query results and improve type mappings. Update tests to validate new behavior and ensure compatibility with existing functionality. 2025-09-16 16:27:28 -06:00
dal 72ef9464dc
slq parser and data source helper and type mappings 2025-09-16 15:50:33 -06:00
dal d0c7efc441
checks and permission 2025-09-16 15:10:38 -06:00
dal d0659723f2
Enhance access control by adding report permission checks and updating cascading permission logic. Refactor metric access functions to include workspace sharing information for chats, dashboards, and collections. 2025-09-16 14:32:36 -06:00
dal ee62786ad1
changes based on greptile suggestions 2025-09-15 15:53:14 -06:00
dal e57b74015f
Merge remote-tracking branch 'origin/staging' into dallin-bus-1714-run-sql-endpoint-needs-to-use-same-functionality-as-the-get 2025-09-15 15:07:49 -06:00
dal 2761b3f0fc
Integrate SQL functionality by adding SQL routes and updating dependencies. Refactor access control imports to use centralized access-controls package. Update pnpm-lock and package.json for new dependencies including node-sql-parser and yaml. 2025-09-15 15:07:43 -06:00
dal eb657d558e
CLAUDE.md and README.md updates... 2025-09-15 15:06:41 -06:00
Wells Bunker 5e88b37988
Adding search backend 2025-09-15 14:01:55 -06:00
dal beb332f01a
workspace permissions 2025-08-26 15:58:16 -06:00
dal 6f65e25e63
Update pnpm-lock.yaml to resolve merge conflicts and synchronize package versions, including updates to '@aws-sdk/credential-provider-web-identity' and 'platejs' dependencies. 2025-08-18 15:19:01 -06:00
dal 35623ad987
Integrate access controls with metric file downloads
- Added permission checks to metric file download handler
- Added permission checks to export-metric-data trigger task
- Created comprehensive tests for access control integration
- Updated AssetType enums to include report_file
- Resolved export conflicts in server-shared package
- Fixed AI package imports for new getPermissionedDatasets API
2025-08-13 14:25:41 -06:00
dal ebe496df87
Merge access-controls branch and resolve conflicts
- Combined asset type enums from both branches
- Merged all database query exports
- Integrated access-controls package into server-shared
- Resolved conflicts in AI package instructions
2025-08-13 14:15:20 -06:00
dal b96cb39b78
turbo fast web build 2025-08-11 11:33:18 -06:00
dal 47f413e111
fix: update access-controls tests for new cache structure
Updated dataset permission tests to expect the full DatasetAccessResult
object instead of just a boolean value in cache operations. This aligns
with the PR feedback to cache the complete access result including
accessPath and userRole.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 12:29:15 -06:00
dal 273fbc36c4
fix: address non-critical PR review comments
- Optimized N+1 query in get-permissioned-datasets.ts using inArray for batch lookup
- Removed unused bulkRemoveAssetPermissions import
- Fixed import organization in find-user-by-email.ts
- Updated CLAUDE.md to reflect tests are written and fixed API example
- Clarified TODO comment in lookup.ts to prevent potential infinite recursion

These are style and performance improvements that don't affect functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 12:29:02 -06:00
dal 2e04af1785
fix: address additional critical PR review comments
- Fixed permission hierarchy: full_access (5) now correctly ranks higher than viewer (3)
- Removed 'querier' role from admin permission check as it was too permissive
- Added organizationId parameter to dashboard access checks to prevent unauthorized access
- Fixed public dashboard expiry date check to verify dates are in the future
- Added cycle detection for collection permissions to prevent infinite recursion
- Fixed bulk remove permissions to correctly filter by identityIds array
- Updated date comparison to use ISO string format for PostgreSQL timestamp columns

These fixes address critical security and logic issues identified in the PR review.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 12:28:58 -06:00
dal d078830a18
fix: address PR review comments for access control migration
- Fixed AssetTypeSchema to include all active asset types (excluding deprecated 'metric' and 'dashboard')
- Added missing 'restricted_querier' role to UserOrganizationRole type
- Fixed dataset access caching to store full result object including accessPath and userRole
- Updated count query to use SQL COUNT for better performance
- Fixed IdentityType consistency across dataset permissions
- Removed unused 'ne' import from list-asset-permissions.ts
- Updated comments to correctly reference 6 access paths instead of 5

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 12:28:52 -06:00
dal 4bef4205f3
feat(access-controls): migrate Rust access control libraries to TypeScript
This PR migrates the Rust  and  libraries to TypeScript in the new  package.

## Changes

### New Access Controls Package
- Implemented complete asset permissions system with CRUD operations
- Added dataset permissions with all 5 access paths (admin, direct user, user→group, team→direct, team→group, org→default)
- Implemented cascading permissions (metrics inherit from dashboards/chats/collections)
- Added LRU caching to replace Redis (30-second TTL)
- Comprehensive test coverage (148 tests passing, 3 skipped pending createUser)

### Database Package Updates
- Fixed AssetType enum to include all 14 asset types
- Added missing database queries for permissions
- Fixed timestamp fields to use ISO strings
- Added getUserOrganizationsByUserId function
- Created organized query structure by table

### AI Package Updates
- Updated getPermissionedDatasets API calls to new format
- Changed property references from ymlFile to ymlContent
- Fixed all test mocks to match new API structure

### Trigger App Updates
- Updated to use new access controls API
- Fixed test mocks to match DatasetListResult structure
- Added proper type imports

### Server Shared Updates
- Added request/response types for access control endpoints
- Exported types for API consistency

## Testing
- All packages build successfully with turbo build:dry-run
- All tests pass with turbo test:unit
- Full type safety maintained throughout

## Migration Notes
- Drop-in replacement for Rust libraries
- Same permission model and roles
- Cache invalidation strategies implemented
- Soft delete pattern maintained

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 10:17:35 -06:00
dal 2833c6bb0c
dry run 2025-07-25 18:29:35 -06:00
Nate Kelley 8ee892bf2a
Use tsx and .ts files for validation 2025-07-21 16:07:14 -06:00
Nate Kelley 4418f4991b
use a shared env validation method 2025-07-21 16:00:10 -06:00
Nate Kelley 5f61995296
Fix linting errors 2025-07-18 10:48:49 -06:00
dal 51da02efbb
update package.json pass if no unit tests 2025-07-17 23:03:54 -06:00
dal b6cf6539ea
Merge branch 'origin/staging' into dallin/bus-1380-fix-unit-tests - Resolved conflicts in CLAUDE.md 2025-07-17 16:52:03 -06:00
Nate Kelley 5dd7b20f25
fix broken linting 2025-07-17 13:18:32 -06:00
dal d4f216cb66
Merge remote-tracking branch 'origin/staging' into dallin/bus-1363-slack-agent-query-buster-from-slack-direct-query 2025-07-16 12:54:18 -06:00
dal 2bc11900b9
Slack User auth and domain validation 2025-07-16 10:09:57 -06:00
Nate Kelley fdf70abfb8
update database dev 2025-07-15 22:26:13 -06:00
Nate Kelley 727e66a630
Fix files on lint 2025-07-14 14:30:07 -06:00
dal 5a971dd8a1
fix on access-control tests 2025-07-14 11:01:53 -06:00
dal 2be9784516
Add unit and integration test scripts to package.json files across multiple packages 2025-07-14 09:11:20 -06:00