-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate table prefix before allowing new tenant to be added #11803
Comments
I remembered @jtkech mentioned the reason behind "Invalid Serial Number" long time ago, may be the tenant not loaded successfully |
Maybe this should be part of YesSql, it needs to be evaluated. |
@Skrypt I agree that YesSql should provide an easy way to get info about the connection. We could add a new services called
The new Another cleaner way, we could add the following parameter to Then we can define the factory during registration using something like this
Then simply, we can find the DatabaseProvider instance and call the However, with the second approach we would have to add |
Let me check YesSQL I'm sure I suggested or mentioned something similar there |
The thing that I refered to related to checking the connection string if it's valid, but here the case is different |
Seems OrchardCore/src/OrchardCore.Modules/OrchardCore.Tenants/Services/TenantValidator.cs Line 38 in ef76b6f
@CrestApps I can submit a PR for this, unless you need to do it ;) |
I didn't notice that you refer to |
Describe the bug
When adding a new tenant, we allow the user to set a prefix to the tables to enable reusing the same database for multiple tenets. However, we don't validate to ensure that the prefix isn't already used first. The problem with this is that it throws an exception
To Reproduce
Steps to reproduce the behavior:
Suggestion
When creating the tenant, we should group existing connections by prefix. Then check to make sure the prefix isn't already used before allowing it.
I think this logic should be part of the
ITenantValidator
But I think the validation would have to be done per type/servername/databasename/prefixThe text was updated successfully, but these errors were encountered: