[MERGE] Include staging in launchpad-login authentication.

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Oct 23 20:50:55 BST 2008


>>>>> "john" == John Arbash Meinel <john at arbash-meinel.com> writes:

    john> Aaron Bentley wrote:
    >> Vincent Ladeuil wrote:
    >>>>>>>> "aaron" == Aaron Bentley <aaron at aaronbentley.com> writes:
    >>> <snip/>
    >> 
    aaron> def _set_auth_user(username, auth=None):
    aaron> if auth is None:
    aaron> auth = AuthenticationConfig()
    aaron> auth.set_credentials(
    aaron> 'Launchpad', 'bazaar.launchpad.net', username, 'ssh')
    aaron> +    auth.set_credentials(
    aaron> +        'Launchpad Staging', 'bazaar.staging.launchpad.net', username, 'ssh')
    >> 
    >>> A simple  auth.set_credentials('Launchpad', '.launchpad.net', username, 'ssh')
    >>> should be enough.
    >> 
    >> Done.
    >> 
    >> Aaron
    >> 

    john> -    return {'production': auth.get_user('ssh', 'bazaar.launchpad.net'),
    john> -            'staging': auth.get_user('ssh',
    john> 'bazaar.staging.launchpad.net'),}
    john> +    return auth.get_user('ssh', '.launchpad.net')

    john> ^- Would it actually still work to do:
    john> auth.get_user('ssh', 'bazaar.launchpad.net') if we have '.launchpad.net'
    john> set?

Yes.

    john> I'm just curious if the Auth code is smart enough to do
    john> partial matches.

Yes.

    john> Also, why do ".launchpad.net" and not "launchpad.net" ?

The later will match the host only, the former will match the
domain (from config.py):
    if not (host == a_host
            or (a_host.startswith('.') and host.endswith(a_host))):

The user is still free to define specific credentials for
specific hosts before (in the authentication.conf file) the
domain credentials.

BB:approve

    Vincent



More information about the bazaar mailing list