-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
删除App后,相似的AppID权限异常,并无法恢复 #5143
Comments
针对你遇到的问题,由于MySQL中的LIKE查询将下划线( SELECT * FROM YourTable WHERE YourColumn LIKE 'your\_pattern' ESCAPE '\'; 如果你的应用程序动态构建查询,并且需要转义用户输入,那么在将输入字符串包含到查询中之前,你需要在程序中将每个下划线( 以Python为例,可以这样做: user_input = "example_app_id" # 假设这是需要包含在LIKE模式中的输入
escaped_input = user_input.replace("_", "\\_")
query = f"SELECT * FROM App WHERE AppId LIKE '{escaped_input}' ESCAPE '\\';" 关于删除后的AppID权限异常并无法恢复的问题,你提到的Apollo仓库代码中并没有处理恢复已删除AppID的逻辑。删除操作通过更新 希望这能帮到你!如果还有其他问题,随时提问。
|
当我从Apollo管理页面中删除AppID为hello_world 的应用后,因为下换线的原因,helloaworld 这个应用的权限出现了异常,重新给helloaworld出现异常的人员再次授权,仍无法使用 |
To address the issue with AppID permissions after deleting an app with an underscore in its ID, and the subsequent problem with similar AppIDs like First, when performing queries that involve AppIDs with underscores, make sure to escape the underscore. This prevents MySQL from interpreting it as a wildcard. For example, to search for an AppID SELECT * FROM App WHERE AppId LIKE 'hello\\_world'; This ensures that MySQL searches for the exact AppID, including the underscore, rather than treating the underscore as a wildcard. If you're dynamically generating these queries based on user input, you'll need to replace underscores in the input with user_input = "hello_world" # The AppID to search for
escaped_input = user_input.replace("_", "\\_")
query = f"SELECT * FROM App WHERE AppId LIKE '{escaped_input}' ESCAPE '\\';" Regarding the issue of permissions not being restored correctly for Remember, the key to resolving these issues is careful handling of special characters like underscores in SQL queries and ensuring that your application's logic correctly manages the relationships between AppIDs and their associated permissions.
|
可以尝试手动恢复一下被删除的数据,如 select * from Role where RoleName in ('ModifyNamespace+helloaworld+application', 'ReleaseNamespace+helloaworld+application');
select * from Permission where TargetId = 'helloaworld+application'; |
使用mysql数据库时,当与删除appid中包含下划线'_'时,导致相似的app权限异常
在mysql中like查询时,下划线代表任意一个字符
当删除 hello_world 后,访问 helloaworld 时,相关权限提示异常,重新授权无法恢复
发现版本:1.4.1
当前master版本中代码仍在使用like的方式查找并删除
The text was updated successfully, but these errors were encountered: