-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Arjan Tijms <arjan.tijms@gmail.com>
- Loading branch information
1 parent
bd0ecc3
commit 938e198
Showing
10 changed files
with
394 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...r/distributions/glassfish/src/main/patches/microprofile-jwt-auth-api/META-INF/MANIFEST.MF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-Description: MicroProfile Parent POM | ||
Bundle-License: Apache License, Version 2.0 | ||
Bundle-SymbolicName: org.eclipse.microprofile.jwt | ||
Bnd-LastModified: 1637150061577 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-DocURL: https://github.com/eclipse/microprofile-jwt-auth/microp | ||
rofile-jwt-auth-api | ||
Bundle-Vendor: Eclipse Foundation | ||
Import-Package: jakarta.enterprise.util;version="[3.0,5)",jakarta.inje | ||
ct;version="[2.0,3)",jakarta.json;version="[2.0,3)" | ||
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))" | ||
Bundle-Developers: starksm64;name="Scott M Stark";organization="Red Ha | ||
t Inc.";organizationUrl="https://redhat.com",dblevins;name="David Ble | ||
vins";organization=Tomitribe;organizationUrl="https://tomitribe.com", | ||
sberyozkin;name="Sergey Beryozkin1";organization="Red Hat Inc.";organ | ||
izationUrl="https://redhat.com",radcortez;name="Roberto Cortez";organ | ||
ization="Red Hat Inc.";organizationUrl="https://redhat.com",rdebussch | ||
er;name="Rudy De Busscher";organization=Payara;organizationUrl="https | ||
://www.payara.fish/",ayoho;name="Adam Yoho";organization=IBM;organiza | ||
tionUrl="https://www.ibm.com",teddyjtorres;name="Teddy Torres";organi | ||
zation=IBM;organizationUrl="https://www.ibm.com" | ||
Tool: Bnd-5.2.0.202010142003 | ||
Export-Package: org.eclipse.microprofile.auth;version="1.0",org.eclips | ||
e.microprofile.jwt;version="2.0";uses:="jakarta.enterprise.util,jakar | ||
ta.inject",org.eclipse.microprofile.jwt.config;version="2.0.0" | ||
Bundle-Name: MicroProfile JWT Auth Bundle | ||
Bundle-Version: 2.0.0 | ||
Bundle-SCM: url="https://github.com/eclipse/microprofile-jwt-auth/micr | ||
oprofile-jwt-auth-api",connection="scm:git:https://github.com/eclipse | ||
/microprofile-jwt-auth.git/microprofile-jwt-auth-api",developer-conne | ||
ction="scm:git:git@github.com:eclipse/microprofile-jwt-auth.git/micro | ||
profile-jwt-auth-api",tag="2.0" | ||
Build-Jdk-Spec: 1.8 | ||
Created-By: 1.8.0_292 (AdoptOpenJDK) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2022, 2022 Contributors to the Eclipse Foundation. All rights reserved. | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.glassfish.main.tests.tck</groupId> | ||
<artifactId>tck</artifactId> | ||
<version>7.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>glassfish-external-tck-microprofile-jwt</artifactId> | ||
|
||
<name>TCK: JWT</name> | ||
<description>Aggregates dependencies and runs the MicroProfile JWT TCK</description> | ||
|
||
<properties> | ||
<maven.compiler.release>17</maven.compiler.release> | ||
|
||
<glassfish.version>${project.version}</glassfish.version> | ||
<glassfish.root>${project.build.directory}</glassfish.root> | ||
<glassfish.home>${glassfish.root}/glassfish7</glassfish.home> | ||
</properties> | ||
|
||
<dependencies> | ||
<!-- | ||
This is the MP-JWT TCK base extension and utility classes | ||
archive. | ||
--> | ||
<dependency> | ||
<groupId>org.eclipse.microprofile.jwt</groupId> | ||
<artifactId>microprofile-jwt-auth-tck</artifactId> | ||
<version>2.0</version> | ||
</dependency> | ||
|
||
<!-- | ||
This is the actual MP-JWT TCK test classes archive | ||
--> | ||
<dependency> | ||
<groupId>org.eclipse.microprofile.jwt</groupId> | ||
<artifactId>microprofile-jwt-auth-tck</artifactId> | ||
<version>2.0</version> | ||
<type>test-jar</type> | ||
</dependency> | ||
|
||
<!-- | ||
The Arquillian connector used to start/stop GlassFish and deploy | ||
archives to it. | ||
--> | ||
<dependency> | ||
<groupId>org.omnifaces.arquillian</groupId> | ||
<artifactId>arquillian-glassfish-server-managed</artifactId> | ||
<version>1.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<!-- | ||
Jakarta EE 10 client implementations. This is needed as the unit | ||
tests make use of Jakarta EE 10 client APIs, but do not specify the | ||
implementation. | ||
--> | ||
<dependency> | ||
<groupId>org.omnifaces.arquillian</groupId> | ||
<artifactId>glassfish-client-ee10</artifactId> | ||
<version>1.2</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>jakarta.platform</groupId> | ||
<artifactId>jakarta.jakartaee-api</artifactId> | ||
<version>10.0.0</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<!-- | ||
Extract the TCK Suite Files, so that the surefire plugin | ||
can refer to tck-base-suite.xml | ||
--> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>unpack</id> | ||
<phase>process-test-classes</phase> | ||
<goals> | ||
<goal>unpack</goal> | ||
</goals> | ||
<configuration> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>org.eclipse.microprofile.jwt</groupId> | ||
<artifactId>microprofile-jwt-auth-tck</artifactId> | ||
<version>2.0</version> | ||
<classifier>tests</classifier>> | ||
<overWrite>false</overWrite> | ||
<outputDirectory>${project.build.directory}/tck-suite</outputDirectory> | ||
<!-- Include the tck-base-suite.xml file --> | ||
<includes>**/tck-base-suite.xml</includes> | ||
</artifactItem> | ||
</artifactItems> | ||
</configuration> | ||
</execution> | ||
|
||
<execution> | ||
<id>unpack-glassfish</id> | ||
<phase>test-compile</phase> | ||
<goals> | ||
<goal>unpack</goal> | ||
</goals> | ||
<configuration> | ||
<markersDirectory>${glassfish.root}/dependency-maven-plugin-markers</markersDirectory> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>org.glassfish.main.distributions</groupId> | ||
<artifactId>glassfish</artifactId> | ||
<version>${glassfish.version}</version> | ||
<type>zip</type> | ||
<overWrite>false</overWrite> | ||
<outputDirectory>${glassfish.root}</outputDirectory> | ||
</artifactItem> | ||
</artifactItems> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
|
||
<!-- | ||
Run the TCK tests aginst the tck-base-suite.xml file. | ||
Single tests can be run using the regular -Dtest paramater, e.g. | ||
-Dtest=ClaimValueInjectionTest#verifyInjectedAudience | ||
--> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>test</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<dependenciesToScan>org.eclipse.microprofile.jwt:microprofile-jwt-auth-tck</dependenciesToScan> | ||
<suiteXmlFiles> | ||
<suiteXmlFile>${project.build.directory}/tck-suite/suites/tck-base-suite.xml</suiteXmlFile> | ||
</suiteXmlFiles> | ||
|
||
<!-- System Properties --> | ||
<systemPropertyVariables> | ||
<glassfish.home>${glassfish.home}</glassfish.home> | ||
<glassfish.maxHeapSize>2048m</glassfish.maxHeapSize> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
64 changes: 64 additions & 0 deletions
64
...ver/tests/tck/jwt/src/main/java/org/glassfish/microprofile/jwt/tck/WebArchiveUpdater.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright (c) 2022 Contributors to the Eclipse Foundation. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
package org.glassfish.microprofile.jwt.tck; | ||
|
||
import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; | ||
import org.jboss.arquillian.core.spi.LoadableExtension; | ||
import org.jboss.arquillian.test.spi.TestClass; | ||
import org.jboss.shrinkwrap.api.Archive; | ||
import org.jboss.shrinkwrap.api.Node; | ||
import org.jboss.shrinkwrap.api.spec.WebArchive; | ||
|
||
/** | ||
* WebArchiveUpdater updates the web archive that is created by the JWT tests. | ||
* | ||
* <p> | ||
* Specifically it corrects the properties file if needed, and adds glassfish-web.xml for the role | ||
* mapping and context root setting. | ||
* | ||
* @author Arjan Tijms | ||
* | ||
*/ | ||
public class WebArchiveUpdater implements ApplicationArchiveProcessor, LoadableExtension { | ||
|
||
@Override | ||
public void register(ExtensionBuilder extensionBuilder) { | ||
extensionBuilder.service(ApplicationArchiveProcessor.class, WebArchiveUpdater.class); | ||
} | ||
|
||
@Override | ||
public void process(Archive<?> archive, TestClass testClass) { | ||
if (archive instanceof WebArchive webArchive) { | ||
Node metaInfConfig = webArchive.get("/META-INF/microprofile-config.properties"); | ||
|
||
if (metaInfConfig == null) { | ||
if (webArchive.get("/WEB-INF/classes/publicKey.pem") != null) { | ||
webArchive.addAsResource("META-INF/public-key.properties", "META-INF/microprofile-config.properties"); | ||
} else { | ||
webArchive.addAsResource("META-INF/microprofile-config.properties"); | ||
} | ||
} else { | ||
webArchive.addAsResource(metaInfConfig.getAsset(), "META-INF/microprofile-config.properties"); | ||
webArchive.delete("/META-INF/microprofile-config.properties"); | ||
} | ||
|
||
webArchive.addAsWebInfResource("glassfish-web.xml"); | ||
|
||
System.out.printf("WebArchive: %s\n", webArchive.toString(true)); | ||
} | ||
} | ||
|
||
} |
2 changes: 2 additions & 0 deletions
2
appserver/tests/tck/jwt/src/main/resources/META-INF/public-key.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mp.jwt.verify.publickey.location=/publicKey.pem | ||
mp.jwt.verify.issuer=https://server.example.com |
1 change: 1 addition & 0 deletions
1
.../jwt/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.glassfish.microprofile.jwt.tck.WebArchiveUpdater |
Oops, something went wrong.