12 Commits

Author SHA1 Message Date
Dean Troyer
0719348ba1 TODO cleanup: osc-lib
osc-lib 1.3.0 is released, which contains these functions that still
need to be migrated all the way down to os-client-config.

Currently osc-lib 1.2.0 is in global-requirements so this can not be
merged yet, but is included here for testing and to be ready for when
g-r is unfrozen.

Change-Id: I7bc8ed6cf78f38bab4a718ed3e2a88641fa23f27
2017-02-20 17:35:42 +00:00
Anh Tran
1e3faf9f64 Remove unused logging import
Change-Id: I9edf4075ffea2e8d42283bd654b74cd4ab4a3638
2017-02-20 10:20:42 +07:00
Dean Troyer
eea09faae2 TODO cleanup: OSC_Config
os-client-config is now at 1.22.0 in global-requirements, we can remove
this pw_func setting block as the pw_func arg to __init__() was added
in 1.21.0.

Change-Id: I5bbc3e3aae4f3e4c4333c73bba19bda65e0d8488
2017-02-01 17:31:39 -06:00
Dean Troyer
c6aceb78b7 Remove unneeded methods from OS_Config class
These are in the minimum required version of osc-lib (1.2.0).

A few methods remain that need to be released in osc-lib, expect them
in the 1.3.0 release soon.

Change-Id: I2333946da9a73e73377b646e4c06e99597990945
2017-01-04 11:43:30 -06:00
Boris Bobrov
e51a8d6374 Use project_domain_id only in password auth
The method being changed constructs domain-related parameters that will
further be passed to the auth plugin. If project domain is not
passed, the method sets it to the default domain.

token_endpoint does not expect any information about domain,
because it uses only a token and URL. Passing it to auth plugin causes
an exception.

Construct domain-related parameters only for specific plugins, such
as password or totp.

Change-Id: I13db3bbe31a0ed843e9f4528d37c768546e2bee9
Closes-Bug: 1642301
2016-11-18 13:52:58 +00:00
Matt Riedemann
cd1a412408 Mask passwords in debug logs for auth_config_hook
The auth config hook can have credentials in it so
we have to mask the config before logging it. To
avoid doing the work of masking the password if we
aren't going to log it, there is a conditional put
around the actual debug statement.

Change-Id: I8e626672ec94fc837610216bccb4354dbdedca17
Closes-Bug: #1630822
2016-10-05 21:11:16 -04:00
Dean Troyer
14dbfe4474 Defer auth prompting until it is actually needed
Auth option prompting happens waaaay to early in the default
os-client-config flow, we need to defer it until adter the commands
have been parsed.  This is why ClientManager.setup_auth() exists,
as it is not called until the first attempt to connect to a server
occurs.  Commands that do not require authentication never hit this.

Also, required options were not being enforced.  By doing this we handle
when no authentication info is present, we fail on missing auth-url rather
than attempt to prompt for a password (default auth is password).

Closes-Bug: 1619274
Change-Id: Ia4eae350e6904c9eb2c8507d9b3429fe52418726
2016-09-08 10:31:13 -05:00
Jenkins
c5f8f761de Merge "Fix auth prompt brokenness" 2016-08-29 21:09:58 +00:00
Dean Troyer
bec206fa0a Fix auth prompt brokenness
We start by fixing this in the already-present OSC_Config class so OSC
can move forward.  This change needs to get ported down into
os-client-config in the near future, maybe even soon enough to make the
client library freeze this week.

* Add the pw-func argument to the OSC_Config (or OpenStackConfig) __init__()
* When looping through the auth options from the KSA plugin look for any
  that have a prompt defined and do not have a value already, so ask for one.

Closes-bug: #1617384
Change-Id: Ic86d56b8a6844516292fb74513712b486fec4442
2016-08-29 11:58:49 -05:00
Cao Xuan Hoang
f854b7d6ea Clean imports in code
In some part in the code we import objects.
In the Openstack style guidelines they recommend to import only modules.

http://docs.openstack.org/developer/hacking/#imports

Change-Id: I2eb35dc53f0fdb61c31022bb70293d1df8aaf482
2016-08-25 13:50:38 +07:00
Dean Troyer
684412ca4c Work around a version clash issue with os-client-config
Need to add the fixed_arguments arg to _validate_auth() so
os-client-config 1.19.1 and 1.20.0 can call our version properly.

Change-Id: I328e47ba2f8115e6b18bf1482fd4aa35056907a4
2016-08-22 08:29:35 -05:00
Dean Troyer
2a1a174086 Gate-unbreaking combo review
Fix argument precedence hack
  Working around issues in os-client-config <= 1.18.0

  This is ugly because the issues in o-c-c 1.19.1 run even deeper
  than in 1.18.0, so we're going to use 1.19.0 get_one_cloud() that
  is known to work for OSC and fix o-c-c with an axe.

Remove return values for set commands
  'identity provider set' and 'service provider set' were still
  returning their show-like data, this is a fail for set commands
  now, don't know how this ever passed before...

Constraints are ready to be used for tox.ini
  Per email[1] from Andreas, we don't need to hack at install_command
  any longer.

  [1] http://openstack.markmail.org/thread/a4l7tokbotwqvuoh

Co-authorioed-by: Steve Martinelli <s.martinelli@gmail.com>
Depends-On: I49313dc7d4f44ec897de7a375f25b7ed864226f1
Change-Id: I426548376fc7d3cdb36501310dafd8c44d22ae30
2016-08-18 07:21:15 -05:00