This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch 4.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/4.1.x by this push:
     new 795aff5  Uncomment Perl routes for /jobs and /jobs/:id (#4684) (#4727)
795aff5 is described below

commit 795aff56f8d28c3958f5b1ae8f05b9f7910fc731
Author: Rawlin Peters <[email protected]>
AuthorDate: Thu May 28 10:14:11 2020 -0600

    Uncomment Perl routes for /jobs and /jobs/:id (#4684) (#4727)
    
    These routes need to be uncommented in the Perl routes in order for us
    to fall back to them via the TO API routing blacklist. Otherwise,
    falling back to these routes causes TO to 404.
    
    (cherry picked from commit 31f9e06324516efd83f0a63c8536ee7f0aacde0c)
---
 CHANGELOG.md                            | 1 +
 traffic_ops/app/lib/TrafficOpsRoutes.pm | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5f8972a..2549765 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -60,6 +60,7 @@ The format is based on [Keep a 
Changelog](http://keepachangelog.com/en/1.0.0/).
 - Fixed issue #4650: add the "Vary: Accept-Encoding" header to all responses 
from Traffic Ops
 - Fixed ORT config generation not using the coalesce_number_v6 Parameter.
 - Removed audit logging from the `POST /api/x/serverchecks` Traffic Ops API 
endpoint in order to reduce audit log spam
+- Fixed the `GET /api/x/jobs` and `GET /api/x/jobs/:id` Traffic Ops API routes 
to allow falling back to Perl via the routing blacklist
 
 ### Deprecated/Removed
 - The Traffic Ops `db/admin.pl` script has now been removed. Please use the 
`db/admin` binary instead.
diff --git a/traffic_ops/app/lib/TrafficOpsRoutes.pm 
b/traffic_ops/app/lib/TrafficOpsRoutes.pm
index de34a73..4d645bd 100644
--- a/traffic_ops/app/lib/TrafficOpsRoutes.pm
+++ b/traffic_ops/app/lib/TrafficOpsRoutes.pm
@@ -660,8 +660,8 @@ sub api_routes {
        $r->post("/api/$version/isos")->over( authenticated => 1, not_ldap => 1 
)->to( 'Iso#generate', namespace => $namespace );
 
        # -- JOBS (CURRENTLY LIMITED TO INVALIDATE CONTENT (PURGE) JOBS)
-       # $r->get("/api/$version/jobs")->over( authenticated => 1, not_ldap => 
1 )->to( 'Job#index', namespace => $namespace );
-       # $r->get("/api/$version/jobs/:id" => [ id => qr/\d+/ ] )->over( 
authenticated => 1, not_ldap => 1 )->to( 'Job#show', namespace => $namespace );
+       $r->get("/api/$version/jobs")->over( authenticated => 1, not_ldap => 1 
)->to( 'Job#index', namespace => $namespace );
+       $r->get("/api/$version/jobs/:id" => [ id => qr/\d+/ ] )->over( 
authenticated => 1, not_ldap => 1 )->to( 'Job#show', namespace => $namespace );
 
        # -- JOBS: CURRENT USER (CURRENTLY LIMITED TO INVALIDATE CONTENT 
(PURGE) JOBS)
        $r->get("/api/$version/user/current/jobs")->over( authenticated => 1, 
not_ldap => 1 )->to( 'Job#get_current_user_jobs', namespace => $namespace );

Reply via email to