mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 20:50:44 +00:00
Merge branch 'feature/CTLE-421-migrate-to-use-api-keys' into integration/sprint-25
This commit is contained in:
@ -134,9 +134,10 @@ public class QJavalinImplementation
|
||||
{
|
||||
private static final QLogger LOG = QLogger.getLogger(QJavalinImplementation.class);
|
||||
|
||||
private static final int SESSION_COOKIE_AGE = 60 * 60 * 24;
|
||||
private static final String SESSION_ID_COOKIE_NAME = "sessionId";
|
||||
private static final String BASIC_AUTH_NAME = "basicAuthString";
|
||||
public static final int SESSION_COOKIE_AGE = 60 * 60 * 24;
|
||||
public static final String SESSION_ID_COOKIE_NAME = "sessionId";
|
||||
public static final String BASIC_AUTH_NAME = "basicAuthString";
|
||||
public static final String API_KEY_NAME = "apiKey";
|
||||
|
||||
static QInstance qInstance;
|
||||
static QJavalinMetaData javalinMetaData;
|
||||
@ -422,6 +423,7 @@ public class QJavalinImplementation
|
||||
|
||||
String sessionIdCookieValue = context.cookie(SESSION_ID_COOKIE_NAME);
|
||||
String authorizationHeaderValue = context.header("Authorization");
|
||||
String apiKeyHeaderValue = context.header("x-api-key");
|
||||
|
||||
if(StringUtils.hasContent(sessionIdCookieValue))
|
||||
{
|
||||
@ -430,6 +432,14 @@ public class QJavalinImplementation
|
||||
////////////////////////////////////////
|
||||
authenticationContext.put(SESSION_ID_COOKIE_NAME, sessionIdCookieValue);
|
||||
}
|
||||
else if(apiKeyHeaderValue != null)
|
||||
{
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// next, look for an api key header: //
|
||||
// this will be used to look up auth0 values via an auth table //
|
||||
/////////////////////////////////////////////////////////////////
|
||||
authenticationContext.put(API_KEY_NAME, apiKeyHeaderValue);
|
||||
}
|
||||
else if(authorizationHeaderValue != null)
|
||||
{
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user