PascalSchumacher commented on code in PR #17460:
URL: https://github.com/apache/camel/pull/17460#discussion_r1997640777


##########
components/camel-oauth/src/main/java/org/apache/camel/oauth/JWTOptions.java:
##########
@@ -0,0 +1,171 @@
+/*
+ * 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.camel.oauth;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import io.vertx.core.json.JsonObject;
+
+public class JWTOptions {
+    private int leeway = 0;
+    private boolean ignoreExpiration;
+    private String algorithm = "HS256";
+    private JsonObject header;
+    private boolean noTimestamp;
+    private int expires;
+    private List<String> audience;
+    private String issuer;
+    private String subject;
+    private List<String> permissions;
+    private String nonceAlgorithm;
+
+    public JWTOptions() {
+        this.header = new JsonObject();
+    }
+
+    public JWTOptions(JWTOptions other) {
+        this.leeway = other.leeway;
+        this.ignoreExpiration = other.ignoreExpiration;
+        this.algorithm = other.algorithm;
+        this.header = other.header == null ? new JsonObject() : 
other.header.copy();
+        this.noTimestamp = other.noTimestamp;
+        this.expires = other.expires;
+        this.audience = other.audience == null ? null : new 
ArrayList<>(other.audience);
+        this.issuer = other.issuer;
+        this.subject = other.subject;
+        this.permissions = other.permissions == null ? null : new 
ArrayList<>(other.permissions);
+        this.nonceAlgorithm = other.nonceAlgorithm;
+    }
+
+    /*
+    public JWTOptions(JsonObject json) {
+        this.header = new JsonObject();
+        JWTOptionsConverter.fromJson(json, this);
+    }
+
+    public JsonObject toJson() {
+        JsonObject json = new JsonObject();
+        JWTOptionsConverter.toJson(this, json);
+        return json;
+    }
+    */

Review Comment:
   I guess this commented-out code could/should be removed?



##########
components/camel-oauth/src/main/java/org/apache/camel/oauth/JWTOptions.java:
##########
@@ -0,0 +1,171 @@
+/*
+ * 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.camel.oauth;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import io.vertx.core.json.JsonObject;
+
+public class JWTOptions {
+    private int leeway = 0;
+    private boolean ignoreExpiration;
+    private String algorithm = "HS256";
+    private JsonObject header;
+    private boolean noTimestamp;
+    private int expires;
+    private List<String> audience;
+    private String issuer;
+    private String subject;
+    private List<String> permissions;
+    private String nonceAlgorithm;
+
+    public JWTOptions() {
+        this.header = new JsonObject();
+    }
+
+    public JWTOptions(JWTOptions other) {
+        this.leeway = other.leeway;
+        this.ignoreExpiration = other.ignoreExpiration;
+        this.algorithm = other.algorithm;
+        this.header = other.header == null ? new JsonObject() : 
other.header.copy();
+        this.noTimestamp = other.noTimestamp;
+        this.expires = other.expires;
+        this.audience = other.audience == null ? null : new 
ArrayList<>(other.audience);
+        this.issuer = other.issuer;
+        this.subject = other.subject;
+        this.permissions = other.permissions == null ? null : new 
ArrayList<>(other.permissions);
+        this.nonceAlgorithm = other.nonceAlgorithm;
+    }
+
+    /*
+    public JWTOptions(JsonObject json) {
+        this.header = new JsonObject();
+        JWTOptionsConverter.fromJson(json, this);
+    }
+
+    public JsonObject toJson() {
+        JsonObject json = new JsonObject();
+        JWTOptionsConverter.toJson(this, json);
+        return json;
+    }
+    */

Review Comment:
   I guess this commented-out code should be removed?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to