You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2022/04/24 16:54:00 UTC

[incubator-streampipes] branch dev updated: [hotfix] Fix headers

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new 269ada603 [hotfix] Fix headers
269ada603 is described below

commit 269ada603516da510fcc5b443c3cbbc1ab851ffc
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Sun Apr 24 18:53:51 2022 +0200

    [hotfix] Fix headers
---
 .../config/backend/model/JwtSigningMode.java           | 18 ++++++++++++++++++
 .../streampipes/security/jwt/JwtTokenValidator.java    | 18 ++++++++++++++++++
 .../apache/streampipes/security/jwt/KeyGenerator.java  |  4 ++--
 3 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/streampipes-config/src/main/java/org/apache/streampipes/config/backend/model/JwtSigningMode.java b/streampipes-config/src/main/java/org/apache/streampipes/config/backend/model/JwtSigningMode.java
index 11a6df06c..7bc74e183 100644
--- a/streampipes-config/src/main/java/org/apache/streampipes/config/backend/model/JwtSigningMode.java
+++ b/streampipes-config/src/main/java/org/apache/streampipes/config/backend/model/JwtSigningMode.java
@@ -1,3 +1,21 @@
+/*
+ * 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 org.apache.streampipes.config.backend.model;
 
 public enum JwtSigningMode {
diff --git a/streampipes-security-jwt/src/main/java/org/apache/streampipes/security/jwt/JwtTokenValidator.java b/streampipes-security-jwt/src/main/java/org/apache/streampipes/security/jwt/JwtTokenValidator.java
index 9b1237e0d..ccd6df077 100644
--- a/streampipes-security-jwt/src/main/java/org/apache/streampipes/security/jwt/JwtTokenValidator.java
+++ b/streampipes-security-jwt/src/main/java/org/apache/streampipes/security/jwt/JwtTokenValidator.java
@@ -1,3 +1,21 @@
+/*
+ * 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 org.apache.streampipes.security.jwt;
 
 import io.jsonwebtoken.*;
diff --git a/streampipes-security-jwt/src/main/java/org/apache/streampipes/security/jwt/KeyGenerator.java b/streampipes-security-jwt/src/main/java/org/apache/streampipes/security/jwt/KeyGenerator.java
index 4faa39577..b62087147 100644
--- a/streampipes-security-jwt/src/main/java/org/apache/streampipes/security/jwt/KeyGenerator.java
+++ b/streampipes-security-jwt/src/main/java/org/apache/streampipes/security/jwt/KeyGenerator.java
@@ -55,16 +55,16 @@ public class KeyGenerator {
         return makeKeyForRsa(pkContent);
       } catch (IOException | InvalidKeySpecException | NoSuchAlgorithmException e) {
         e.printStackTrace();
+        LOG.warn("Could not properly create the provided key, defaulting to an HMAC token, which will almost certainly lead to problems");
         return makeKeyForSecret(tokenSecret);
       }
     } else {
-      LOG.warn("Could not properly create the provided key, defaulting to an HMAC token, which will most certainly lead to problems");
       return makeKeyForSecret(tokenSecret);
     }
   }
 
   public String readKey() throws IOException {
-   return Files.readString(Paths.get(Envs.SP_JWT_PUBLIC_KEY_LOC.getValue()), Charset.defaultCharset());
+    return Files.readString(Paths.get(Envs.SP_JWT_PUBLIC_KEY_LOC.getValue()), Charset.defaultCharset());
   }
 
   public Key makeKeyForRsa(String key) throws IOException, InvalidKeySpecException, NoSuchAlgorithmException {