-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from lensesio-dev/feat/elastic-ssl
Elasticsearch 6 + 7 SSL Support
- Loading branch information
Showing
20 changed files
with
937 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...common/src/main/java/io/lenses/streamreactor/common/exception/SecuritySetupException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright 2017-2024 Lenses.io Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.lenses.streamreactor.common.exception; | ||
|
||
public class SecuritySetupException extends StreamReactorException { | ||
|
||
public SecuritySetupException(String message) { | ||
super(message); | ||
} | ||
|
||
public SecuritySetupException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...ka-connect-common/src/main/java/io/lenses/streamreactor/common/security/KeyStoreInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2017-2024 Lenses.io Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.lenses.streamreactor.common.security; | ||
|
||
import cyclops.control.Option; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
import java.nio.file.Path; | ||
|
||
@AllArgsConstructor | ||
@Data | ||
public class KeyStoreInfo implements StoreInfo { | ||
|
||
private Path storePath; | ||
|
||
private StoreType storeType; | ||
|
||
private String storePassword; | ||
|
||
private Option<String> managerAlgorithm; | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
...kafka-connect-common/src/main/java/io/lenses/streamreactor/common/security/StoreInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2017-2024 Lenses.io Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.lenses.streamreactor.common.security; | ||
|
||
import cyclops.control.Option; | ||
|
||
import java.nio.file.Path; | ||
|
||
interface StoreInfo { | ||
|
||
Path getStorePath(); | ||
|
||
StoreType getStoreType(); | ||
|
||
Option<String> getManagerAlgorithm(); | ||
} |
44 changes: 44 additions & 0 deletions
44
...kafka-connect-common/src/main/java/io/lenses/streamreactor/common/security/StoreType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2017-2024 Lenses.io Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.lenses.streamreactor.common.security; | ||
|
||
import cyclops.control.Either; | ||
import cyclops.control.Try; | ||
import io.lenses.streamreactor.common.exception.SecuritySetupException; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum StoreType { | ||
|
||
JKS("JKS"), | ||
PKCS12("PKCS12"); | ||
|
||
private final String type; | ||
|
||
StoreType(String type) { | ||
this.type = type; | ||
} | ||
|
||
public static Either<SecuritySetupException, StoreType> valueOfCaseInsensitive(String storeType) { | ||
return Try | ||
.withCatch(() -> StoreType.valueOf(storeType.toUpperCase())) | ||
.toEither() | ||
.mapLeft(ex -> new SecuritySetupException(String.format("Unable to retrieve Store type %s", storeType), ex)); | ||
} | ||
|
||
public static final StoreType DEFAULT_STORE_TYPE = StoreType.JKS; | ||
|
||
} |
Oops, something went wrong.