<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 2. Feb 2021, at 01:43, Adrian Turjak <<a href="mailto:adriant@catalystcloud.nz" class="">adriant@catalystcloud.nz</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">*puts up hand*<br class=""><br class="">You can blame me for this. When I implemented this I didn't (and still don't) fully understand how the loading stuff works in Keystoneauth and how it works with other things like OSC. I was more focused on getting the direct auth/session side working because the loading stuff isn't that useful in OSC really (see below why).<br class=""><br class="">If anyone does know the loader side of keystoneauth better please chime in and save me from making too much of a fool of myself!<br class=""><br class="">I think adding `.split(',')` is probably enough, but you'd want to also update the help text clarify that the option is a 'comma separated list'.<br class=""><br class=""><br class="">The biggest issue, and why this area never got much testing, is because it is effectively useless since you'd have to supply your MFA values EVERY command. Imagine how awful that would be for TOTP. The whole point of the MFA process in keystone with auth-receipt was a dynamic interactive login. Supplying the MFA upfront isn't that useful.<br class=""><br class="">What the OSC really needs is a `login` command, that goes through a login process using the auth-receipts workflow from keystone (asks for password/totp) and sets some sort of state file. We can't set the environment variables of the parent shell process, so we'd have to go with a state/session file. But to avoid it clashing with other state files and terminal sessions we'd need some way to tag them by the parent process ID so you can login to more than one cloud/project/user/etc across multiple terminals.<br class=""></div></div></blockquote><div><br class=""></div><div>I guess we can do something about that. Recently Monty started and I took over the patch for adding token caching in the keyring[1]. As such it will not really help, but together with [2] and [3] we can use authorisation caching on the OSC side. I was never really giving priority to this, since in a regular use case it perhaps saves .5 - 1 second, what is not really noticeable (most time is wasted on initialization). However in this context it might become really handy. Feel free to trigger discussion if that looks important.</div><div><br class=""></div><div>And yes, I totally agree on the fact, that TOTP/MFA for scripting is a total disaster, therefore nobody really uses it.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">In addition it would be really nice if the OSC had some way of reusing a scoped token/catalog rather than having to fetch it every time, but I feel that would have to include changes in Keystoneauth to supply it some cached data which tells it to not attempt to reauthenticate but rather trust the catalog/token supplied (does keystoneauth support that?). Because that reauth every command via Keystoneauth is actually what often takes longer than the actual API calls... We can also just throw catalog into that state/session file as json/yaml.<br class=""><br class="">On 29/01/21 7:03 am, Stephen Finucane wrote:<br class=""><blockquote type="cite" class="">The definition for those opts can be found at [1]. As Sean thought it might be,<br class="">that is using the default type defined in the parent 'Opt' class of 'str' [2].<br class="">We don't expose argparse's 'action' parameter that would allow us to use the<br class="">'append' action, so you'd have to fix this by parsing whatever the user provided<br class="">after the fact. I suspect you could resolve the immediate issue by changing this<br class="">line [3] from:<br class=""><br class=""> self._methods = kwargs['auth_methods']<br class=""><br class="">to:<br class=""><br class=""> self._methods = kwargs['auth_methods'].split(',')<br class=""><br class="">However, I assume there's likely more to this issue. I don't have an environment<br class="">to hand to validate this fix, unfortunately.<br class=""><br class="">If you do manage to test that change and it works, I'd be happy to help you in<br class="">getting a patch proposed to 'keystoneauth'.<br class=""><br class="">Hope this helps,<br class="">Stephen<br class=""><br class="">[1] <a href="https://github.com/openstack/keystoneauth/blob/4.3.0/keystoneauth1/loading/_plugins/identity/v3.py#L316-L330" class="">https://github.com/openstack/keystoneauth/blob/4.3.0/keystoneauth1/loading/_plugins/identity/v3.py#L316-L330</a><br class="">[2] <a href="https://github.com/openstack/keystoneauth/blob/4.3.0/keystoneauth1/loading/opts.py#L65" class="">https://github.com/openstack/keystoneauth/blob/4.3.0/keystoneauth1/loading/opts.py#L65</a><br class="">[3] <a href="https://github.com/openstack/keystoneauth/blob/4.3.0/keystoneauth1/loading/_plugins/identity/v3.py#L338" class="">https://github.com/openstack/keystoneauth/blob/4.3.0/keystoneauth1/loading/_plugins/identity/v3.py#L338</a><br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Jean-François<br class=""></blockquote></blockquote><br class=""><br class=""></blockquote><br class=""></div></div></blockquote>[1] <a href="https://review.opendev.org/c/openstack/openstacksdk/+/735352" class="">https://review.opendev.org/c/openstack/openstacksdk/+/735352</a></div><div>[2] <a href="https://review.opendev.org/c/openstack/python-openstackclient/+/765652" class="">https://review.opendev.org/c/openstack/python-openstackclient/+/765652</a></div><div>[3] <a href="https://review.opendev.org/c/openstack/osc-lib/+/765650" class="">https://review.opendev.org/c/openstack/osc-lib/+/765650</a></div><br class=""></body></html>