Bug 1895976

Summary: Hammer Allows Invalid Release Version to be Set on Activation Key
Product: Red Hat Satellite Reporter: myoder
Component: Activation KeysAssignee: Lucy Fu <lufu>
Status: CLOSED ERRATA QA Contact: Cole Higgins <chiggins>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.8.0CC: bbuckingham, chrobert, paji, pcreech, zhunting
Target Milestone: 6.13.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-4.7.0.12-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-03 13:20:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description myoder 2020-11-09 15:06:00 UTC
Description of problem:

Using the hammer command to create or update an activation key, users can input invalid release versions (any string is accepted).  This causes issues when hosts try and register.  It can be difficult to spot if an admin uses "7server" instead of "7Server" in a script.  The "7server" will be used in the pathway for the repository url on the content host, and will give 404 errors.

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

How reproducible:
always

Steps to Reproduce:
1. Create an activation key with hammer command:

  # hammer activation-key create --name=testing --release-version="thisshouldntwork" --organization-id=1 --lifecycle-environment-id=1 --content-view-id=1

2. Or update with hammer:

  # hammer activation-key update --id=1 --release-version="butitdoes" --organization-id=1

Actual results:
Activation key is created with an invalid release version.

Expected results:
The API should verify if the release version is valid.

Additional info:

Comment 3 Lucy Fu 2022-07-18 18:14:49 UTC
Created redmine issue https://projects.theforeman.org/issues/35236 from this bug

Comment 4 Bryan Kearney 2022-07-19 16:02:49 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35236 has been resolved.

Comment 12 errata-xmlrpc 2023-05-03 13:20:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.13 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:2097