Bug 2180568 - `hammer host-registration generate-command` doesn't accept `unlimited` as JWT life time
Summary: `hammer host-registration generate-command` doesn't accept `unlimited` as JWT...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Registration
Version: 6.13.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
: 2228192 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-21 19:37 UTC by Pablo Mendez Hernandez
Modified: 2023-08-03 00:31 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SAT-16950 0 None None None 2023-04-04 08:28:02 UTC

Description Pablo Mendez Hernandez 2023-03-21 19:37:51 UTC
Description of problem:

When trying to create a host-registration script with an unlimited life time using hammer, it complains about the parameter not being numeric (it's possible to set that generate that same script with unlimited life time through the web UI):

```
# hammer host-registration generate-command --organization-id 1 --activation-key $AK --jwt-expiration unlimited --insecure true --force true
Failed to generate registration command:
  Error: Option '--jwt-expiration': Numeric value is required..
  
  See: 'hammer host-registration generate-command --help'.
```

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

Satellite 6.13 Snap 15


How reproducible:

Always.


Steps to Reproduce:
1.
2.
3.


Actual results:

Host registration command is not generated.


Expected results:

Host registration command should be generated with an unlimited JWT life time.


Additional info:

Comment 1 Ron Lavi 2023-04-04 08:27:29 UTC
I made this an RFE, to propose the support of `unlimited` token expiration option also in Hammer and also API

Comment 3 Leos Stejskal 2023-08-02 08:10:51 UTC
*** Bug 2228192 has been marked as a duplicate of this bug. ***

Comment 4 Sayan Das 2023-08-02 08:41:53 UTC
An important point to add ( mentioned in dup BZ# 2228192 )  is that when we use the API, it accepts "unlimited" as a valid value ( same as UI ). But it seems it's just the hammer with some validation in place which would not accept anything except a numerical value.


Note You need to log in before you can comment on or make changes to this bug.