TeslaGov / ngx-http-auth-jwt-module

Secure your NGINX locations with JWT
MIT License
322 stars 123 forks source link

Nginx v1.27.1 support #138

Open kautkata opened 1 month ago

kautkata commented 1 month ago

To me it seems that nging V1.27.1 isn't supported.

Build env: Ubuntu 22.04.3 LTS

Steps to repoduce:

  1. apt-get install libxml2-dev libxml++2.6-dev libxslt1-dev libgeoip-dev autoconf libjwt-dev libjansson-dev
  2. git clone https://github.com/TeslaGov/ngx-http-auth-jwt-module.git --branch 2.2.0 nginx-http-auth-jwt
  3. git clone https://github.com/nginx/nginx.git --branch release-1.27.1 nginx-core
  4. cd nginx-core
  5. ./auto/configure --prefix=/srv/nginx-1.27.1 --user=nginx --group=nginx --build=poop13 \ --add-module=./../nginx-http-auth-jwt \ --http-client-body-temp-path=/srv/nginx-temp/client-body --http-proxy-temp-path=/srv/nginx-temp/proxy \ --http-fastcgi-temp-path=/srv/nginx-temp/fastcgi --http-uwsgi-temp-path=/srv/nginx-temp/uwsgi \ --http-scgi-temp-path=/srv/nginx-temp/scgi \ --with-compat --with-select_module --with-poll_module --with-threads --with-file-aio \ --with-http_ssl_module --with-http_v2_module --with-http_v3_module --with-http_realip_module \ --with-http_addition_module --with-http_xslt_module=dynamic --with-mail=dynamic --with-stream=dynamic \ --with-stream_ssl_module --with-stream_realip_module --with-stream_geoip_module=dynamic \ --with-stream_ssl_preread_module --with-http_geoip_module --with-http_sub_module --with-http_gunzip_module \ --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module \ --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module \ --with-http_stub_status_module \ --with-compat
  6. make -j 10
build fails with `./../nginx-http-auth-jwt/src/ngx_http_auth_jwt_module.c: In function ‘get_jwt’: ./../nginx-http-auth-jwt/src/ngx_http_auth_jwt_module.c:657:58: error: ‘ngx_http_headers_in_t’ has no member named ‘cookies’; did you mean ‘cookie’? 657 if (ngx_http_parse_multi_header_lines(&r->headers_in.cookies, &jwt_location, &jwtCookieVal) != NGX_DECLINED) ^~~ cookie ./../nginx-http-auth-jwt/src/ngx_http_auth_jwt_module.c:657:67: error: passing argument 2 of ‘ngx_http_parse_multi_header_lines’ from incompatible pointer type [-Werror=incompatible-pointer-types] 657 if (ngx_http_parse_multi_header_lines(&r->headers_in.cookies, &jwt_location, &jwtCookieVal) != NGX_DECLINED) ^~~~~
ngx_str_t *

In file included from ./../nginx-http-auth-jwt/src/ngx_http_auth_jwt_module.c:12: src/http/ngx_http.h:112:22: note: expected ‘ngx_table_elt_t ’ {aka ‘struct ngx_table_elt_s ’} but argument is of type ‘ngx_str_t ’ 112 | ngx_table_elt_t headers, ngx_str_t name, ngx_str_t value); | ~~~^~~~~ ./../nginx-http-auth-jwt/src/ngx_http_auth_jwt_module.c:657:9: error: too few arguments to function ‘ngx_http_parse_multi_header_lines’ 657 | if (ngx_http_parse_multi_header_lines(&r->headers_in.cookies, &jwt_location, &jwtCookieVal) != NGX_DECLINED) | ^~~~~~~~~ In file included from ./../nginx-http-auth-jwt/src/ngx_http_auth_jwt_module.c:12: src/http/ngx_http.h:111:18: note: declared here 111 | ngx_table_elt_t ngx_http_parse_multi_header_lines(ngx_http_request_t r, | ^~~~~~~~~ cc1: all warnings being treated as errors make[1]: [objs/Makefile:1790: objs/addon/src/ngx_http_auth_jwt_module.o] Error 1 make[1]: Waiting for unfinished jobs.... make[1]: Leaving directory '/work/build/nginx-core' make: *** [Makefile:10: build] Error 2`

kautkata commented 1 month ago

fix was adding - --with-cc-opt='-DNGX_LINKED_LIST_COOKIES=1' might help others out