From 0b14d5b9658693ec34de8b1b082639bd2fcc90db Mon Sep 17 00:00:00 2001 From: 3keyroman <46850604+3keyroman@users.noreply.github.com> Date: Fri, 2 Jun 2023 18:49:07 +0200 Subject: [PATCH 1/5] Increase version number --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e5d3ec2..447820a 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ com.czertainly keystore-entity-provider - 1.4.0 + 1.4.1-SNAPSHOT CZERTAINLY-Keystore-Entity-Provider From 1af0e8a5162c2b403b5b278828b4e17cbd501a64 Mon Sep 17 00:00:00 2001 From: lubomirw <76479559+lubomirw@users.noreply.github.com> Date: Wed, 18 Oct 2023 13:20:01 +0200 Subject: [PATCH 2/5] Fix location certificates attributes response when getting location detail (#35) --- pom.xml | 2 +- .../service/impl/LocationServiceImpl.java | 26 +++++++++---------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 447820a..830dc18 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ com.czertainly interfaces - 2.8.0 + 2.9.1-SNAPSHOT diff --git a/src/main/java/com/czertainly/provider/entity/keystore/service/impl/LocationServiceImpl.java b/src/main/java/com/czertainly/provider/entity/keystore/service/impl/LocationServiceImpl.java index fd21a54..27e53bc 100644 --- a/src/main/java/com/czertainly/provider/entity/keystore/service/impl/LocationServiceImpl.java +++ b/src/main/java/com/czertainly/provider/entity/keystore/service/impl/LocationServiceImpl.java @@ -4,6 +4,7 @@ import com.czertainly.api.exception.NotFoundException; import com.czertainly.api.model.client.attribute.RequestAttributeDto; import com.czertainly.api.model.common.attribute.v2.AttributeType; +import com.czertainly.api.model.common.attribute.v2.BaseAttribute; import com.czertainly.api.model.common.attribute.v2.DataAttribute; import com.czertainly.api.model.common.attribute.v2.MetadataAttribute; import com.czertainly.api.model.common.attribute.v2.content.AttributeContentType; @@ -94,6 +95,8 @@ public LocationDetailResponseDto getLocationDetail(String entityUuid, LocationDe List certificates = new ArrayList<>(); // parse the response and get certificates List certs = KeystoreResponseUtil.getAllKeystoreCertificates(response); + List csrAttributesDefinitions = locationAttributeService.listGenerateCsrAttributes(entity); + List pushAttributesDefinitions = locationAttributeService.listPushCertificateAttributes(entity); for (KeystoreCertificate cert : certs) { CertificateLocationDto certificateLocationDto = new CertificateLocationDto(); certificateLocationDto.setCertificateData(CertificateUtil.getBase64Certificate(cert.getCertificate())); @@ -104,33 +107,29 @@ public LocationDetailResponseDto getLocationDetail(String entityUuid, LocationDe certificateLocationDto.setMetadata(certificateMeta); - List pushAttributes = new ArrayList<>(); - DataAttribute aliasAttribute = new DataAttribute(); + List pushAttributes = new ArrayList<>(); + RequestAttributeDto aliasAttribute = new RequestAttributeDto(); aliasAttribute.setName(AttributeConstants.ATTRIBUTE_ALIAS_NAME); aliasAttribute.setContent(List.of(new StringAttributeContent(cert.getAlias()))); - aliasAttribute.setContentType(AttributeContentType.STRING); pushAttributes.add(aliasAttribute); - certificateLocationDto.setPushAttributes(pushAttributes); + certificateLocationDto.setPushAttributes(AttributeDefinitionUtils.mergeAttributes(pushAttributesDefinitions, pushAttributes)); - List csrAttributes = new ArrayList<>(); + List csrAttributes = new ArrayList<>(); if (cert.isKeyEntry()) { - DataAttribute subjectDnAttribute = new DataAttribute(); + RequestAttributeDto subjectDnAttribute = new RequestAttributeDto(); subjectDnAttribute.setName(AttributeConstants.ATTRIBUTE_DN_NAME); subjectDnAttribute.setContent(List.of(new StringAttributeContent(cert.getCertificate().getSubjectDN().toString()))); - subjectDnAttribute.setContentType(AttributeContentType.STRING); csrAttributes.add(subjectDnAttribute); PublicKey pubk = cert.getCertificate().getPublicKey(); - DataAttribute keyAlgorithmAttribute = new DataAttribute(); + RequestAttributeDto keyAlgorithmAttribute = new RequestAttributeDto(); keyAlgorithmAttribute.setName(AttributeConstants.ATTRIBUTE_KEY_ALG_NAME); keyAlgorithmAttribute.setContent(List.of(new StringAttributeContent(pubk.getAlgorithm()))); - keyAlgorithmAttribute.setContentType(AttributeContentType.STRING); csrAttributes.add(keyAlgorithmAttribute); - DataAttribute keyLengthAttribute = new DataAttribute(); + RequestAttributeDto keyLengthAttribute = new RequestAttributeDto(); keyLengthAttribute.setName(AttributeConstants.ATTRIBUTE_KEY_SIZE_NAME); - keyLengthAttribute.setContentType(AttributeContentType.STRING); if (pubk instanceof RSAPublicKey) { RSAPublicKey rsaPubk = (RSAPublicKey) pubk; keyLengthAttribute.setContent(List.of(new StringAttributeContent(String.valueOf(rsaPubk.getModulus().bitLength())))); @@ -145,17 +144,16 @@ public LocationDetailResponseDto getLocationDetail(String entityUuid, LocationDe } csrAttributes.add(keyLengthAttribute); - DataAttribute signatureAlgorithmAttribute = new DataAttribute(); + RequestAttributeDto signatureAlgorithmAttribute = new RequestAttributeDto(); signatureAlgorithmAttribute.setName(AttributeConstants.ATTRIBUTE_SIG_ALG_NAME); signatureAlgorithmAttribute.setContent(List.of(new StringAttributeContent(cert.getCertificate().getSigAlgName()))); - signatureAlgorithmAttribute.setContentType(AttributeContentType.STRING); csrAttributes.add(signatureAlgorithmAttribute); // alias include csrAttributes.add(aliasAttribute); } - certificateLocationDto.setCsrAttributes(csrAttributes); + certificateLocationDto.setCsrAttributes(AttributeDefinitionUtils.mergeAttributes(csrAttributesDefinitions, csrAttributes)); certificates.add(certificateLocationDto); } From f410d1808e352e29b6ec2fc4d871a6e4f8248b17 Mon Sep 17 00:00:00 2001 From: lubomirw <76479559+lubomirw@users.noreply.github.com> Date: Sat, 18 Nov 2023 14:15:12 +0100 Subject: [PATCH 3/5] Update minor versions of dependencies (#36) - CZERTAINLY-Dependencies to 1.1.0 - org.apache.sshd:sshd-core to 2.11.0 - org.apache.sshd:sshd-scp to 2.11.0 --- pom.xml | 6 +++--- .../entity/keystore/service/impl/SshServiceImpl.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 830dc18..b9ea0f0 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.czertainly dependencies - 1.0.0 + 1.1.0 com.czertainly @@ -30,12 +30,12 @@ org.apache.sshd sshd-core - 2.7.0 + 2.11.0 org.apache.sshd sshd-scp - 2.5.1 + 2.11.0 diff --git a/src/main/java/com/czertainly/provider/entity/keystore/service/impl/SshServiceImpl.java b/src/main/java/com/czertainly/provider/entity/keystore/service/impl/SshServiceImpl.java index 1e1ee96..05a566f 100644 --- a/src/main/java/com/czertainly/provider/entity/keystore/service/impl/SshServiceImpl.java +++ b/src/main/java/com/czertainly/provider/entity/keystore/service/impl/SshServiceImpl.java @@ -12,10 +12,10 @@ import org.apache.sshd.client.SshClient; import org.apache.sshd.client.channel.ClientChannel; import org.apache.sshd.client.channel.ClientChannelEvent; -import org.apache.sshd.client.scp.ScpClient; -import org.apache.sshd.client.scp.ScpClientCreator; import org.apache.sshd.client.session.ClientSession; import org.apache.sshd.common.channel.Channel; +import org.apache.sshd.scp.client.ScpClient; +import org.apache.sshd.scp.client.ScpClientCreator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; From de78748e53b518d7cff044eefb58076d1d8580fd Mon Sep 17 00:00:00 2001 From: 3keyroman Date: Thu, 23 Nov 2023 21:14:51 +0100 Subject: [PATCH 4/5] Update release version to 1.4.1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b9ea0f0..d3d4818 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ com.czertainly keystore-entity-provider - 1.4.1-SNAPSHOT + 1.4.1 CZERTAINLY-Keystore-Entity-Provider @@ -24,7 +24,7 @@ com.czertainly interfaces - 2.9.1-SNAPSHOT + 2.10.0 From f06b75fd051560aa1b0b00aee67de98fffaf6db5 Mon Sep 17 00:00:00 2001 From: 3keyroman Date: Thu, 23 Nov 2023 21:14:55 +0100 Subject: [PATCH 5/5] Update settings.xml --- settings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/settings.xml b/settings.xml index 28cde57..c74062f 100644 --- a/settings.xml +++ b/settings.xml @@ -12,8 +12,8 @@ github - central - https://repo1.maven.org/maven2 + ossrh-releases + https://s01.oss.sonatype.org/content/repositories/releases github