[DEBUG] missing remove a last element of Zota

This commit is contained in:
Edouard DUPIN 2024-01-18 23:40:33 +01:00
parent 808784889b
commit 1a2302f548
4 changed files with 46 additions and 46 deletions

View File

@ -25,7 +25,7 @@
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>

View File

@ -84,7 +84,6 @@ Reformat XML file like the pom.xml
XMLLINT_INDENT=" " xmllint --format "back/pom.xml" -o "back/pom.xml" XMLLINT_INDENT=" " xmllint --format "back/pom.xml" -o "back/pom.xml"
``` ```
Enable the pre-commit checker Enable the pre-commit checker
----------------------------- -----------------------------
@ -94,6 +93,8 @@ Enable the pre-commit checker
> **_Note_**: You can change the code in `.git/hooks/pre-commit` by replacing `formatter:verify` with `formatter:format` to auto format the code @ every commit > **_Note_**: You can change the code in `.git/hooks/pre-commit` by replacing `formatter:verify` with `formatter:format` to auto format the code @ every commit
Add Gitea in the dependency for the registry: Add Gitea in the dependency for the registry:
============================================= =============================================

View File

@ -43,8 +43,8 @@ public class AuthenticationFilter implements ContainerRequestFilter {
private ResourceInfo resourceInfo; private ResourceInfo resourceInfo;
protected final String applicationName; protected final String applicationName;
private static final String AUTHENTICATION_SCHEME = "Bearer"; public static final String AUTHENTICATION_SCHEME = "Bearer";
private static final String APIKEY = "ApiKey"; public static final String APIKEY = "ApiKey";
public AuthenticationFilter(final String applicationName) { public AuthenticationFilter(final String applicationName) {
this.applicationName = applicationName; this.applicationName = applicationName;

View File

@ -11,6 +11,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import org.kar.archidata.filter.AuthenticationFilter;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -64,7 +65,7 @@ class TestSigner implements JWSSigner {
public class JWTWrapper { public class JWTWrapper {
static final Logger LOGGER = LoggerFactory.getLogger(JWTWrapper.class); static final Logger LOGGER = LoggerFactory.getLogger(JWTWrapper.class);
private static RSAKey rsaJWK = null;; private static RSAKey rsaJWK = null;
private static RSAKey rsaPublicJWK = null; private static RSAKey rsaPublicJWK = null;
public static class PublicKey { public static class PublicKey {
@ -89,7 +90,7 @@ public class JWTWrapper {
con.setRequestProperty("Accept", "application/json"); con.setRequestProperty("Accept", "application/json");
final String ssoToken = ConfigBaseVariable.ssoToken(); final String ssoToken = ConfigBaseVariable.ssoToken();
if (ssoToken != null) { if (ssoToken != null) {
con.setRequestProperty("Authorization", "Zota " + ssoToken); con.setRequestProperty(AuthenticationFilter.APIKEY, ssoToken);
} }
final int responseCode = con.getResponseCode(); final int responseCode = con.getResponseCode();
@ -244,9 +245,7 @@ public class JWTWrapper {
// LOGGER.debug("JWT token is verified 'alice' =?= '" + signedJWT.getJWTClaimsSet().getSubject() + "'"); // LOGGER.debug("JWT token is verified 'alice' =?= '" + signedJWT.getJWTClaimsSet().getSubject() + "'");
// LOGGER.debug("JWT token isuer 'https://c2id.com' =?= '" + signedJWT.getJWTClaimsSet().getIssuer() + "'"); // LOGGER.debug("JWT token isuer 'https://c2id.com' =?= '" + signedJWT.getJWTClaimsSet().getIssuer() + "'");
return signedJWT.getJWTClaimsSet(); return signedJWT.getJWTClaimsSet();
} catch (final JOSEException ex) { } catch (final JOSEException | ParseException e) {
ex.printStackTrace();
} catch (final ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;