Bug 117246

Summary: Create User API
Product: [Retired] Red Hat Network Reporter: Joe deBlaquiere <jadb>
Component: RHN/OtherAssignee: Bret McMillan <bretm>
Status: CLOSED CURRENTRELEASE QA Contact: Bret McMillan <bretm>
Severity: high Docs Contact:
Priority: high    
Version: rhn350CC: rhn-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-03-22 18:46:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 127673    

Description Joe deBlaquiere 2004-03-01 22:51:24 UTC
In setting up sat-demo.rhn.redhat.com it would be very nice to be able
to create user accounts as part of the external management process. 

I would think the parameters would be something like:

uname
passwd
email
use_pam

where passwd is ignored in the case that use_pam is nonzero

Comment 1 Bret McMillan 2004-03-01 23:26:12 UTC
This is already on the api list for the students.

Most likely the params would be uname, first_name, last_name, email,
and password.  use_pam is a function of the satellite/db itself, and
not really a per-user option.

Comment 2 Joe deBlaquiere 2004-03-02 04:11:26 UTC
My understanding from my conversation with Chip was that use_pam is a
per-user option, but only available in satellite environments... and I
can definately see where customers would want to set that flag on
programatically created users. 

Perhaps it should be a global flag for the satellite.


Comment 3 Bret McMillan 2004-03-02 04:40:32 UTC
You're probably right.  I think my brain warped 'pam' into 'encrypted
passwords'.  Dunno why, I blame the influence of solaris particles.

Comment 4 Bret McMillan 2004-03-02 20:52:24 UTC
realigning w/ a more appropriate tracking bug.

Comment 5 Bret McMillan 2004-07-06 23:45:16 UTC
ok, you now have a somewhat fleshed out user api.  whether or not to
use pam can be set w/ user.use_pam_authentication at any time, instead
of just at user creation time.  also, any calls likely to enter crm
hell are now satellite only (pam, create, delete, etc).

user.*:
list_users
use_pam_authentication
get_details
set_details
list_roles
add_role
remove_role
create
delete

Comment 6 Bret McMillan 2004-07-06 23:54:42 UTC
Test plan:

1.  create a satellite
    a) org admin should be 'rhn_api_test'
    b) create a normal user 'rhn_api_test_user' whose real name is
'Bret McMillan'
    c)  register 2 rhel3as boxes, and call them 'api test 1' and 'api
test 2'
2.  go to rhn/web/test on a webcode-enabled machine, and run:

  ./runtests api/user.t

3.  all tests should pass

Comment 7 Matt Jamison 2004-07-16 19:21:42 UTC
I'm a little dense here.  what constitutes a "webcode-enabled machine"

Comment 8 Bret McMillan 2004-07-16 19:28:03 UTC
one of the developer workstations, or webdev.

Comment 9 Fanny Augustin 2004-08-24 14:01:19 UTC
This is more like unit testing...  Could you please run those from
your machine (webQA)?

Comment 10 Bret McMillan 2004-08-24 14:25:38 UTC
tests run against webdev, webqa, and prod, and all passed.

fanny:  let me know what satellite you want me to point at for the
unit tests as well, and i'll run them against that.  If those pass, we
can close out this bug.

Comment 11 Fanny Augustin 2004-08-26 15:59:46 UTC
Please point it to farm02.rhndev.redhat.com (350 sat)/dog8code and
farm03.rhndev.redhat.com (340 sat)/pink4all.



Comment 12 Bret McMillan 2004-09-03 16:34:38 UTC
fails on both, moving to blocking rhn360sat:

RHN::Exception: DBD::Oracle::st execute failed: ORA-01400: cannot
insert NULL into
("RHNSAT"."WEB_USER_PERSONAL_INFO"."PREFIX")!ORA-06512: at
"RHNSAT.CREATE_NEW_USER", line 48!ORA-06512: at line 2 (DBD ERROR:
OCIStmtExecute) [for Statement "BEGIN!  :user_id :=
CREATE_NEW_USER(org_id_in => :org_id, login_in => :login, password_in
=> :password,!          oracle_contact_id_in => :oracle_contact_id,
prefix_in => :prefix,!                              first_names_in =>
:first_names, last_name_in => :last_name, genqual_in => :genqual,!   
                          parent_company_in => :parent_company,
company_in => :company, title_in => :title,!                         
    phone_in => :phone, fax_in => :fax, email_in => :email, pin_in =>
:pin,!                              first_names_ol_in =>
:first_names_ol, last_name_ol_in => :last_name_ol,!                  
           address1_in => :address1, address2_in => :address2,
address3_in => :address3,!                              city_in =>
:city, state_in => :state, zip_in => :zip, country_in => :country,!  
                           alt_first_names_in => :alt_first_names,
alt_last_name_in => :alt_last_name,!                  contact_call_in
=> :contact_call,!                              contact_mail_in =>
:contact_mail,!                          contact_email_in =>
:contact_email,!                              contact_fax_in =>
:contact_fax);!END;!"

Comment 13 Bret McMillan 2004-10-04 15:37:44 UTC
ok, now giving ' ' as the prefix for an api created user... can be
changed w/ other calls

Test Plan:
Run the web unit tests pointed at a satellite.  See bretm w/ any
questions.

Comment 14 Todd Warner 2004-10-21 16:48:50 UTC
QA push. {ON_DEV,QA_READY} --> ON_QA

Comment 15 Vlady Zlatkin 2004-10-28 13:18:46 UTC
Bret,

Can you test this 360 satellite: rhnblade4?  I have all the things
described in the test plan set up, although the two RHEL3 machines are
the same machine registered twice.

user:rhn_api_test
pass:rhn_api_test

Comment 16 Fanny Augustin 2004-11-18 21:17:05 UTC
Bret could you please take charge of this bug?  It looks like you just
have to run some unit tests agains a 360 sat.  Please use:

farm02.rhndev.redhat.com
regular password

Comment 17 Todd Warner 2004-12-01 11:40:15 UTC
Bret. FAILS_QA. You need a detailed docs description for this. If not
a priority then skip it.

Comment 18 Bret McMillan 2004-12-02 19:17:36 UTC
farm02.rhndev.redhat.com is gone, unit tests passed on
rlx-3-14.rhndev.redhat.com.

Documentation for the functionality is at /rpc/api/user/

I do not think it is necessary to do any more documentation other than
note the new calls and whether they are satellite specific in the
release notes:

list_users
use_pam_authentication (satellite only)
get_details
set_details
list_roles
add_role
remove_role
create (satellite only)
delete (satellite only)



Comment 19 Todd Warner 2005-03-22 18:46:12 UTC
Mass move from PROD_READY to CLOSED:CURRENTRELEASE