This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 6247c2812a335e71fd8a132dd52500bc8620d428 Author: Pasquale Congiusti <pasquale.congiu...@gmail.com> AuthorDate: Tue Jan 7 18:28:43 2025 +0100 chore(e2e): remove useless code --- .../misc/files/registry/FoobarDecryption.java | 32 -------------- e2e/common/misc/files/registry/LaughingRoute.java | 30 ------------- e2e/common/misc/files/registry/classpath/Xslt.java | 32 -------------- .../misc/files/registry/classpath/cheese.xsl | 37 ---------------- e2e/common/misc/files/registry/laugh.txt | 1 - e2e/common/misc/files/registry/laughs/haha.txt | 1 - e2e/common/misc/files/registry/laughs/hehe.txt | 1 - .../misc/files/registry/sample-decryption-1.0.jar | Bin 2766 -> 0 bytes .../misc/files/registry/sample-decryption-1.0.pom | 20 --------- .../main/java/camelk/DeterministicDecryption.java | 49 --------------------- 10 files changed, 203 deletions(-) diff --git a/e2e/common/misc/files/registry/FoobarDecryption.java b/e2e/common/misc/files/registry/FoobarDecryption.java deleted file mode 100644 index bef00e81b..000000000 --- a/e2e/common/misc/files/registry/FoobarDecryption.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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. - */ - -import camelk.DeterministicDecryption; -import org.apache.camel.builder.RouteBuilder; - -public class FoobarDecryption extends RouteBuilder { - - private static final byte[] FOOBAR_ENCRYPTED = new byte[]{1, 104, -61, 45, -19, 59, 76, 38, 35, 97, 56, 49, -79, 79, 74, -79, -2, -42, -89, 76, -111, -3, -27, -102, 43, -94, 50}; - - @Override - public void configure() throws Exception { - from("timer:tick") - .setBody(constant(FOOBAR_ENCRYPTED)) - .bean(DeterministicDecryption.class, "decrypt(${body})") - .log("${body}"); - } -} \ No newline at end of file diff --git a/e2e/common/misc/files/registry/LaughingRoute.java b/e2e/common/misc/files/registry/LaughingRoute.java deleted file mode 100644 index 79218ee96..000000000 --- a/e2e/common/misc/files/registry/LaughingRoute.java +++ /dev/null @@ -1,30 +0,0 @@ -// camel-k: property=location=files/ - -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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. - */ - -import org.apache.camel.builder.RouteBuilder; - -public class LaughingRoute extends RouteBuilder { - - @Override - public void configure() throws Exception { - from("file:{{location}}") - .convertBodyTo(String.class) - .log("${body}"); - } -} diff --git a/e2e/common/misc/files/registry/classpath/Xslt.java b/e2e/common/misc/files/registry/classpath/Xslt.java deleted file mode 100644 index 688789545..000000000 --- a/e2e/common/misc/files/registry/classpath/Xslt.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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. - */ - -import org.apache.camel.builder.RouteBuilder; - -public class Xslt extends RouteBuilder { - - private final String XML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" - + "<item>A</item>"; - - @Override - public void configure() throws Exception { - from("timer:tick?period=1s") - .setBody().constant(XML) - .to("xslt:xslt/cheese.xsl") - .to("log:info"); - } -} diff --git a/e2e/common/misc/files/registry/classpath/cheese.xsl b/e2e/common/misc/files/registry/classpath/cheese.xsl deleted file mode 100644 index 3a8639ecd..000000000 --- a/e2e/common/misc/files/registry/classpath/cheese.xsl +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You 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. ---> -<xsl:stylesheet - xmlns:xsl='http://www.w3.org/1999/XSL/Transform' - version='1.0'> - - <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"/> - - <xsl:template match="/"> - <classpath-xsl subject="{/mail/subject}"> - <cheese> - <xsl:apply-templates select="*|@*"/> - </cheese> - </classpath-xsl> - </xsl:template> - - <xsl:template match="*"> - <xsl:copy> - <xsl:copy-of select="attribute::*"/> - <xsl:apply-templates/> - </xsl:copy> - </xsl:template> - -</xsl:stylesheet> diff --git a/e2e/common/misc/files/registry/laugh.txt b/e2e/common/misc/files/registry/laugh.txt deleted file mode 100644 index 819cc4497..000000000 --- a/e2e/common/misc/files/registry/laugh.txt +++ /dev/null @@ -1 +0,0 @@ -haha \ No newline at end of file diff --git a/e2e/common/misc/files/registry/laughs/haha.txt b/e2e/common/misc/files/registry/laughs/haha.txt deleted file mode 100644 index 819cc4497..000000000 --- a/e2e/common/misc/files/registry/laughs/haha.txt +++ /dev/null @@ -1 +0,0 @@ -haha \ No newline at end of file diff --git a/e2e/common/misc/files/registry/laughs/hehe.txt b/e2e/common/misc/files/registry/laughs/hehe.txt deleted file mode 100644 index 8136fdef1..000000000 --- a/e2e/common/misc/files/registry/laughs/hehe.txt +++ /dev/null @@ -1 +0,0 @@ -hehe \ No newline at end of file diff --git a/e2e/common/misc/files/registry/sample-decryption-1.0.jar b/e2e/common/misc/files/registry/sample-decryption-1.0.jar deleted file mode 100644 index 78edbfff4..000000000 Binary files a/e2e/common/misc/files/registry/sample-decryption-1.0.jar and /dev/null differ diff --git a/e2e/common/misc/files/registry/sample-decryption-1.0.pom b/e2e/common/misc/files/registry/sample-decryption-1.0.pom deleted file mode 100644 index fc8e3f2e6..000000000 --- a/e2e/common/misc/files/registry/sample-decryption-1.0.pom +++ /dev/null @@ -1,20 +0,0 @@ -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.camel.k.external</groupId> - <artifactId>sample-decryption</artifactId> - <version>1.0</version> - - <properties> - <maven.compiler.source>1.8</maven.compiler.source> - <maven.compiler.target>1.8</maven.compiler.target> - </properties> - - <dependencies> - <dependency> - <groupId>com.google.crypto.tink</groupId> - <artifactId>tink</artifactId> - <version>1.6.1</version> - </dependency> - </dependencies> -</project> \ No newline at end of file diff --git a/e2e/common/misc/files/registry/src/main/java/camelk/DeterministicDecryption.java b/e2e/common/misc/files/registry/src/main/java/camelk/DeterministicDecryption.java deleted file mode 100644 index 9822a4840..000000000 --- a/e2e/common/misc/files/registry/src/main/java/camelk/DeterministicDecryption.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 camelk; - -import java.io.IOException; -import java.security.GeneralSecurityException; -import com.google.crypto.tink.CleartextKeysetHandle; -import com.google.crypto.tink.DeterministicAead; -import com.google.crypto.tink.JsonKeysetReader; -import com.google.crypto.tink.KeysetHandle; -import com.google.crypto.tink.aead.AeadConfig; -import com.google.crypto.tink.config.TinkConfig; - -public class DeterministicDecryption { - - private static final String KEYSET = "{\"primaryKeyId\":1757621741,\"key\":[{\"keyData\":{\"typeUrl\":\"type.googleapis.com/google.crypto.tink.AesSivKey\",\"value\":\"EkC4wjyYD7TPwkpxWFwkCrMmkOkpS2wdEwAchBW9INoJvmZHxBysCT0y6tfcW0RXeVWqMYqpuHfV/Np387MQcvme\",\"keyMaterialType\":\"SYMMETRIC\"},\"status\":\"ENABLED\",\"keyId\":1757621741,\"outputPrefixType\":\"TINK\"}]}"; - - - public static String decrypt(byte[] encrypted) throws GeneralSecurityException, IOException { - AeadConfig.register(); - TinkConfig.register(); - - KeysetHandle keysetHandle = CleartextKeysetHandle.read( - JsonKeysetReader.withString(KEYSET)); - - // Get the primitive. - DeterministicAead daead = - keysetHandle.getPrimitive(DeterministicAead.class); - - // deterministically decrypt a ciphertext. - return new String(daead.decryptDeterministically(encrypted, null)); - - } -}