fix: support tdengine gb32960 raw queries
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -42,6 +42,25 @@ class Gb32960AccessServiceTest {
|
||||
.accepted()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void authenticatePlatformLogin_ignoresBlankAllowedIps() {
|
||||
Gb32960Properties.Auth auth = new Gb32960Properties.Auth();
|
||||
Gb32960Properties.Auth.Platform platform = new Gb32960Properties.Auth.Platform();
|
||||
platform.setUsername("lingniu");
|
||||
platform.setPassword("secret");
|
||||
platform.setAllowedIps(List.of("", " ", "\t"));
|
||||
auth.setPlatforms(List.of(platform));
|
||||
|
||||
Gb32960AccessService service = new Gb32960AccessService(
|
||||
new Gb32960VinAuthorizer(auth),
|
||||
new Gb32960PlatformAuthorizer(auth.getPlatforms()));
|
||||
EmbeddedChannel channel = new EmbeddedChannel();
|
||||
channel.connect(new InetSocketAddress("115.29.187.205", 9001));
|
||||
|
||||
assertThat(service.authenticatePlatformLogin("lingniu", "secret", channel)
|
||||
.accepted()).isTrue();
|
||||
}
|
||||
|
||||
private static Gb32960AccessService newService(boolean vinAuthEnabled) {
|
||||
Gb32960Properties.Auth auth = new Gb32960Properties.Auth();
|
||||
auth.setEnabled(vinAuthEnabled);
|
||||
|
||||
Reference in New Issue
Block a user