pki-bot / pki-issues-final

0 stars 0 forks source link

No validation on status while add tps-connector-add #2743

Open pki-bot opened 3 years ago

pki-bot commented 3 years ago

This issue was migrated from Pagure Issue #3194. Originally filed by dmoluguw (@SilleBille) on 2020-07-14 17:09:13:


Description of problem:

While adding tps connector using tps-connector-add cli obseve that there is no validation on status cli which create further problem while enable,disable and deleting the connector.

Version-Release number of selected component (if applicable):

[root@pki1 ~]# rpm -qi pki-tps
Name        : pki-tps
Version     : 10.5.9
Release     : 10.el7pki
Architecture: x86_64
Install Date: Monday 31 December 2018 01:03:33 AM EST
Group       : System Environment/Daemons
Size        : 1852506
License     : GPLv2
Signature   : RSA/SHA256, Monday 17 December 2018 08:41:13 PM EST, Key ID 199e2f91fd431d51
Source RPM  : pki-core-10.5.9-10.el7pki.src.rpm
Build Date  : Monday 17 December 2018 08:05:23 PM EST
Build Host  : x86-037.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor      : Red Hat, Inc.
URL         : http://pki.fedoraproject.org/
Summary     : Certificate System - Token Processing Service

How reproducible:

# pki -d /opt/pki/certdb/ -c secret -p 25080 -n "TPS_AdminV" tps-connector-add --input tpsconnadd.xml
-----------------------
Added connector "test2"
-----------------------
  Connector ID: test2
  Status: abcEnabledxyz
  Properties:
    tps.connector.test2.enable: true
    tps.connector.test2.host: server.example.com
    tps.connector.test2.maxHttpConns: 15
    tps.connector.test2.minHttpConns: 1
    tps.connector.test2.nickName: subsystemCert cert-pki-tomcat
    tps.connector.test2.port: 8443
    tps.connector.test2.timeout: 30
    tps.connector.test2.uri.enrollment: /ca/ee/ca/profileSubmitSSLClient
    tps.connector.test2.uri.getcert: /ca/ee/ca/displayBySerial
    tps.connector.test2.uri.renewal: /ca/ee/ca/profileSubmitSSLClient
    tps.connector.test2.uri.revoke: /ca/ee/subsystem/ca/doRevoke
    tps.connector.test2.uri.unrevoke: /ca/ee/subsystem/ca/doUnrevoke

# pki -d /opt/pki/certdb/ -c secret -p 25080 -n "TPS_AdminV" tps-connector-mod test2 --action disable
BadRequestException: Invalid connector status: abcEnabledxyz

# pki -d /opt/pki/certdb/ -c secret -p 25080 -n "TPS_AdminV" tps-connector-mod test2 --action enable
BadRequestException: Invalid connector status: abcEnabledxyz

# pki -d /opt/pki/certdb/ -c secret -p 25080 -n "TPS_AdminV" tps-connector-del test2
ForbiddenException: Unable to delete connector test2; connector not disabled

Steps to Reproduce:

1.# pki -d /opt/pki/certdb/ -c secret -p 25080 -n "TPS_AdminV" tps-connector-add --input tpsconnadd.xml
2.# pki -d /opt/pki/certdb/ -c secret -p 25080 -n "TPS_AdminV" tps-connector-mod test2 --action disable
3.# pki -d /opt/pki/certdb/ -c secret -p 25080 -n "TPS_AdminV" tps-connector-mod test2 --action enable

Actual results:

Success with wrong paramter

Expected results:

Should failed with error

pki-bot commented 3 years ago

Comment from dmoluguw (@SilleBille) at 2020-07-14 17:09:25

Metadata Update from @SilleBille: