You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2023/04/25 18:38:58 UTC
svn commit: r1909416 - /httpd/httpd/trunk/modules/aaa/mod_autht_jwt.c
Author: minfrin
Date: Tue Apr 25 18:38:58 2023
New Revision: 1909416
URL: http://svn.apache.org/viewvc?rev=1909416&view=rev
Log:
The apr_jose API requires apr-util 1.7+.
Modified:
httpd/httpd/trunk/modules/aaa/mod_autht_jwt.c
Modified: httpd/httpd/trunk/modules/aaa/mod_autht_jwt.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_autht_jwt.c?rev=1909416&r1=1909415&r2=1909416&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_autht_jwt.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_autht_jwt.c Tue Apr 25 18:38:58 2023
@@ -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 */
+