Skip to content

Commit

Permalink
Fixes incorrect environment variable definition in SASL integration doc
Browse files Browse the repository at this point in the history
  • Loading branch information
linghengqian committed Sep 30, 2024
1 parent d29c0ae commit 8879481
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,5 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: 'maven'
native-image-job-reports: 'true'
- name: Run nativeTest with GraalVM CE for ${{ matrix.java-version }}
continue-on-error: true
- name: Run nativeTest with GraalVM CE for ${{ matrix.java }}
run: ./mvnw -PnativeTestInElasticJob -T1C -B -e clean test
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
- ./jaas-server-test.conf:/jaas-test.conf
environment:
JVMFLAGS: "-Djava.security.auth.login.config=/jaas-test.conf"
ZOO_CFG_EXTRA: "org.apache.zookeeper.server.auth.SASLAuthenticationProvider sessionRequireClientSASLAuth=true"
ZOO_CFG_EXTRA: "authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider sessionRequireClientSASLAuth=true"
ports:
- "2181:2181"
```
Expand Down Expand Up @@ -100,4 +100,4 @@ public class ExampleUtils {
要使 ElasticJob 的 `org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter` 连接至开启 Kerberos 鉴权的 Zookeeper Server,
流程类似于 DIGEST-MD5。以 https://cwiki.apache.org/confluence/display/ZOOKEEPER/Client-Server+mutual+authentication 为准。

部分地区可能不被允许使用 MIT Kerberos 的源代码或二进制产物,可参考 MIT Kerberos 的分发站点 https://web.mit.edu/kerberos/dist/index.html
Kerberos KDC 不存在可用的 Docker Image,用户可能需要手动启动 Kerberos KDC
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
- ./jaas-server-test.conf:/jaas-test.conf
environment:
JVMFLAGS: "-Djava.security.auth.login.config=/jaas-test.conf"
ZOO_CFG_EXTRA: "org.apache.zookeeper.server.auth.SASLAuthenticationProvider sessionRequireClientSASLAuth=true"
ZOO_CFG_EXTRA: "authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider sessionRequireClientSASLAuth=true"
ports:
- "2181:2181"
```
Expand Down Expand Up @@ -109,5 +109,4 @@ To connect ElasticJob's `org.apache.shardingsphere.elasticjob.reg.zookeeper.Zook
the process is similar to DIGEST-MD5.
Refer to https://cwiki.apache.org/confluence/display/ZOOKEEPER/Client-Server+mutual+authentication .

Some regions may not allow the use of MIT Kerberos source code or binary products.
Please refer to the MIT Kerberos distribution site https://web.mit.edu/kerberos/dist/index.html .
There is no available Docker Image for Kerberos KDC. Users may need to start Kerberos KDC manually.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* Spring Boot Web Server for testing only.
*/
@SpringBootApplication
public class TestMain {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ static void beforeAll() throws Exception {
client.start();
Awaitility.await().atMost(Duration.ofMillis(500 * 60)).ignoreExceptions().until(client::isConnected);
}
firstRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-java"));
firstRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-operation-java"));
firstRegCenter.init();
secondRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-java"));
secondRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-operation-java"));
secondRegCenter.init();
HikariConfig config = new HikariConfig();
config.setDriverClassName("org.h2.Driver");
Expand All @@ -114,6 +114,7 @@ static void afterAll() throws IOException {
* TODO Executing {@link JobConfigurationAPI#removeJobConfiguration(String)} will always cause the listener
* to throw an exception similar to {@code Caused by: java.lang.IllegalStateException: Expected state [STARTED] was [STOPPED]} .
* This is not acceptable behavior.
* The logic inside {@link org.junit.jupiter.api.Assertions#assertDoesNotThrow(Executable)} should be removed.
*/
@Test
void testJobConfigurationAPI() {
Expand Down Expand Up @@ -141,6 +142,11 @@ void testJobConfigurationAPI() {
JobConfigurationPOJO newTestJavaSimpleJob = jobConfigAPI.getJobConfiguration(jobName);
assertThat(newTestJavaSimpleJob, notNullValue());
assertThat(newTestJavaSimpleJob.getCron(), is("0/10 * * * * ?"));
assertDoesNotThrow(() -> {
List<String> ipList = secondRegCenter.getChildrenKeys("/" + jobName + "/servers");
assertThat(ipList.size(), is(1));
secondRegCenter.remove("/" + jobName + "/servers/" + ipList.get(0));
});
jobConfigAPI.removeJobConfiguration(jobName);
assertThat(jobConfigAPI.getJobConfiguration(jobName), nullValue());
job.shutdown();
Expand Down

0 comments on commit 8879481

Please sign in to comment.