Skip to content

Commit

Permalink
Updated shared module name to follow recommended naming (without vers…
Browse files Browse the repository at this point in the history
…ion because NGINX Makefile can't deal with version numbers that include periods)
  • Loading branch information
travisspencer committed Feb 15, 2018
1 parent 5ef9c71 commit 6e53746
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions config
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
addon_base_name=phantom_token
ngx_addon_name=${addon_base_name}_module
protocol=http
company_name=curity
ngx_addon_name=ngx_${company_name}_${protocol}_${addon_base_name}_module

if test -n "$ngx_module_link"; then
ngx_module_type=HTTP
Expand All @@ -9,5 +11,5 @@ if test -n "$ngx_module_link"; then
. auto/module
else
HTTP_MODULES="$HTTP_MODULES $ngx_addon_name"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/$ngx_addon_name.c"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/$addon_base_name.c"
fi
8 changes: 4 additions & 4 deletions phantom_token.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static ngx_http_module_t phantom_token_module_context =
};

/* Module definition. */
ngx_module_t phantom_token_module =
ngx_module_t ngx_curity_http_phantom_token_module =
{
NGX_MODULE_V1,
&phantom_token_module_context,
Expand Down Expand Up @@ -224,7 +224,7 @@ static ngx_int_t set_accept_header_value(ngx_http_request_t *request, const char
static ngx_int_t handler(ngx_http_request_t *request)
{
phantom_token_configuration_t *module_location_config = ngx_http_get_module_loc_conf(
request, phantom_token_module);
request, ngx_curity_http_phantom_token_module);

// Return OK if the module is not active
if (!module_location_config->enable)
Expand Down Expand Up @@ -254,7 +254,7 @@ static ngx_int_t handler(ngx_http_request_t *request)
return NGX_DECLINED;
}

phantom_token_module_context_t *module_context = ngx_http_get_module_ctx(request, phantom_token_module);
phantom_token_module_context_t *module_context = ngx_http_get_module_ctx(request, ngx_curity_http_phantom_token_module);

if (module_context != NULL)
{
Expand Down Expand Up @@ -492,7 +492,7 @@ static ngx_int_t handler(ngx_http_request_t *request)
introspection_request->headers_in.authorization->value.data = authorization_header_data;
introspection_request->headers_in.authorization->value.len = authorization_header_data_len;

ngx_http_set_ctx(request, module_context, phantom_token_module);
ngx_http_set_ctx(request, module_context, ngx_curity_http_phantom_token_module);

return NGX_AGAIN;
}
Expand Down

0 comments on commit 6e53746

Please sign in to comment.