Commit Graph

48 Commits

Author SHA1 Message Date
dal 1f1df4a7bb
Refactor dataset deployment logic and enhance request structure
- Introduced a new `is_simple` flag in the `deploy_datasets` function to differentiate between full and simple dataset deployments.
- Updated the `deploy_datasets_handler` to accept the `is_simple` parameter, allowing for conditional processing of inserted datasets.
- Modified the `DeployDatasetsRequest` struct to include an optional `id` and `type_` field, enhancing the request's flexibility.
- Adjusted the handling of the `yml_file` field to be optional in the `DeployDatasetsRequest` struct.
- Updated the `process_batch` function to handle "USER-DEFINED" data types in addition to existing types.

These changes improve the dataset deployment process by allowing for more granular control and flexibility in handling different dataset types.
2025-01-11 15:17:01 -07:00
dal 4b64458938
Enhance dataset asset APIs to include organization filtering
- Added functionality to retrieve the user's organization ID in both `get_dataset_overview` and `list_assets` endpoints.
- Updated database queries to filter users and permissions based on the organization ID, ensuring that only relevant data is returned for the user's organization.
- Improved error handling for organization ID retrieval, logging errors appropriately.

These changes improve data security and relevance by ensuring that users only access assets associated with their organization.
2025-01-11 11:56:56 -07:00
Nate Kelley 7d253674cb
Merge branch 'staging' into big-nate/bus-891-reorganize-and-redo-permissions-tabs 2025-01-10 14:51:07 -07:00
dal b61662a43d
Enhance dataset overview API to include user email and name
- Added the user's email and name to the UserOverviewItem struct for improved clarity in user details.
- Updated the database query to select the user's name alongside their ID and email, ensuring comprehensive user information is retrieved.
- Refactored the mapping logic to accommodate the new name field, enhancing the dataset overview response.

These changes improve the dataset overview API by providing more detailed user information, facilitating better understanding of user access and roles.
2025-01-10 11:35:47 -07:00
Nate Kelley adc0e4e57e
Merge branch 'dallin/bus-889-align-cli-tooling-with-the-in-app-editor' into big-nate/bus-891-reorganize-and-redo-permissions-tabs 2025-01-10 10:33:59 -07:00
Nate Kelley c6de0e5bc8
Merge branch 'staging' into big-nate/bus-891-reorganize-and-redo-permissions-tabs 2025-01-10 10:33:49 -07:00
dal fd54b4724d
Update team role handling in migration script to include 'admin' as 'manager' and default to 'member'
- Modified the role adjustment logic in the teams_to_users table to treat 'admin' roles as 'manager'.
- Set the default role to 'member' for all other cases, improving clarity in role assignments.

These changes enhance the migration process for dataset groups and permissions management.
2025-01-09 17:35:54 -07:00
dal 1182235116
try root cert 2025-01-09 17:27:39 -07:00
dal ccd6ea8ce9
Refactor Dockerfile for optional certificate handling
- Simplified certificate handling logic by allowing the COPY command to proceed without failure if cert.pem is missing.
- Updated the Dockerfile to ensure that the update-ca-certificates command is run unconditionally after copying the certificate.
- Maintained the existing build process for the bi_api application.

These changes improve the Docker image build process by making certificate handling more robust and less dependent on the environment.
2025-01-09 17:18:52 -07:00
dal 41985c6b50
added in cert logic 2025-01-09 16:58:06 -07:00
dal e83a00c108
Add data source information to GetDataset response structure 2025-01-09 16:18:11 -07:00
dal 43abb0321e
Refactor dataset deployment logic and enforce unique constraints
- Updated the SQL migration to enforce a unique constraint on the combination of `database_name` and `data_source_id` in the datasets table, ensuring data integrity.
- Refactored the `deploy_datasets_handler` to separate datasets with and without IDs, allowing for concurrent upsert operations based on their presence.
- Enhanced the upsert logic to handle datasets more efficiently, improving performance during dataset deployment.

These changes improve the robustness and efficiency of the dataset deployment process within the API.
2025-01-09 13:05:54 -07:00
dal 761028c95c
Add SQL execution endpoint and modularize SQL handling
- Introduced a new `/sql/run` endpoint for executing SQL queries against datasets and data sources.
- Created a dedicated `sql` module and a `run_sql` handler to manage SQL execution logic.
- Implemented access checks to ensure users have the necessary permissions to execute SQL queries.
- Enhanced data retrieval and metadata processing for SQL results, improving overall API functionality.

