Example #1
0
def authenticate_user(provider, username, password, initial_sync=True):
    leap_session = LeapSessionFactory(provider).create(username, password)

    if initial_sync:
        yield leap_session.initial_sync()

    defer.returnValue(leap_session)
Example #2
0
def initialize_leap(leap_provider_cert,
                    leap_provider_cert_fingerprint,
                    credentials_file,
                    organization_mode,
                    leap_home,
                    initial_sync=True):
    init_monkeypatches()
    events_server.ensure_server()
    register(events.KEYMANAGER_FINISHED_KEY_GENERATION,
             set_fresh_account)
    provider, username, password = credentials.read(organization_mode,
                                                    credentials_file)
    LeapCertificate.set_cert_and_fingerprint(leap_provider_cert,
                                             leap_provider_cert_fingerprint)

    config = LeapConfig(leap_home=leap_home, start_background_jobs=True)
    provider = LeapProvider(provider, config)
    LeapCertificate(provider).setup_ca_bundle()
    leap_session = LeapSessionFactory(provider).create(username, password)

    if initial_sync:
        leap_session = yield leap_session.initial_sync()

    global fresh_account
    if fresh_account:
        add_welcome_mail(leap_session.mail_store)

    defer.returnValue(leap_session)
Example #3
0
def initialize_leap(leap_provider_cert, leap_provider_cert_fingerprint,
                    credentials_file, organization_mode, leap_home):
    init_monkeypatches()
    events_server.ensure_server()
    provider, username, password = credentials.read(organization_mode,
                                                    credentials_file)
    LeapCertificate.set_cert_and_fingerprint(leap_provider_cert,
                                             leap_provider_cert_fingerprint)

    config = LeapConfig(leap_home=leap_home, start_background_jobs=True)
    provider = LeapProvider(provider, config)
    LeapCertificate(provider).setup_ca_bundle()
    leap_session = LeapSessionFactory(provider).create(username, password)

    yield leap_session.initial_sync()

    defer.returnValue(leap_session)
Example #4
0
def initialize_leap(leap_provider_cert,
                    leap_provider_cert_fingerprint,
                    credentials_file,
                    organization_mode,
                    leap_home):
    init_monkeypatches()
    events_server.ensure_server()
    provider, username, password = credentials.read(organization_mode, credentials_file)
    LeapCertificate.set_cert_and_fingerprint(leap_provider_cert, leap_provider_cert_fingerprint)

    config = LeapConfig(leap_home=leap_home, start_background_jobs=True)
    provider = LeapProvider(provider, config)
    LeapCertificate(provider).setup_ca_bundle()
    leap_session = LeapSessionFactory(provider).create(username, password)

    yield leap_session.initial_sync()

    defer.returnValue(leap_session)