From 04cddb8d5de7e89289cbea7f3775b4c2fa9be34a Mon Sep 17 00:00:00 2001 From: Tim Chamberlain Date: Thu, 15 Dec 2022 15:34:43 -0600 Subject: [PATCH 1/4] Updating to 0.9.0 --- qqq-dev-tools/CURRENT-SNAPSHOT-VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qqq-dev-tools/CURRENT-SNAPSHOT-VERSION b/qqq-dev-tools/CURRENT-SNAPSHOT-VERSION index ac39a106..718b60b8 100644 --- a/qqq-dev-tools/CURRENT-SNAPSHOT-VERSION +++ b/qqq-dev-tools/CURRENT-SNAPSHOT-VERSION @@ -1 +1 @@ -0.9.0 +0.9.0 From a37d22b0d01feb28f8e4f765888aa2efd0e2cd54 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Fri, 13 Jan 2023 14:13:21 -0600 Subject: [PATCH 2/4] Update export to work off post; add check for Authorization as a form param --- .../javalin/QJavalinImplementation.java | 54 +++++++++++++------ 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/qqq-middleware-javalin/src/main/java/com/kingsrook/qqq/backend/javalin/QJavalinImplementation.java b/qqq-middleware-javalin/src/main/java/com/kingsrook/qqq/backend/javalin/QJavalinImplementation.java index a0b302d0..0d913249 100644 --- a/qqq-middleware-javalin/src/main/java/com/kingsrook/qqq/backend/javalin/QJavalinImplementation.java +++ b/qqq-middleware-javalin/src/main/java/com/kingsrook/qqq/backend/javalin/QJavalinImplementation.java @@ -292,7 +292,9 @@ public class QJavalinImplementation get("/count", QJavalinImplementation::dataCount); post("/count", QJavalinImplementation::dataCount); get("/export", QJavalinImplementation::dataExportWithoutFilename); + post("/export", QJavalinImplementation::dataExportWithoutFilename); get("/export/{filename}", QJavalinImplementation::dataExportWithFilename); + post("/export/{filename}", QJavalinImplementation::dataExportWithFilename); get("/possibleValues/{fieldName}", QJavalinImplementation::possibleValues); // todo - add put and/or patch at this level (without a primaryKey) to do a bulk update based on primaryKeys in the records. @@ -357,26 +359,19 @@ public class QJavalinImplementation // either with a "Basic " prefix (for a username:password pair) // // or with a "Bearer " prefix (for a token that can be handled the same as a sessionId cookie) // ///////////////////////////////////////////////////////////////////////////////////////////////// - String basicPrefix = "Basic "; - String bearerPrefix = "Bearer "; - if(authorizationHeaderValue.startsWith(basicPrefix)) - { - authorizationHeaderValue = authorizationHeaderValue.replaceFirst(basicPrefix, ""); - authenticationContext.put(BASIC_AUTH_NAME, authorizationHeaderValue); - } - else if(authorizationHeaderValue.startsWith(bearerPrefix)) - { - authorizationHeaderValue = authorizationHeaderValue.replaceFirst(bearerPrefix, ""); - authenticationContext.put(SESSION_ID_COOKIE_NAME, authorizationHeaderValue); - } - else - { - LOG.debug("Authorization header value did not have Basic or Bearer prefix. [" + authorizationHeaderValue + "]"); - } + processAuthorizationValue(authenticationContext, authorizationHeaderValue); } else { - LOG.debug("Neither [" + SESSION_ID_COOKIE_NAME + "] cookie nor [Authorization] header was present in request."); + String authorizationFormValue = context.formParam("Authorization"); + if(StringUtils.hasContent(authorizationFormValue)) + { + processAuthorizationValue(authenticationContext, authorizationFormValue); + } + else + { + LOG.debug("Neither [" + SESSION_ID_COOKIE_NAME + "] cookie nor [Authorization] header was present in request."); + } } QSession session = authenticationModule.createSession(qInstance, authenticationContext); @@ -408,6 +403,31 @@ public class QJavalinImplementation + /******************************************************************************* + ** + *******************************************************************************/ + private static void processAuthorizationValue(Map authenticationContext, String authorizationHeaderValue) + { + String basicPrefix = "Basic "; + String bearerPrefix = "Bearer "; + if(authorizationHeaderValue.startsWith(basicPrefix)) + { + authorizationHeaderValue = authorizationHeaderValue.replaceFirst(basicPrefix, ""); + authenticationContext.put(BASIC_AUTH_NAME, authorizationHeaderValue); + } + else if(authorizationHeaderValue.startsWith(bearerPrefix)) + { + authorizationHeaderValue = authorizationHeaderValue.replaceFirst(bearerPrefix, ""); + authenticationContext.put(SESSION_ID_COOKIE_NAME, authorizationHeaderValue); + } + else + { + LOG.debug("Authorization value did not have Basic or Bearer prefix. [" + authorizationHeaderValue + "]"); + } + } + + + /******************************************************************************* ** *******************************************************************************/ From a35e30059c4221c55d56b1d94b1ce0719a6c252b Mon Sep 17 00:00:00 2001 From: Tim Chamberlain Date: Fri, 13 Jan 2023 15:36:05 -0600 Subject: [PATCH 3/4] Update versions for release --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4a9db165..7ef488a2 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ - 0.10.0-SNAPSHOT + 0.10.0 UTF-8 UTF-8 From 680696491f7881029c4df6192aabbdbede414f0d Mon Sep 17 00:00:00 2001 From: Tim Chamberlain Date: Fri, 13 Jan 2023 15:36:06 -0600 Subject: [PATCH 4/4] Update for next development version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7ef488a2..2660d336 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ - 0.10.0 + 0.11.0-SNAPSHOT UTF-8 UTF-8