-
Notifications
You must be signed in to change notification settings - Fork 284
Migrate to Wildfly 26.1.3.Final #3508
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
Open
lbschanno
wants to merge
39
commits into
integration
Choose a base branch
from
task/wildfly-update
base: integration
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+10,622
−4,973
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
1c6c0ea
Migrate to Wildfly 26.1.3.Final
lbschanno 619537a
Replace left/right brackets with html tags in Javadoc
lbschanno e78b22b
Verify keystore/truststore type is not null
lbschanno d83bb1c
Fix Javadoc causing errors
lbschanno 5e3186c
Separate DnUtils from any configuration concerns
lbschanno cadf406
Fix service loader issues and update usages of DnUtils
lbschanno acd0295
Merge branch 'integration' into task/wildfly-update
lbschanno 6d18742
Update usage of ProxiedEntityUtils
lbschanno 01547f4
Fix issues with ClientLoginExampleBean
lbschanno 8895f89
Move datawave JBOSS modules from webservices to webservice
lbschanno d250949
Use SSLStores in WiredQueryExecutorBeanTest
lbschanno fda2b34
Remove SSLStores.getCertificate() method
lbschanno 1eae800
Load system properties first in DnUtils
lbschanno 51b4825
Make commons/security follow main versioning
lbschanno b49729f
Add back injection of DnUtils (DnProperties)
lbschanno 702647c
Merge branch 'integration' into task/wildfly-update
lbschanno 970c587
Use intermediate commons/security release for microservices
lbschanno 0cbee4f
Undo change to commons/security pom
lbschanno 376a187
Merge branch 'integration' into task/wildfly-update
lbschanno 82f0108
Update pom versions
lbschanno a12a690
Remove picketbox imports again
lbschanno a969ea1
Fix arquillian dependency issues
lbschanno 9dd70ba
Delete unneccessary dependency
lbschanno 38fabd7
Merge branch 'integration' into task/wildfly-update
lbschanno 050aa49
Update pom versions
lbschanno 9fea5e4
Code formatting
lbschanno 4bfbfb9
Make bean definitions discoverable by microservices
lbschanno 0c66c63
Use RC versions for microservice CI tests
lbschanno faa654c
Fix microservice pom versions
lbschanno 9fed2cf
Explicitly define RC version of commons-security for compose tests
lbschanno fb9c55e
Improve wording of pom comment
lbschanno e7235d4
Trigger CI workflow
lbschanno e6e45f7
Code formatting
lbschanno ee8cb96
Use RC of authorization-api with explicit version for commons-security
lbschanno 3c65ab2
Set microservice poms to SNAPSHOT versions
lbschanno 8c52709
Update RC dependency used
lbschanno 5d9614f
Remove unecessary property overrides
lbschanno 924c74a
Remove auhorizations-api dependency from accumulo-utils
lbschanno 3e3021d
Merge branch 'integration' into task/wildfly-update
lbschanno File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,18 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>gov.nsa.datawave</groupId> | ||
| <artifactId>datawave-parent</artifactId> | ||
| <version>7.40.0-SNAPSHOT</version> | ||
| </parent> | ||
|
|
||
| <groupId>gov.nsa.datawave.commons</groupId> | ||
| <artifactId>datawave-commons-parent</artifactId> | ||
| <packaging>pom</packaging> | ||
| <name>${project.artifactId}</name> | ||
|
|
||
| <modules> | ||
| <module>security</module> | ||
| </modules> | ||
| </project> |
This file contains hidden or 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,6 @@ | ||
| # Overview | ||
|
|
||
| This project contains security-related classes that are commonly used between the main Datawave project and the microservices. It is expected that this project will be configured and deployed as a JBOSS module via the [Wildfly assembly](../../web-services/deploy/application) project to make it available to the Datawave EAR deployment. | ||
|
|
||
| ## Note: | ||
| Any compile dependencies here are expected to be imported into the Datawave webservices projects with scope `provided`, and provided via JBOSS modules. This is required to avoid classloader conflicts between the JBOSS modules and the Datawave EAR deployment. See the [Wildfly assembly README](../../web-services/deploy/application/README.md) for more details. |
This file contains hidden or 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,61 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>gov.nsa.datawave.commons</groupId> | ||
| <artifactId>datawave-commons-parent</artifactId> | ||
| <version>7.40.0-SNAPSHOT</version> | ||
| </parent> | ||
|
|
||
| <artifactId>datawave-commons-security</artifactId> | ||
| <name>${project.artifactId}</name> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-annotations</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-core</artifactId> | ||
| <version>${version.jackson}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-databind</artifactId> | ||
| <version>${version.jackson}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.guava</groupId> | ||
| <artifactId>guava</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.jsonwebtoken</groupId> | ||
| <artifactId>jjwt-api</artifactId> | ||
| <version>${version.jjwt}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.jsonwebtoken</groupId> | ||
| <artifactId>jjwt-impl</artifactId> | ||
| <version>${version.jjwt}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>jakarta.xml.bind</groupId> | ||
| <artifactId>jakarta.xml.bind-api</artifactId> | ||
| <version>${version.jakarta}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| <artifactId>junit-jupiter-api</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.slf4j</groupId> | ||
| <artifactId>slf4j-api</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.junit-pioneer</groupId> | ||
| <artifactId>junit-pioneer</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
| </project> |
File renamed without changes.
File renamed without changes.
This file contains hidden or 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 hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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
File renamed without changes.
This file contains hidden or 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
122 changes: 122 additions & 0 deletions
122
commons/security/src/main/java/datawave/security/cert/DatawaveCertVerifier.java
This file contains hidden or 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,122 @@ | ||
| package datawave.security.cert; | ||
|
|
||
| import java.security.KeyStore; | ||
| import java.security.cert.X509Certificate; | ||
| import java.util.Objects; | ||
|
|
||
| import org.slf4j.Logger; | ||
|
|
||
| /** | ||
| * A Datawave-specific {@link X509CertificateVerifier} implementation. | ||
| */ | ||
| public class DatawaveCertVerifier implements X509CertificateVerifier { | ||
|
|
||
| public enum OcspLevel { | ||
| OFF, OPTIONAL, REQUIRED | ||
| } | ||
|
|
||
| protected Logger log; | ||
| protected boolean trace; | ||
| protected OcspLevel ocspLevel = OcspLevel.OFF; | ||
|
|
||
| /** | ||
| * Verify the given certificate | ||
| * | ||
| * @param cert | ||
| * the X509Certificate to verify | ||
| * @param alias | ||
| * the certificate alias | ||
| * @param keystore | ||
| * the keystore for the cert | ||
| * @param truststore | ||
| * the truststore for the cert | ||
| * @return whether the certificate is considered valid | ||
| */ | ||
| @Override | ||
| public boolean verify(X509Certificate cert, String alias, KeyStore keystore, KeyStore truststore) { | ||
| boolean validity = false; | ||
| try { | ||
| cert.checkValidity(); | ||
| validity = checkOCSP(cert, alias, truststore); | ||
| } catch (Exception e) { | ||
| if (trace) | ||
| log.trace("Validity exception", e); | ||
| } | ||
| return validity; | ||
|
|
||
| } | ||
|
|
||
| /** | ||
| * Handle OSCP initialization. | ||
| */ | ||
| protected void initOcsp() {} | ||
|
|
||
| /** | ||
| * Return the OSCP level set for this verifier is supported for the given certificate. | ||
| * | ||
| * @param cert | ||
| * the certificate | ||
| * @param alias | ||
| * the certificate alias | ||
| * @param truststore | ||
| * the truststore | ||
| * @return true if the OSCP level is supported, or false otherwise | ||
| */ | ||
| protected boolean checkOCSP(X509Certificate cert, String alias, KeyStore truststore) { | ||
| if (Objects.requireNonNull(ocspLevel) == OcspLevel.OFF) { | ||
| return true; | ||
| } else { | ||
| log.error("OCSP level {} is not supported!", ocspLevel); | ||
| throw new IllegalArgumentException("OCSP level " + ocspLevel + " is not supported!"); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Return whether the given issuer is supported. | ||
| * | ||
| * @param issuerSubjectDn | ||
| * the issuer DN | ||
| * @param trustStore | ||
| * the truststore | ||
| * @return true if the issuer is supported, or false otherwise | ||
| */ | ||
| public boolean isIssuerSupported(String issuerSubjectDn, KeyStore trustStore) { | ||
| return true; | ||
| } | ||
|
|
||
| /** | ||
| * Set the delegate logger for this {@link DatawaveCertVerifier}. | ||
| * | ||
| * @param log | ||
| * the logger | ||
| */ | ||
| public void setLogger(Logger log) { | ||
| this.log = log; | ||
| this.trace = log.isTraceEnabled(); | ||
| } | ||
|
|
||
| /** | ||
| * Return the OSCP level. | ||
| * | ||
| * @return the OSCP level | ||
| */ | ||
| public OcspLevel getOcspLevel() { | ||
| return ocspLevel; | ||
| } | ||
|
|
||
| /** | ||
| * Set the OSCP level. | ||
| * | ||
| * @param level | ||
| * the OSCP level | ||
| */ | ||
| public void setOcspLevel(String level) { | ||
| ocspLevel = OcspLevel.valueOf(level.toUpperCase()); | ||
| switch (ocspLevel) { | ||
| case REQUIRED: | ||
| case OPTIONAL: | ||
| initOcsp(); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
49 changes: 49 additions & 0 deletions
49
commons/security/src/main/java/datawave/security/cert/SSLStores.java
This file contains hidden or 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,49 @@ | ||
| package datawave.security.cert; | ||
|
|
||
| import java.security.KeyStore; | ||
|
|
||
| import javax.net.ssl.KeyManager; | ||
| import javax.net.ssl.TrustManager; | ||
|
|
||
| /** | ||
| * Represents a key store/trust store pair. | ||
| */ | ||
| public interface SSLStores { | ||
|
|
||
| /** | ||
| * Return the key store | ||
| * | ||
| * @return the keystore | ||
| */ | ||
| default KeyStore getKeyStore() { | ||
| return null; | ||
| } | ||
|
|
||
| /** | ||
| * Return the key managers | ||
| * | ||
| * @return the key managers | ||
| */ | ||
| default KeyManager[] getKeyManagers() { | ||
| return new KeyManager[0]; | ||
| } | ||
|
|
||
| /** | ||
| * Return the trust store | ||
| * | ||
| * @return the truststore | ||
| */ | ||
| default KeyStore getTrustStore() { | ||
| return null; | ||
| } | ||
|
|
||
| /** | ||
| * Return the trust managers | ||
| * | ||
| * @return the trust managers | ||
| */ | ||
| default TrustManager[] getTrustManagers() { | ||
| return new TrustManager[0]; | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.