# Account information
#
# Add information about each of your accounts to the accounts dictionary.
#
# You can use the dedent function to strip leading whitespace from
# multi-line remarks.  You can use the character sets and exclude function
# to create alphabets for you character-base passwords.
#
# Example:
# To create an alphabet with all characters except tabs use either:
#     'alphabet': exclude(PRINTABLE, '\t')
# or:
#     'alphabet': ALPHANUMERIC + PUNCTUATION + ' '

from avendesora import (
    # Basics
    Account, Hidden, GPG,

    # Character sets
    exclude, LOWERCASE, UPPERCASE, LETTERS, DIGITS, ALPHANUMERIC,
    HEXDIGITS, PUNCTUATION, WHITESPACE, PRINTABLE, DISTINGUISHABLE,

    # Secrets
    Password, Passphrase, PIN, Question, MixedPassword, BirthDate,

    # Account Discovery
    RecognizeAll, RecognizeAny, RecognizeTitle, RecognizeURL, RecognizeCWD,
    RecognizeHost, RecognizeUser, RecognizeEnvVar,
)

master_seed = Hidden(
    'c2VjcmV0IG1lc3NhZ2UsIHN1Y2Nlc3NmdWxseSBkZWNvZGVkIQ==',
    secure=False
)
ken = Hidden(
    'c2VjcmV0IG1lc3NhZ2UsIHN1Y2Nlc3NmdWxseSBkZWNvZGVkIQ==',
    secure=False
)

# Accounts
# AlertSCC {{{1
class AlertSCC(Account):
    aliases = ['scc']
    email = 'pizzaman@pizza.com'
    comments = '''
        Account where I signed up for local alert messages from the county 
        covernment.
    '''
    master = ken
    default  = 'email is {email}, password is {password}'
    password = Password()
    account = Hidden('MTIzNDU2LTc4OTA=')
    birthdate = BirthDate(2016, 25, 55)
    questions = [
        Question('What city were you born in?'),
        Question('What street did you grow up on?'),
        Question('What was your childhood nickname?'),
    ]
    discovery = [
        RecognizeAll(
            RecognizeURL('https://alertscc.bbcportal.com/Validation'),
            RecognizeUser('ken'),
            script='{birthdate}{return}'
        ),
        RecognizeAll(
            RecognizeURL('https://alertscc.bbcportal.com'),
            RecognizeUser('ken'),
            script='{email}{tab}{password}{return}'
        ),
    ]

# Login {{{1
class Login(Account):
    aliases = ['luks']
    passcode = Passphrase(length=6)
    discovery = [
        RecognizeAll(
            RecognizeHost('pizzaville'),
            RecognizeTitle(
                # these are used in the terminal
                'sudo', 'sudo *',

                # this is used in for virt-manager
                'Authentication',

                # this is used in for xxx (my logout script)
                '/bin/csh -f /home/ken/bin/xxx'
            ),
            script='{passcode}{return}'
        ),
    ]

# MyBank {{{1
class MyBank(Account):
    aliases = ['mb']
    username = 'pizzaman'
    email = 'pizzaman@pizza.com'
    urls = 'https://mb.com'
    passcode = MixedPassword(
        12, ALPHANUMERIC,
        [(LOWERCASE, 2), (UPPERCASE, 2), (DIGITS, 2), ('@#$%&*+=', 2)]
    )
    verbal = Passphrase(length=2)
    pin = PIN()
    questions = [
        Question('What city were you born in?'),
        Question('What street did you grow up on?'),
        Question('What was your childhood nickname?'),
    ]
    accounts = {
        'checking':   Hidden('MTIzNDU2Nzg='),
        'savings':    Hidden('MjM0NTY3ODk='),
        'creditcard': Hidden('MzQ1Njc4OTA='),
    }
    customer_service = '1-866-229-6633'

# Include a few unicode characters, but to make sure they work: ±αβγδε
# vim: filetype=python sw=4 sts=4 et ai ff=unix :
