fix(auth): scope mobile sms users by tenant
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
package org.dromara.web.service.impl;
|
||||
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
@Tag("dev")
|
||||
class SmsAuthStrategyTenantTest {
|
||||
|
||||
@Test
|
||||
void mobileSmsUserLookupKeepsTenantBoundary() throws Exception {
|
||||
Path source = Path.of("src/main/java/org/dromara/web/service/impl/SmsAuthStrategy.java");
|
||||
if (!Files.exists(source)) {
|
||||
source = Path.of("ruoyi-admin/src/main/java/org/dromara/web/service/impl/SmsAuthStrategy.java");
|
||||
}
|
||||
String code = Files.readString(source);
|
||||
|
||||
assertTrue(code.contains(".eq(SysUser::getTenantId, tenantId)"));
|
||||
assertTrue(code.contains(".eq(SysUser::getPhonenumber, phonenumber)"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user