These changes expand the API's capabilities by allowing users to run custom SQL queries, facilitating more flexible data interactions.
2025-01-09 12:05:49 -07:00
dal 79b3df107d
Add support for YAML-based dataset deployment and enhance dataset structures 2025-01-09 11:57:56 -07:00
dal d962af3883
Enhance dataset API with new post endpoint and modular structure
- Added a new `post_dataset` module and corresponding route to handle dataset creation.
- Updated the router to include the new POST endpoint for datasets, improving API functionality.
- Maintained existing routes while ensuring modular organization of dataset-related logic.

These changes improve the API's capabilities for dataset management by providing a dedicated endpoint for dataset creation, enhancing overall usability.
2025-01-09 10:02:09 -07:00
dal c2cd564251
Refactor dataset API to deploy datasets and update related structures
- Replaced the existing `post_datasets` endpoint with a new `deploy_datasets` endpoint to better reflect its purpose.
- Deleted the `post_datasets` module and its associated logic, streamlining the codebase.
- Updated the request and response structures to use `DeployDatasetsRequest` and related types, enhancing clarity and maintainability.
- Adjusted the BusterClient to utilize the new endpoint for deploying datasets, ensuring consistency across the API.

These changes improve the API's functionality by providing a clearer and more focused approach to dataset deployment, facilitating better data management.
2025-01-09 09:31:29 -07:00
dal 51e3c0cc2e
Add new endpoint for retrieving dataset data samples
- Introduced a new route to the datasets API for fetching data samples associated with a specific dataset.
- Added the `get_dataset_data_sample` module to handle the logic for retrieving dataset data samples.
- Updated the router configuration to include the new endpoint, enhancing the API's functionality for dataset management.

These changes improve the API's capabilities by allowing users to access sample data for datasets, facilitating better data exploration and analysis.
2025-01-09 09:23:46 -07:00
dal 08f6f343a8
Refactor GetDataset API response structure and improve dataset access checks
- Simplified the GetDatasetResponse struct by removing unnecessary fields and renaming existing ones for clarity.
- Updated the dataset retrieval logic to focus on essential dataset attributes, enhancing performance and readability.
- Improved user role checks for dataset access, ensuring clearer error messages for permission issues.
- Removed unused imports and streamlined the code for better maintainability.

These changes enhance the API's efficiency in retrieving dataset information and improve the clarity of user permissions related to dataset access.
2025-01-09 09:12:36 -07:00
dal 3b899452b0
Add model field to Dataset struct and update dataset routes
- Introduced a new optional `model` field in the Dataset struct to store model references.
- Updated the dataset routes to include a new endpoint for retrieving datasets by ID.
- Modified dataset creation logic to accommodate the new `model` field.
- Refactored dataset queries to utilize `datasets::all_columns` for improved readability and maintainability.

These changes enhance the dataset management capabilities by allowing the association of models with datasets, improving data organization and retrieval.
2025-01-08 22:51:32 -07:00
dal c74016d3bd
Add yml_file field to Dataset model and related API structures
- Introduced a new optional `yml_file` field in the Dataset model to store YAML file references.
- Updated the database schema to include the `yml_file` column in the datasets table.
- Modified various API request and response structures to accommodate the new `yml_file` field.
- Enhanced dataset handling functions to support the inclusion of `yml_file` in dataset operations.

These changes improve the dataset management capabilities by allowing the association of YAML files with datasets, facilitating better data organization and retrieval.
2025-01-08 22:33:14 -07:00
dal f1ab3c74a5
reset 2025-01-08 17:26:08 -07:00
dal 767ffd9fbc
one more test 2025-01-08 17:25:51 -07:00
dal 565dd7ac48
reset 2025-01-08 17:24:22 -07:00
dal 9f9d896ac1
testing 2025-01-08 17:24:09 -07:00
dal 62c7f1aabb
Merge pull request #24 from buster-so/dal/apis-for-permissions
Dal/apis-for-permissions
2025-01-08 15:53:59 -08:00
dal 5e9d3c198e Enhance dataset overview API with detailed user access queries and lineage tracking
- Added queries to retrieve datasets and permission groups associated with users for improved access tracking in the dataset overview response.
- Implemented logic to include direct dataset access and permission group lineage in the user overview, enhancing clarity on user permissions.
- Improved error handling for database interactions related to dataset and permission group queries.
- Added debug print statements for datasets and permission groups queries to facilitate troubleshooting.

These changes improve the API's ability to manage and report user permissions effectively, providing a clearer overview of user access to datasets and permission groups.
2025-01-08 16:51:00 -07:00
dal c247954733 Refactor dataset overview API to enhance user permission structure and simplify response
- Updated the UserPermissionLineage and UserOverviewItem structs to provide a clearer representation of user permissions and lineage in the dataset overview response.
- Simplified the get_dataset_overview function by removing redundant queries and consolidating user access checks.
- Improved error handling for database interactions related to user permissions.
- Streamlined the overall structure of the dataset overview response to focus on user details and their access capabilities.

These changes enhance the API's clarity and efficiency in managing and reporting user permissions.
2025-01-08 16:04:05 -07:00
dal 533ef5a4ef Enhance dataset overview API with user permission lineage and error handling improvements
- Introduced UserPermissionLineage struct to provide detailed user access information in the dataset overview response.
- Updated get_dataset_overview function to include comprehensive checks for user permissions, dataset group access, and direct access.
- Improved error handling for database queries related to user permissions and access checks.
- Added TODO comments in list_dataset_assets and put_dataset_assets routes to address future dataset group integration.

These changes enhance the API's capability to manage and report on user permissions effectively.
2025-01-08 15:42:28 -07:00
dal b22ab09673 Add DatasetPermission model and update API routes for asset management
- Introduced a new DatasetPermission model in the database schema to manage dataset access permissions, including fields for organization_id, dataset_id, and permission_type.
- Updated the API routes to nest asset-related routes under dataset_id, enhancing the organization of dataset-related functionalities.

These changes improve the structure for managing dataset permissions and streamline the API for asset handling.
2025-01-08 14:11:21 -07:00
Nate Kelley a4a03acb42
Pass env to dockerfiles 2025-01-08 14:03:27 -07:00
dal 82876e70f4 Add dataset_groups and dataset_permissions tables with organization_id references
- Created dataset_groups and dataset_permissions tables in the database schema, including organization_id as a foreign key with ON DELETE CASCADE.
- Added corresponding indexes for organization_id in both tables to optimize query performance.
- Updated the Rust models and schema to reflect the new tables and their relationships.
- Integrated dataset_groups into the API routes for improved data organization and management.

These changes enhance the database structure and facilitate better handling of dataset-related permissions and groupings.
2025-01-08 12:56:14 -07:00
dal d03815a02c Update database seed data and API routes for enhanced role management
- Changed the role of a user in the teams_to_users table from 'admin' to 'manager' for better role clarity.
- Refactored the users_to_organizations table to include a new 'status' field and updated multiple user roles to align with the new role structure (workspace_admin, querier, data_admin).
- Added a new permission_groups module to the API routes for improved permission management.
- Updated the security module to include a new checks module for enhanced security handling.
- Integrated dotenv in the Next.js configuration to manage environment variables more effectively.

These changes improve the clarity and functionality of user roles and permissions within the application.
2025-01-08 12:35:48 -07:00
dal 371b507acd Add UserOrganizationStatus enum and update role checks
- Introduced a new UserOrganizationStatus enum to manage user organization statuses (Active, Inactive, Pending, Guest) in the database schema.
- Updated the UserToOrganization model to include a status field.
- Refactored role checks across various routes to replace the previous UserOrganizationRole values (Owner, Admin) with new roles (WorkspaceAdmin, DataAdmin) for better role management.
- Enhanced data source handling in multiple routes to align with the updated role structure.

These changes improve the clarity and functionality of user organization management within the application.
2025-01-08 11:38:06 -07:00
dal dcfaa43e9e Refactor user organization roles and enhance database schema
- Updated the UserOrganizationRole enum to include new roles: WorkspaceAdmin, DataAdmin, Querier, RestrictedQuerier, and Viewer, replacing the previous roles of Owner, Member, and Admin.
- Modified the TeamToUserRole enum to change the Owner role to Manager.
- Added new database tables for dataset_groups, dataset_permissions, datasets_to_dataset_groups, and permission_groups_to_users to support enhanced data management.
- Introduced UserOrganizationStatusEnum to the schema for better organization status tracking.

These changes improve role management and expand the database schema for better data organization and permissions handling.
2025-01-08 10:53:29 -07:00
dal a2ab3cb641 Remove package-lock.json and update Docker Compose commands for Redis integration
- Deleted the `package-lock.json` file from the root directory.
- Modified the `dev` target in the API Makefile to start Redis using Docker Compose from the parent directory, improving service orchestration.
- Updated the `next.config.mjs` to load environment variables from the parent directory during development.
- Added `dotenv` as a dependency in both `package.json` and `package-lock.json` to manage environment variables effectively.

These changes streamline the development setup and enhance the management of environment variables.
2025-01-07 22:44:13 -07:00
dal 73822945bf Refactor Docker Compose and API for enhanced functionality and migration support
- Simplified the API service build configuration in `docker-compose.yml` by consolidating the build context and Dockerfile path.
- Added `diesel_migrations` dependency to `Cargo.toml` for database migration management.
- Implemented database migration logic in `main.rs`, including error handling and logging for migration success or failure.
- Introduced a new mail service in `supabase/docker-compose.yml` for handling SMTP, POP3, and web interface.
- Removed version specification from `supabase/dev/docker-compose.dev.yml` for cleaner configuration.

These changes improve the overall structure and functionality of the application, facilitating better database management and service orchestration.
2025-01-07 22:21:28 -07:00
dal 4679adf04a Refactor Docker Compose and API configuration for improved service management
- Consolidated Redis service into the main `docker-compose.yml`, removing the separate API Docker Compose file.
- Added health checks for Redis and API services to ensure proper service readiness.
- Updated API router to include a public health check endpoint.
- Cleaned up the web Dockerfile by removing unnecessary environment variable copying.

These changes enhance service orchestration and improve the reliability of the application during development.
2025-01-07 16:20:59 -07:00
dal 176d5eb06b Refactor Docker Compose and API Dockerfile for improved environment handling
- Removed version specification from `docker-compose.yml` for simplicity.
- Eliminated the `env_file` directive in the `web` service to streamline environment variable management.
- Updated the `Dockerfile` for the API to conditionally copy SSL certificates based on the environment, enhancing flexibility for local and production setups.

These changes aim to simplify the configuration and improve the development workflow.
2025-01-07 15:43:31 -07:00
dal 6b69339c79 Update environment configuration files
- Expanded `.env.example` with additional environment variables for local development, including AWS credentials, database connection strings, and API keys.
- Removed the `api/.env.example` file as its contents have been consolidated into the main `.env.example`.

These changes enhance the local development setup by providing a comprehensive example of required environment variables.
2025-01-07 15:11:53 -07:00
dal a7ae1b1dfd Refactor permission handling in get_message_with_permission function
- Updated the logic to determine final_permission by checking if permission is Some, simplifying the condition.
- Improved error handling for non-public threads when no permissions are provided.
2025-01-06 15:21:37 -07:00
dal c77018abbd Add 'Created' variant to ApiResponse enum in REST router 2025-01-06 13:47:32 -07:00
dal a076f2586f Remove unused ApiResponse variant 'Created' in the REST router 2025-01-06 13:41:19 -07:00
dal 20c37b7000 Refactor dataset route by removing unused imports
- Removed unused imports for `serde_json` and `tokio::task::JoinSet` in the `post_datasets.rs` file.
- This cleanup improves code readability and reduces unnecessary dependencies.
2025-01-06 13:03:34 -07:00
dal 5ccd8ddd72 Log error when failing to retrieve user organization ID in get_asset_access route 2025-01-06 13:00:01 -07:00
dal 5f6792484a Enhance GitHub Actions workflow and Dockerfile for SSL certificate management
- Added steps to configure AWS credentials and download the Postgres SSL certificate from S3 in the GitHub Actions workflow.
- Updated the Dockerfile to reflect the new path for the SSL certificate, ensuring it is correctly copied to the container.

These changes improve the security and organization of SSL certificate handling during the deployment process.
2025-01-03 16:25:39 -07:00
dal 0ef11c1971 Update SSL certificate handling in GitHub Actions workflow and Dockerfile
- Changed the directory structure for SSL certificates in the GitHub Actions workflow, creating a new path `certs/cert` for better organization.
- Updated the Dockerfile to reference the new certificate path, ensuring the SSL certificate is correctly installed in the container.

These changes improve the clarity and maintainability of the deployment process.
2025-01-03 16:19:02 -07:00
dal 31bfaaeecf Update GitHub Actions workflow and Dockerfile for SSL certificate handling
- Added steps to create a directory for SSL certificates and copy the downloaded certificate to the new location in the GitHub Actions workflow.
- Updated the Dockerfile to reference the new certificate path, ensuring proper installation of the SSL certificate in the container.

These changes improve the organization of SSL certificates and enhance the deployment process.
2025-01-03 16:12:31 -07:00
dal bdc3c10712 Brought in the bi-api 2025-01-03 14:32:54 -07:00