This repository was archived by the owner on Mar 25, 2026. It is now read-only.
Open
Conversation
… validation - Implemented comprehensive security tests to ensure data isolation between organizations, covering run access, flow deployments, flow lists, batch content retrieval, version history, and deletion operations. - Updated schema validation tests to reflect changes from tenant-based to organization-based identifiers, ensuring proper foreign key relationships and constraints. - Adjusted SQL queries in tests to use organization_id instead of tenant_id, aligning with the new multi-organization architecture.
…r handling across multiple modules
- Added role and permission types to the TypeScript definitions. - Introduced permission checking utilities in a new permissions module. - Updated AuthContext to manage user roles and permissions. - Enhanced API client to use versioned endpoints for authentication and OAuth. - Refactored organization and team management pages to utilize new permission checks. - Updated login and registration pages to handle errors more gracefully. - Improved user experience by displaying user roles and permission-related messages.
- Updated flow storage functions to require organization_id for isolation. - Modified Engine and webhook handlers to include organization_id in flow operations. - Enhanced McpServer and McpManager to support organization-specific server instances. - Added organization_id field to StepRun for better query isolation. - Updated database schemas and queries in Postgres and SQLite to handle organization_id. - Implemented tests to verify organization isolation across flows and steps.
jiyuu-jin
reviewed
Dec 3, 2025
| /// | ||
| /// This is used for both organization_id and flow names to ensure | ||
| /// they don't contain path separators or parent directory references. | ||
| fn validate_path_component(value: &str, field_name: &str) -> Result<()> { |
Contributor
There was a problem hiding this comment.
Instead of banning certain chars to be interpolated into the path, you should validate organization_id to only contain valid chars (ones that are safe to interpolate). Suggest creating a custom struct OrganizationId(String) type (note no pub) and then create a try_from() constructor which validates the characters inside. Construct the OrganizationId ASAP in the flow.
jiyuu-jin
reviewed
Dec 3, 2025
src/storage/postgres.rs
Outdated
Comment on lines
581
to
586
| let row = sqlx::query( | ||
| "SELECT version FROM flow_versions | ||
| WHERE flow_name = $1 | ||
| WHERE organization_id = $1 AND flow_name = $2 | ||
| ORDER BY deployed_at DESC, version DESC | ||
| LIMIT 1", | ||
| ) |
Contributor
There was a problem hiding this comment.
Suggested change
| let row = sqlx::query( | |
| "SELECT version FROM flow_versions | |
| WHERE flow_name = $1 | |
| WHERE organization_id = $1 AND flow_name = $2 | |
| ORDER BY deployed_at DESC, version DESC | |
| LIMIT 1", | |
| ) | |
| let query = " | |
| SELECT version | |
| FROM flow_versions | |
| WHERE organization_id = $1 | |
| AND flow_name = $2 | |
| ORDER BY deployed_at DESC, | |
| version DESC | |
| LIMIT 1 | |
| "; | |
| let row = sqlx::query(query) |
jiyuu-jin
reviewed
Dec 3, 2025
| // User methods | ||
| async fn create_user(&self, user: &crate::auth::User) -> Result<()> { | ||
| sqlx::query( | ||
| r#" |
Contributor
There was a problem hiding this comment.
Doesn't need to be a raw string
jiyuu-jin
reviewed
Dec 3, 2025
src/storage/postgres.rs
Outdated
| @@ -478,15 +538,20 @@ impl FlowStorage for PostgresStorage { | |||
| Ok(row.and_then(|r| r.try_get("content").ok())) | |||
Contributor
There was a problem hiding this comment.
Should map to Result not None
jiyuu-jin
reviewed
Dec 3, 2025
src/storage/postgres.rs
Outdated
| encrypted_refresh, | ||
| )?; | ||
|
|
||
| creds.push(OAuthCredential { |
Contributor
There was a problem hiding this comment.
Use #[derive(sqlx::FromRow)] and sqlx::query_as()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.