Authentication plugins.

    Usage, Add any plugin here that will serve as a rapid means to
    authenticate to an OpenStack environment.

    Syntax is as follows:
    >>> __auth_plugins__ = {
    ...     'new_plugin_name': {
    ...         'os_auth_url': 'https://localhost:5000/v2.0/tokens',
    ...         'os_prefix': {
    ...             'os_apikey': 'apiKeyCredentials',
    ...             'os_password': 'passwordCredentials'
    ...         },
    ...         'args': {
    ...             'commands': [
    ...                 '--new-plugin-name-auth'
    ...             ],
    ...             'choices': [
    ...                 'RegionOne'
    ...             ],
    ...             'help': 'Authentication plugin for New Plugin Name',
    ...             'default': os.environ.get('OS_NEW_PLUGIN_AUTH', None),
    ...             'metavar': '[REGION]'
    ...         }
    ...     }
    ... }

    If the subdomain is in the auth url, as is the case with hp, add
    "%(region)s" to the "os_auth_url" value. The region value from the list of
    choices will be used as the string replacement. Note that if the
    `os_prefix` key is added the system will override the authentication body
    prefix with the string provided. At this time the choices are os_apikey,
    os_password, os_token. All key entries are optional and should one not be
    specified with a credential type a `NotImplementedError` will be raised.

    :param auth_plugins: Additional plugins to add in
    :type auth_plugins: ``dict``
    :returns: ``dict``

def auth_plugins(auth_plugins=None):
    """Authentication plugins.

    Usage, Add any plugin here that will serve as a rapid means to
    authenticate to an OpenStack environment.

    Syntax is as follows:
    >>> __auth_plugins__ = {
    ...     'new_plugin_name': {
    ...         'os_auth_url': 'https://localhost:5000/v2.0/tokens',
    ...         'os_prefix': {
    ...             'os_apikey': 'apiKeyCredentials',
    ...             'os_password': 'passwordCredentials'
    ...         },
    ...         'args': {
    ...             'commands': [
    ...                 '--new-plugin-name-auth'
    ...             ],
    ...             'choices': [
    ...                 'RegionOne'
    ...             ],
    ...             'help': 'Authentication plugin for New Plugin Name',
    ...             'default': os.environ.get('OS_NEW_PLUGIN_AUTH', None),
    ...             'metavar': '[REGION]'
    ...         }
    ...     }
    ... }

    If the subdomain is in the auth url, as is the case with hp, add
    "%(region)s" to the "os_auth_url" value. The region value from the list of
    choices will be used as the string replacement. Note that if the
    `os_prefix` key is added the system will override the authentication body
    prefix with the string provided. At this time the choices are os_apikey,
    os_password, os_token. All key entries are optional and should one not be
    specified with a credential type a `NotImplementedError` will be raised.

    :param auth_plugins: Additional plugins to add in
    :type auth_plugins: ``dict``
    :returns: ``dict``
    """

    __auth_plugins__ = {
        'os_rax_auth': {
            'os_auth_url': 'https://identity.api.rackspacecloud.com/v2.0/'
                           'tokens',
            'os_prefix': {
                'os_apikey': 'RAX-KSKEY:apiKeyCredentials',
                'os_password': 'passwordCredentials'
            },
            'args': {
                'commands': [
                    '--os-rax-auth'
                ],
                'choices': [
                    'dfw',
                    'ord',
                    'iad',
                    'syd',
                    'hkg',
                    'lon'
                ],
                'help': 'Authentication Plugin for Rackspace Cloud'
                        ' env[OS_RAX_AUTH]',
                'default': os.environ.get('OS_RAX_AUTH', None),
                'metavar': '[REGION]'
            }
        },
        'rax_auth_v1': {
            'os_auth_version': 'v1.0',
            'os_auth_url': 'https://identity.api.rackspacecloud.com/v1.0',
            'args': {
                'commands': [
                    '--rax-auth-v1'
                ],
                'action': 'store_true',
                'help': 'Authentication Plugin for Rackspace Cloud V1'
            }
        },
        'os_rax_auth_lon': {
            'os_auth_url': 'https://lon.identity.api.rackspacecloud.com/'
                           'v2.0/tokens',
            'os_prefix': {
                'os_apikey': 'RAX-KSKEY:apiKeyCredentials',
                'os_password': 'passwordCredentials'
            },
            'args': {
                'commands': [
                    '--os-rax-auth-lon'
                ],
                'choices': [
                    'lon'
                ],
                'help': 'Authentication Plugin for Rackspace Cloud'
                        ' env[OS_RAX_AUTH_LON]',
                'default': os.environ.get('OS_RAX_AUTH_LON', None),
                'metavar': '[REGION]'
            }
        },
        'os_hp_auth': {
            'os_auth_url': 'https://%(region)s.identity.hpcloudsvc.com:35357/'
                           'v2.0/tokens',
            'os_prefix': {
                'os_password': 'passwordCredentials'
            },
            'args': {
                'commands': [
                    '--os-hp-auth'
                ],
                'choices': [
                    'region-b.geo-1',
                    'region-a.geo-1'
                ],
                'help': 'Authentication Plugin for HP Cloud'
                        ' env[OS_HP_AUTH]',
                'default': os.environ.get('OS_HP_AUTH', None),
                'metavar': '[REGION]'
            }
        }
    }
    if auth_plugins:
        __auth_plugins__.update(auth_plugins)

    return __auth_plugins__