summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2023-04-25 20:38:58 +0200
committerGraham Leggett <minfrin@apache.org>2023-04-25 20:38:58 +0200
commitaee4aad725dea2fb23a99f74494eff86a325d2c4 (patch)
treee21a7bec02782d715924db45d73492b3608c2065 /modules
parentRegenerate docs. (diff)
downloadapache2-aee4aad725dea2fb23a99f74494eff86a325d2c4.tar.xz
apache2-aee4aad725dea2fb23a99f74494eff86a325d2c4.zip
The apr_jose API requires apr-util 1.7+.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909416 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/aaa/mod_autht_jwt.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/modules/aaa/mod_autht_jwt.c b/modules/aaa/mod_autht_jwt.c
index ba271a535f..88083f0127 100644
--- a/modules/aaa/mod_autht_jwt.c
+++ b/modules/aaa/mod_autht_jwt.c
@@ -20,6 +20,17 @@
* of JWT bearer tokens, and as an acceptor of JWT Bearer tokens for authentication.
*/
+/* apr_jose support requires >= 1.7 */
+#if APU_MAJOR_VERSION > 1 || \
+ (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION > 6)
+#define HAVE_APU_JOSE 1
+#endif
+
+#include "httpd.h"
+#include "http_config.h"
+
+#ifdef HAVE_APU_JOSE
+
#include "apr_strings.h"
#include "apr_hash.h"
#include "apr_crypto.h"
@@ -30,8 +41,6 @@
#include "apr_want.h"
#include "ap_config.h"
-#include "httpd.h"
-#include "http_config.h"
#include "http_core.h"
#include "http_log.h"
#include "http_protocol.h"
@@ -1087,3 +1096,28 @@ AP_DECLARE_MODULE(autht_jwt) =
auth_bearer_cmds, /* command apr_table_t */
register_hooks /* register hooks */
};
+
+#else
+
+static const command_rec auth_bearer_cmds[] =
+{
+ {NULL}
+};
+
+static void register_hooks(apr_pool_t *p)
+{
+}
+
+AP_DECLARE_MODULE(autht_jwt) =
+{
+ STANDARD20_MODULE_STUFF,
+ NULL, /* dir config creater */
+ NULL, /* dir merger --- default is to override */
+ NULL, /* server config */
+ NULL, /* merge server config */
+ auth_bearer_cmds, /* command apr_table_t */
+ register_hooks /* register hooks */
+};
+
+#endif /* HAVE_APU_JOSE */
+