Project

General

Profile

Actions

Bug #27542

closed

/katello/api/srpms does not gives error on undefined parameter

Added by Vijay Singh over 4 years ago. Updated over 4 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
Category:
Repositories
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

/katello/api/srpms does not gives error on undefined parameter

Steps:

1. Create a yum repo.
2. Upload SRPM into that.
3. Try to list SRPM (i.e. here I am trying to list organization wise) and same happens for organization_id/repository_id/environment_id prams too.

a. When passing correct param(organization_id):

[vagrant@srpm-centos7-hammer-devel ~]$ curl --header "Accept:application/json,version=2" --header "Content-Type:application/json" --request GET --insecure --user admin:changeme https://srpm-centos7-katello-devel.vijsingh.example.com/katello/api/srpms --data "{\"organization_id\":[5]}"|python -m json.tool|grep nvr
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100   772    0   749  100    23   1922     59 --:--:-- --:--:-- --:--:--  1920
"nvra": "sasutils-0.3.9-2.el7.src", 
"nvra": "SDL2_net-2.0.1-2.el7.src",

b. When passing incorrect params(organization_id1) then it does not gives the error i.e. undefined param or method.

[vagrant@srpm-centos7-hammer-devel ~]$ curl --header "Accept:application/json,version=2" --header "Content-Type:application/json" --request GET --insecure --user admin:changeme https://srpm-centos7-katello-devel.vijsingh.example.com/katello/api/srpms --data "{\"organization_id1\":[5]}"|python -m json.tool|grep nvr
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100  1468    0  1444  100    24   3450     57 --:--:-- --:--:-- --:--:--  3446
"nvra": "sasutils-0.3.9-2.el7.src",
"nvra": "SDL2_net-2.0.1-2.el7.src",
"nvra": "viewvc-1.1.26-1.el7.src",
"nvra": "VMDKstream-0.3-1.el7.src",

Related issues 2 (2 open0 closed)

Related to Katello - Tracker #27539: [Tracker] SRPM IssuesNew

Actions
Is duplicate of Foreman - Feature #22285: Present error message when passing integer when array expected for API callNewTomer BriskerActions
Actions #1

Updated by Vijay Singh over 4 years ago

Actions #2

Updated by Chris Roberts over 4 years ago

  • Target version set to Katello 3.14.0
  • Triaged changed from No to Yes
Actions #3

Updated by Ian Ballou over 4 years ago

  • Assignee changed from Chris Roberts to Ian Ballou
Actions #4

Updated by Ian Ballou over 4 years ago

This is actually an issue with the Foreman API in general. Currently we don't use Rails strong_parameters, and it takes a bit of effort to switch over to using them. I'm setting this as a duplicate of https://projects.theforeman.org/issues/22285.

Actions #5

Updated by Ian Ballou over 4 years ago

  • Status changed from New to Duplicate
Actions #6

Updated by Ian Ballou over 4 years ago

  • Is duplicate of Feature #22285: Present error message when passing integer when array expected for API call added
Actions

Also available in: Atom PDF