tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From radcor...@apache.org
Subject [tomee] 03/06: TOMEE-2334: improvement of code based on comments from @jeanouii
Date Fri, 04 Jan 2019 12:00:01 GMT
This is an automated email from the ASF dual-hosted git repository.

radcortez pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 70874212c67f456df1a90e9461b7c91d2b82df5d
Author: cotnic <mitja@cotnic.com>
AuthorDate: Thu Jan 3 22:00:27 2019 +0100

    TOMEE-2334: improvement of code based on comments from @jeanouii
---
 examples/mp-rest-jwt-jwk/README.adoc               |  7 ++++---
 examples/mp-rest-jwt-jwk/pom.xml                   | 22 ----------------------
 .../java/org/superbiz/rest/KeyGeneratorUtil.java   | 16 ++++++++++++++++
 .../test/java/org/superbiz/rest/ProductsTest.java  | 16 ++++++++++++++++
 4 files changed, 36 insertions(+), 25 deletions(-)

diff --git a/examples/mp-rest-jwt-jwk/README.adoc b/examples/mp-rest-jwt-jwk/README.adoc
index 08e9969..ff5a97e 100644
--- a/examples/mp-rest-jwt-jwk/README.adoc
+++ b/examples/mp-rest-jwt-jwk/README.adoc
@@ -33,8 +33,9 @@ project:
 ....
 . Annotate our `Application.class` with `@LoginConfig(authMethod = "MP-JWT")`
 
-. Provide public and private key for authentication. And specify the location of the public
key and the issuer in our
-`microprofile-config.properties` file.
+. Provide public  key for validation of the JWT. And specify the location of the public key
and the issuer in our
+`microprofile-config.properties` file. The public key is then used for verification of the
signature in the
+JWT.
 +
 [source,properties]
 ----
@@ -69,7 +70,7 @@ The application enables us to manipulate and view products with specific
users.
 
 We access endpoints from our test class by creating a `JWT` with the help of
 our `TokenUtils.generateJWTString(String jsonResource, String keyId)` which signs our user
-data in json format with the help of our `src/test/resources/{keyId}` key.
+data in json format with the help of our `src/test/resources/{keyId}` private key.
 
 We can also generate new `privateKey.pem` and `publicKey.pem` with the
 `GenerateKeyUtils.generateKeyPair(String keyAlgorithm, int keySize)` method which
diff --git a/examples/mp-rest-jwt-jwk/pom.xml b/examples/mp-rest-jwt-jwk/pom.xml
index 8a2e025..a488c0e 100644
--- a/examples/mp-rest-jwt-jwk/pom.xml
+++ b/examples/mp-rest-jwt-jwk/pom.xml
@@ -131,28 +131,6 @@
             <scope>test</scope>
         </dependency>
 
-        <!--
-        The <scope>test</scope> guarantees that non of your runtime
-        code is dependent on any OpenEJB classes.
-        -->
-        <dependency>
-            <groupId>org.apache.tomee</groupId>
-            <artifactId>openejb-cxf-rs</artifactId>
-            <version>${tomee.version}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tomee</groupId>
-            <artifactId>openejb-core</artifactId>
-            <version>${tomee.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
-            <version>2.4</version>
-        </dependency>
         <dependency>
             <groupId>org.jboss.arquillian.junit</groupId>
             <artifactId>arquillian-junit-container</artifactId>
diff --git a/examples/mp-rest-jwt-jwk/src/test/java/org/superbiz/rest/KeyGeneratorUtil.java
b/examples/mp-rest-jwt-jwk/src/test/java/org/superbiz/rest/KeyGeneratorUtil.java
index e9f9949..0ceaf02 100644
--- a/examples/mp-rest-jwt-jwk/src/test/java/org/superbiz/rest/KeyGeneratorUtil.java
+++ b/examples/mp-rest-jwt-jwk/src/test/java/org/superbiz/rest/KeyGeneratorUtil.java
@@ -1,3 +1,19 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.superbiz.rest;
 
 import com.nimbusds.jose.jwk.KeyUse;
diff --git a/examples/mp-rest-jwt-jwk/src/test/java/org/superbiz/rest/ProductsTest.java b/examples/mp-rest-jwt-jwk/src/test/java/org/superbiz/rest/ProductsTest.java
index 2eb6dfb..9f569a6 100644
--- a/examples/mp-rest-jwt-jwk/src/test/java/org/superbiz/rest/ProductsTest.java
+++ b/examples/mp-rest-jwt-jwk/src/test/java/org/superbiz/rest/ProductsTest.java
@@ -1,3 +1,19 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.superbiz.rest;
 
 import org.eclipse.microprofile.rest.client.inject.RestClient;


Mime
View raw message