Commit ac7be123 authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Merge branch 'OCF198-nginx-must-be-reviewed' into 'staging'

Resolve "NGINX must be reviewed"

See merge request !169
parents 9b24ee56 ea105112
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -120,7 +120,7 @@ for name, pkg in package_paths.items():
        openapi_file,             # relative to specification_dir (SERVICES_DIR)
        openapi_file,             # relative to specification_dir (SERVICES_DIR)
        arguments={"title": title},
        arguments={"title": title},
        pythonic_params=True,
        pythonic_params=True,
        base_path=base_path
        base_path="/helper/" + base_path
    )
    )




+3 −0
Original line number Original line Diff line number Diff line
@@ -9,6 +9,9 @@ RUN mkdir -p /etc/nginx/certs


COPY ./certs/sign_req_body_tmp.json /etc/nginx/certs/sign_req_body_tmp.json
COPY ./certs/sign_req_body_tmp.json /etc/nginx/certs/sign_req_body_tmp.json
COPY ./nginx.conf /etc/nginx/nginx.conf
COPY ./nginx.conf /etc/nginx/nginx.conf
COPY ./endpoints /etc/nginx/endpoints
COPY ./maps /etc/nginx/maps
COPY ./policies /etc/nginx/policies
COPY ./nginx_prepare.sh .
COPY ./nginx_prepare.sh .


RUN chmod a+x nginx_prepare.sh
RUN chmod a+x nginx_prepare.sh
+40 −0
Original line number Original line Diff line number Diff line
map $uri $endpoint {
    default "NO MATCH";

    # Exact matches for endpoints that require specific handling (Must be on top of the regex matches)
    /api-invoker-management/v1/onboardedInvokers invoker_onboarding_exact;
    /api-provider-management/v1/registrations provider_registrations_exact;
    /service-apis/v1/allServiceAPIs discover_service_exact;

    # Regex matches for endpoints that can be grouped by common patterns
    # Helper related endpoints
    ~^/helper/ helper_base_tree;

    # Invoker management related endpoints
    ~^/api-invoker-management/v1/onboardedInvokers/ invoker_onboarding_tree;

    # Provider management related endpoints
    ~^/api-provider-management/v1/registrations/ provider_registrations_tree;
    
    # Published APIs related endpoints
    ~^/published-apis/v1/ published_apis_tree;

    # Logging related endpoints
    ~^/api-invocation-logs/v1/ logging_tree;
    
    # Auditing related endpoints
    ~^/logs/v1/ auditing_tree;

    # Security related endpoints
    ~^/capif-security/v1/trustedInvokers/.+/update  security_update;
    ~^/capif-security/v1/trustedInvokers/.+/delete  security_delete;
    ~^/capif-security/v1/trustedInvokers/.+  security_trusted_invokers_exact;
    ~^/capif-security/v1/securities/.+/token  security_token;
    ~^/capif-security/v1/  security_tree;

    # Events related endpoints
    ~^/capif-events/v1/  events_tree;

    # Access control policy related endpoints
    ~^/access-control-policy/v1/  acl_tree;
}
+13 −0
Original line number Original line Diff line number Diff line
map $uri $service {
    default "";
    ~^/helper(/|$)  helper;
    ~^/api-invoker-management(/|$)  invoker-management;
    ~^/api-provider-management(/|$)  provider-management;
    ~^/service-apis(/|$)  discover-service;
    ~^/published-apis(/|$)  publish-service;
    ~^/api-invocation-logs(/|$)  logging-service;
    ~^/logs(/|$)  auditing-service;
    ~^/capif-security(/|$)  security-service;
    ~^/capif-events(/|$)  events-service;
    ~^/access-control-policy(/|$)  access-control-policy;
}
+8 −0
Original line number Original line Diff line number Diff line
map $request_method $method {
    default OTHER;
    GET     GET;
    POST    POST;
    PUT     PUT;
    DELETE  DELETE;
    PATCH   PATCH;
}
Loading