Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1252085

Summary: [RFE] Validation of username in ovirt-shell
Product: [Retired] oVirt Reporter: jniederm
Component: ovirt-engine-cliAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED NOTABUG QA Contact: Pavel Stehlik <pstehlik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.6CC: amureini, bugs, ecohen, gklein, lsurette, oourfali, rbalakri, yeylon
Target Milestone: ---Keywords: Improvement
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-17 15:20:22 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 jniederm 2015-08-10 16:43:58 UTC
Description of problem:
Usually users first meet webadmin/userportal and then ovirt shell. Thus they can be used to think of username as of string like 'admin' (this form is show in upper right corner of webadmin and used to logging in to webadmin) rather than 'admin@internal'
I would be nice if ovirt shell can validate user name 'admin' and suggest that maybe '@domain' suffix was not entered.

Alternatively all references to "username" can be replaced by "username@domain".

Current state 'username' in context of web UIs is 'admin' and 'username' in context of ovirt-shell is 'admin@internal' may seem a bit misleading.

Comment 1 Oved Ourfali 2015-08-12 05:40:12 UTC
There might be multiple domains, and the ovirt-shell isn't aware of that.
The only thing I'd consider doing is that in case the login fails, and the username indeed doesn't have "@" in it, to add to the failed login message also the note that you might have forgotten that (added by the ovirt-shell)

However, not sure localization is supported in the ovirt-shell.
I'll give the stage to Juan to share his thoughts.

Comment 2 Juan Hernández 2015-08-17 15:20:22 UTC
The structure of the user names is completely outside the control of the CLI, thus the CLI can't make any assumption or validation of them.

The CLI doesn't support localization, and it doesn't support explicit messages when authentication fails either, it just displays the error message returned by the server, for example:

  # ovirt-shell -I -l https://.../ovirt-engine/api -u wronguser
  Password: ******
  ======= ERROR ======
  [401] - Unauthorized
  ====================

The only thing that the CLI can do is include some documentation, and we already do so:

  [oVirt shell (disconnected)]# help connect
  ...
  ARGUMENTS
     * url    - ...
     * [user] - The user to connect as. (user@domain).