How to use sshpubkeys - 10 common examples

To help you get started, we’ve selected a few sshpubkeys examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dropbox / merou / tests / setup.py View on Github external
def add_public_key_to_user(self, key, user):
        # type: (str, str) -> None
        sql_user = User.get(self.session, name=user)
        assert sql_user
        public_key = SSHKey(key, strict=True)
        public_key.parse()
        sql_public_key = PublicKey(
            user_id=sql_user.id,
            public_key=public_key.keydata.strip(),
            fingerprint=public_key.hash_md5().replace("MD5:", ""),
            fingerprint_sha256=public_key.hash_sha256().replace("SHA256:", ""),
            key_size=public_key.bits,
            key_type=public_key.key_type,
            comment=public_key.comment,
        )
        sql_public_key.add(self.session)
github ojarva / python-sshpubkeys / tests / invalid_authorized_keys.py View on Github external
from .invalid_keys import keys as invalid_keys
from .valid_keys import keys as valid_keys
from sshpubkeys.exceptions import InvalidKeyError, MalformedDataError

items = [
    ["lines_with_spaces", " # Comments\n  \n" + valid_keys[0][0] + "\nasdf", InvalidKeyError],
    ["invalid_key", "# Comments\n" + invalid_keys[0][0], MalformedDataError],
]
github ojarva / python-sshpubkeys / tests / invalid_keys.py View on Github external
"too_short_ed25519", ["loose", "strict"]
    ],
    [
        "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIUGODBKRjsFB/1v3pDRGpA6xR+QpOJg9vat0brlbUNDDpA==", InvalidKeyLengthError,
        "too_long_ed25519", ["loose", "strict"]
    ],
    [
        "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBE2gqbAChP2h3fTPx3Jy2KdOJUiBGEiqBUwoosfzllw+KrqmGiDEWlufSxdiSOFuLd4a8PSwhoWbdQgRVFrZAvFE=",
        InvalidKeyError, "invalid_ecdsa_key", ["loose", "strict"]
    ],
    [
        "ecdsa-sha2-nistp255 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTUAAAAIbmlzdHAyNTUAAABBBE2gqbAChP2h3fTPx3Jy2KdOJUiBGEiqBUwoosfzllw+KrqmGiDEWlufSxdiSOFuLd4a8PSwhoWbdQRVFrZAvFE=",
        NotImplementedError, "invalid_nist_curve", ["loose", "strict"]
    ],
    ["", InvalidKeyError, "empty_key", ["loose", "strict"]],
    ["- -", InvalidKeyError, "no_content", ["loose", "strict"]],
    [
        "ssh-invalid-key-type AAAAFHNzaC1pbnZhbGlkLWtleS10eXBlAAAAgMEgAGDgAKEBAMAgoECggSCAQIEAoIAhASEhAKDAAOAAwGCBIKAAYGCgYKDhAEBAwICAoIDgIADAYKAAYGAAYAEgwGBBIGDhIOBg4CAAoQDAIEAgIEEggEDgQGCAIGAhAQDgoKAhIAAggSBA4CBggOEBIEDgoMDAwKBg4MDAYIDgAAAAIAAAAAAAAAAAAAAAAIAggEEggSBAIIBgAMDAQADAIQEgAAAAgJAQABBgICBQUABQcFAAcJBgUIAAIHAAkJBQEIAQMEAgIHBQEFCAUBBQUHAQMGBgQBCAEEAgICBQYDBwIJBAYFCQYDBwIAAQIHCQMEBwYCBAICAAEFBQAHAgAIBQAJBwgEBwYGCAEHBgkBAwEBAQcHAQMGCQMCBQIABAUJAgEIAgAAAAgIGAAYIDgoSBA4ABAgAEAIEEAoEAg4IDAgQCAwCDgQMAgQABgoGAAgMCgoOCA4QABAGBAQQDgoKABASBhAQDgoIBgIQEgAQEAQSBg4IEBICEggKBAAABgYKDAgGDgYAAgoGCAoODgYGEAwIBAoACgQADBAGDgASCgQMDgAABAISA",
        NotImplementedError, "not_implemented_key_type", ["loose", "strict"]
    ],

    # 512 bit ed25519 keys are not yet supported by OpenSSH
    [
        "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAQIMcGCUjHYKD/rfvSGiNSB1ij8hScTB7e1bo3XK2oaGGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
        InvalidKeyLengthError, "512bit_ed25519", ["loose", "strict"]
    ],
    [
        "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAQIBBAIDAICBAgEABACAggGCgAABAwOEAwGBAgEEg4SBAAKBBIGEAgSEgAIEgoMCgICAgYMCgYQDgoKBgIIDgwCA=",
        InvalidKeyLengthError, "512bit_ed25519", ["loose", "strict"]
    ],
    [
        'command="dump /home,no-pty,no-port-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABADR9kolU4uiD26LMrbakQlNf4QWB2xrdY3nASf6CJdQYzTMjNmbt6sJ4A4pGnCupFrzL04EYDvbVmT4GEZm6CU4BsY61yosnpGSqqcVCdw5xW1k4bCSDPW75WHLCVmYyROhZ+yyo8uAcIy5UIyBZXF/PO7taJrrIi5RwdqIPwtCrJ3dJkcFWa3qZWJykLAFQD5A/lta/egS/u/nyCap2e16WGnvSluz9CyYtGFNS9axzOwHxLFEv2ocOsJjYgzV+Jfpiao94A4VzLKbUDHlfV57KS0tJaT8FKKsg34vN3bsD0zUftLUPpUFgJfMwje0C2rCJkCzwgya2vxLqj2fg0Q0= ojarva@ojar-laptop.local',
github ojarva / python-sshpubkeys / tests / invalid_authorized_keys.py View on Github external
from .invalid_keys import keys as invalid_keys
from .valid_keys import keys as valid_keys
from sshpubkeys.exceptions import InvalidKeyError, MalformedDataError

items = [
    ["lines_with_spaces", " # Comments\n  \n" + valid_keys[0][0] + "\nasdf", InvalidKeyError],
    ["invalid_key", "# Comments\n" + invalid_keys[0][0], MalformedDataError],
]
github ojarva / python-sshpubkeys / tests / invalid_keys.py View on Github external
"ssh-invalid-key-type AAAAFHNzaC1pbnZhbGlkLWtleS10eXBlAAAAgMEgAGDgAKEBAMAgoECggSCAQIEAoIAhASEhAKDAAOAAwGCBIKAAYGCgYKDhAEBAwICAoIDgIADAYKAAYGAAYAEgwGBBIGDhIOBg4CAAoQDAIEAgIEEggEDgQGCAIGAhAQDgoKAhIAAggSBA4CBggOEBIEDgoMDAwKBg4MDAYIDgAAAAIAAAAAAAAAAAAAAAAIAggEEggSBAIIBgAMDAQADAIQEgAAAAgJAQABBgICBQUABQcFAAcJBgUIAAIHAAkJBQEIAQMEAgIHBQEFCAUBBQUHAQMGBgQBCAEEAgICBQYDBwIJBAYFCQYDBwIAAQIHCQMEBwYCBAICAAEFBQAHAgAIBQAJBwgEBwYGCAEHBgkBAwEBAQcHAQMGCQMCBQIABAUJAgEIAgAAAAgIGAAYIDgoSBA4ABAgAEAIEEAoEAg4IDAgQCAwCDgQMAgQABgoGAAgMCgoOCA4QABAGBAQQDgoKABASBhAQDgoIBgIQEgAQEAQSBg4IEBICEggKBAAABgYKDAgGDgYAAgoGCAoODgYGEAwIBAoACgQADBAGDgASCgQMDgAABAISA",
        NotImplementedError, "not_implemented_key_type", ["loose", "strict"]
    ],

    # 512 bit ed25519 keys are not yet supported by OpenSSH
    [
        "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAQIMcGCUjHYKD/rfvSGiNSB1ij8hScTB7e1bo3XK2oaGGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
        InvalidKeyLengthError, "512bit_ed25519", ["loose", "strict"]
    ],
    [
        "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAQIBBAIDAICBAgEABACAggGCgAABAwOEAwGBAgEEg4SBAAKBBIGEAgSEgAIEgoMCgICAgYMCgYQDgoKBgIIDgwCA=",
        InvalidKeyLengthError, "512bit_ed25519", ["loose", "strict"]
    ],
    [
        'command="dump /home,no-pty,no-port-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABADR9kolU4uiD26LMrbakQlNf4QWB2xrdY3nASf6CJdQYzTMjNmbt6sJ4A4pGnCupFrzL04EYDvbVmT4GEZm6CU4BsY61yosnpGSqqcVCdw5xW1k4bCSDPW75WHLCVmYyROhZ+yyo8uAcIy5UIyBZXF/PO7taJrrIi5RwdqIPwtCrJ3dJkcFWa3qZWJykLAFQD5A/lta/egS/u/nyCap2e16WGnvSluz9CyYtGFNS9axzOwHxLFEv2ocOsJjYgzV+Jfpiao94A4VzLKbUDHlfV57KS0tJaT8FKKsg34vN3bsD0zUftLUPpUFgJfMwje0C2rCJkCzwgya2vxLqj2fg0Q0= ojarva@ojar-laptop.local',
        MalformedDataError, "missing_quote", ["loose", "strict"]
    ],
    [
        'ssh-dss AAAAB3NzaC1kc3MAAAEBAM4SvSD+Gpu4L5TvkroBbAcVPeQID1gdZTpr5fEuOCwTVxMyuPwfHH6txh4Nq0K7MRee5zuVKHNkxj84EMF/+g4eJISmE87wzfYNJQhGNOmXO3yYGCmFaDgrlsWH9OhGglWTxz768gJy4IUP2hqvsbotdpjhRvTFCIep12r4L16rFQJeVVti6Xml3UZHXvoMbwJC+BulwU8hnosXvH4mYikgoaSmDUfJkkLB1nD/g48vo172iu2mfEYqAbn9lX46vnetmpz87IHxbCHmIuJxhMfH+vMY5zvF7vUy018XUPrAcqDkmszhJOFuMhB2SQ6IT8nQZnZ+aGGnoQ2kgjCrrusAAAAVAN/iBeqRO1CPAuNIec08Y9VP+MFTAAABAGDVzqw4i64Fd1mLi6BRKYZdbMI56gx+Cu+EfAjH7dx6AqEW7PiSB2yQrXl1dbCbLYhQhEXIaJW+8epTCsm9o22+KZ5yIyyNc5SxPad7W4W/gvSzqMZC+NMBYia8hrq3BHk9OYxFUZfCx47adbs9sKFi1GhgCbXiDsrb8EvzMWMyyKyAl1AaCaMYWVXnDRBtJnASK2GyiR4GWHA+4z9syrEHknM0RonP2B24552cYq3gxCxRvZ6XJBRQaRnS9RjIaziDImXoLa5X/82ZT6cVzwdZa9S9LGJusfBLrE12O8nis1iI1CliukGtOmWvogFqYABtkzGizrnajCpU4doiuoUAAAEAchR3IrCbXnDekPQGt+uM4cSdZ9OIt2wROlxJODV/Z57OOGMm7RFJkuC4olN1h032dhHM6hsKzsMoRkin0zLuZgsInKs2LnmaL27wwB5wcriLnZm1HK9PUEH5A/wqR4Vc2SHUa1Zzvjddqe0fk2rRzYhaACctSii8CH68nmECZDgn0xePz8n4p4CoZalkQvcjEW/O6nzgrudW3VahxEl4YijuWocQ+y0vWIa6OByuYbDAxST971RF84Q0M8I1jnEwteGcYnLV8CVZQaZ5fmI3t4Z8CcRN339rKpvakVgNYYATJcTc402TIhyRHMLew63et11xkIVGocLaaYaI2gzavA==',
        TooLongKeyError, "dsa_2048", ["strict"]
    ],
    [
        'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAYQbdtLTII+vP98NSDlK2LXxVARELRYO0NODFYQ0imYxsmBMB7BrfljFppLJyjU6cziOT6YFj6rVd8MmCogdCR32u63EV11uT6RCFfJMQJtIi+B1JJipTxLzURsiUOOgAHJc= ojarva@ojar-laptop.local',
        TooShortKeyError, "rsa_771", ["strict"]
    ],
github ojarva / python-sshpubkeys / tests / test_dsa_keys_failing.py View on Github external
from sshpubkeys.exceptions import MalformedDataError

keys = [
    [
        "ssh-dss AAAAB3NzaC1kc3MAAACBAPlHIP5sD+T8/Sx1DGEiCzCXqpl7ww40jBg7wTkxu44OH6pNog5PjJt5M4NBULhKva/i+bhIM3ba+H1Or+aHWWFHACV6W2FCGk/k37ApRF8sIa4hsnN0P9qn6VfhbJKee+DBxa21WjjY/MZiljmJz7IQHx5RTxX9I/hJ7cL+aNmrAAAAFQCKteqc4IkgIrjpcpStsxYAhb3MqQAAAIEA+SfIKuTr7QPcinsZQDdmZOXqcg+u9TLzHA4c47y0Kns3T3BVPr9rWdmuh6eImzLO4wMLxLvcg3ecrqFuiCp1IHvXENkGlpB17S+uOXlVDY+sTdXyvYKRKirg5IZefIAP/m08c0QGkhFDbo4ysr9D5gXgH3LB2rMPIAbvMWm/HZQAAACBAKWtAE3hXRQX5KtI4AoIWVTly/6T4JNBt4u24ZRqV7X//CZEZ0cS5YpR/frlpUDI3WKoMtS+VmT3cBFZINashIxZyfBF8+0UX3s34HwNfp0hDW3ZdgZJU56GC2eclMantYGeVrMxgTQd80pxZFgByEhoXGeZaAwUzN8ULo9jHQo=",
        MalformedDataError, "too_short_data"
    ],
    [
        "ssh-dss AAAAB3NzaC1kc3MAAACBAPlHIP5sD+T8/Sx1DGEiCzCXqpl7ww40jBg7wTkxu44OH6pNog5PjJt5M4NBULhKva/i+bhIM3ba+H1Or+aHWWFHACV6W2FCGk/k37ApRF8sIa4hsnN0P9qn6VfhbJKee+DBxa21WjjY/MZiljmJz7IQHx5RTxX9I/hJ7cL+aNmrAAAAFQCKteqc4IkgIrjpcpStsxYAhb3MqQAAAIEA+SfIKuTr7QPcinsZQDdmZOXqcg+u9TLzHA4c47y0Kns3T3BVPr9rWdmuh6eImzLO4wMLxLvcg3ecrqFuiCp1IHvXENkGlpB17S+uOXlVDY+sTdXyvYKRKirg5IZefIAP/m08c0QGkhFDbo4ysr9D5gXgH3LB2rMPIAbvMWm/HZQAAACBAKWtAE3hXRQX5KtI4AoIWVTly/6T4JNBt4u24ZRqV7X//CZEZ0cS5YpR/frlpUDI3WKoMtS+VmT3cBFZINashIxZyfBF8+0UX3s34HwNfp0hDW3ZdgZJU56GC2eclMantYGeVrMxgTQd80pxZFgByEhoXGeZaAwUzN8ULo9jHQqMjA==",
        MalformedDataError, "too_long_data"
    ],
github ojarva / python-sshpubkeys / tests / invalid_options.py View on Github external
from sshpubkeys.exceptions import (InvalidOptionNameError, InvalidOptionsError, MissingMandatoryOptionValueError,
                                   UnknownOptionNameError)

options = [
    ["includes_space", "no-user-rc ", InvalidOptionsError],
    ["includes_space_multiple", "no-user-rc, port-forwarding", InvalidOptionsError],
    ["includes_space_before_comma", "no-user-rc ,port-forwarding", InvalidOptionsError],
    ["empty_option_end", "no-user-rc,", InvalidOptionsError],
    ["empty_option_beginning", ",no-user-rc", InvalidOptionsError],
    ["empty_option_middle", "no-user-rc,,port-forwarding", InvalidOptionsError],
    ["unbalanced_quotes", 'from="asdf', InvalidOptionsError],
    ["invalid_characters_in_key_percent", 'from%', InvalidOptionNameError],
    ["invalid_characters_in_key_parenthesis", 'from)', InvalidOptionNameError],
    ["invalid_characters_in_key_space", 'fr om', InvalidOptionNameError],
    ["unknown_option_name", "random-option-name", UnknownOptionNameError],
    ["unbalanced_quotes_complex", 'from="asdf",no-user-rc"', InvalidOptionsError],
    ["parameter_missing", 'from,no-user-rc"', MissingMandatoryOptionValueError],
]
github ojarva / python-sshpubkeys / tests / invalid_keys.py View on Github external
],
    ["", InvalidKeyError, "empty_key", ["loose", "strict"]],
    ["- -", InvalidKeyError, "no_content", ["loose", "strict"]],
    [
        "ssh-invalid-key-type AAAAFHNzaC1pbnZhbGlkLWtleS10eXBlAAAAgMEgAGDgAKEBAMAgoECggSCAQIEAoIAhASEhAKDAAOAAwGCBIKAAYGCgYKDhAEBAwICAoIDgIADAYKAAYGAAYAEgwGBBIGDhIOBg4CAAoQDAIEAgIEEggEDgQGCAIGAhAQDgoKAhIAAggSBA4CBggOEBIEDgoMDAwKBg4MDAYIDgAAAAIAAAAAAAAAAAAAAAAIAggEEggSBAIIBgAMDAQADAIQEgAAAAgJAQABBgICBQUABQcFAAcJBgUIAAIHAAkJBQEIAQMEAgIHBQEFCAUBBQUHAQMGBgQBCAEEAgICBQYDBwIJBAYFCQYDBwIAAQIHCQMEBwYCBAICAAEFBQAHAgAIBQAJBwgEBwYGCAEHBgkBAwEBAQcHAQMGCQMCBQIABAUJAgEIAgAAAAgIGAAYIDgoSBA4ABAgAEAIEEAoEAg4IDAgQCAwCDgQMAgQABgoGAAgMCgoOCA4QABAGBAQQDgoKABASBhAQDgoIBgIQEgAQEAQSBg4IEBICEggKBAAABgYKDAgGDgYAAgoGCAoODgYGEAwIBAoACgQADBAGDgASCgQMDgAABAISA",
        NotImplementedError, "not_implemented_key_type", ["loose", "strict"]
    ],

    # 512 bit ed25519 keys are not yet supported by OpenSSH
    [
        "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAQIMcGCUjHYKD/rfvSGiNSB1ij8hScTB7e1bo3XK2oaGGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
        InvalidKeyLengthError, "512bit_ed25519", ["loose", "strict"]
    ],
    [
        "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAQIBBAIDAICBAgEABACAggGCgAABAwOEAwGBAgEEg4SBAAKBBIGEAgSEgAIEgoMCgICAgYMCgYQDgoKBgIIDgwCA=",
        InvalidKeyLengthError, "512bit_ed25519", ["loose", "strict"]
    ],
    [
        'command="dump /home,no-pty,no-port-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABADR9kolU4uiD26LMrbakQlNf4QWB2xrdY3nASf6CJdQYzTMjNmbt6sJ4A4pGnCupFrzL04EYDvbVmT4GEZm6CU4BsY61yosnpGSqqcVCdw5xW1k4bCSDPW75WHLCVmYyROhZ+yyo8uAcIy5UIyBZXF/PO7taJrrIi5RwdqIPwtCrJ3dJkcFWa3qZWJykLAFQD5A/lta/egS/u/nyCap2e16WGnvSluz9CyYtGFNS9axzOwHxLFEv2ocOsJjYgzV+Jfpiao94A4VzLKbUDHlfV57KS0tJaT8FKKsg34vN3bsD0zUftLUPpUFgJfMwje0C2rCJkCzwgya2vxLqj2fg0Q0= ojarva@ojar-laptop.local',
        MalformedDataError, "missing_quote", ["loose", "strict"]
    ],
    [
        'ssh-dss AAAAB3NzaC1kc3MAAAEBAM4SvSD+Gpu4L5TvkroBbAcVPeQID1gdZTpr5fEuOCwTVxMyuPwfHH6txh4Nq0K7MRee5zuVKHNkxj84EMF/+g4eJISmE87wzfYNJQhGNOmXO3yYGCmFaDgrlsWH9OhGglWTxz768gJy4IUP2hqvsbotdpjhRvTFCIep12r4L16rFQJeVVti6Xml3UZHXvoMbwJC+BulwU8hnosXvH4mYikgoaSmDUfJkkLB1nD/g48vo172iu2mfEYqAbn9lX46vnetmpz87IHxbCHmIuJxhMfH+vMY5zvF7vUy018XUPrAcqDkmszhJOFuMhB2SQ6IT8nQZnZ+aGGnoQ2kgjCrrusAAAAVAN/iBeqRO1CPAuNIec08Y9VP+MFTAAABAGDVzqw4i64Fd1mLi6BRKYZdbMI56gx+Cu+EfAjH7dx6AqEW7PiSB2yQrXl1dbCbLYhQhEXIaJW+8epTCsm9o22+KZ5yIyyNc5SxPad7W4W/gvSzqMZC+NMBYia8hrq3BHk9OYxFUZfCx47adbs9sKFi1GhgCbXiDsrb8EvzMWMyyKyAl1AaCaMYWVXnDRBtJnASK2GyiR4GWHA+4z9syrEHknM0RonP2B24552cYq3gxCxRvZ6XJBRQaRnS9RjIaziDImXoLa5X/82ZT6cVzwdZa9S9LGJusfBLrE12O8nis1iI1CliukGtOmWvogFqYABtkzGizrnajCpU4doiuoUAAAEAchR3IrCbXnDekPQGt+uM4cSdZ9OIt2wROlxJODV/Z57OOGMm7RFJkuC4olN1h032dhHM6hsKzsMoRkin0zLuZgsInKs2LnmaL27wwB5wcriLnZm1HK9PUEH5A/wqR4Vc2SHUa1Zzvjddqe0fk2rRzYhaACctSii8CH68nmECZDgn0xePz8n4p4CoZalkQvcjEW/O6nzgrudW3VahxEl4YijuWocQ+y0vWIa6OByuYbDAxST971RF84Q0M8I1jnEwteGcYnLV8CVZQaZ5fmI3t4Z8CcRN339rKpvakVgNYYATJcTc402TIhyRHMLew63et11xkIVGocLaaYaI2gzavA==',
        TooLongKeyError, "dsa_2048", ["strict"]
    ],
    [
        'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAYQbdtLTII+vP98NSDlK2LXxVARELRYO0NODFYQ0imYxsmBMB7BrfljFppLJyjU6cziOT6YFj6rVd8MmCogdCR32u63EV11uT6RCFfJMQJtIi+B1JJipTxLzURsiUOOgAHJc= ojarva@ojar-laptop.local',
        TooShortKeyError, "rsa_771", ["strict"]
    ],
github ojarva / python-sshpubkeys / tests / invalid_options.py View on Github external
from sshpubkeys.exceptions import (InvalidOptionNameError, InvalidOptionsError, MissingMandatoryOptionValueError,
                                   UnknownOptionNameError)

options = [
    ["includes_space", "no-user-rc ", InvalidOptionsError],
    ["includes_space_multiple", "no-user-rc, port-forwarding", InvalidOptionsError],
    ["includes_space_before_comma", "no-user-rc ,port-forwarding", InvalidOptionsError],
    ["empty_option_end", "no-user-rc,", InvalidOptionsError],
    ["empty_option_beginning", ",no-user-rc", InvalidOptionsError],
    ["empty_option_middle", "no-user-rc,,port-forwarding", InvalidOptionsError],
    ["unbalanced_quotes", 'from="asdf', InvalidOptionsError],
    ["invalid_characters_in_key_percent", 'from%', InvalidOptionNameError],
    ["invalid_characters_in_key_parenthesis", 'from)', InvalidOptionNameError],
    ["invalid_characters_in_key_space", 'fr om', InvalidOptionNameError],
    ["unknown_option_name", "random-option-name", UnknownOptionNameError],
    ["unbalanced_quotes_complex", 'from="asdf",no-user-rc"', InvalidOptionsError],
    ["parameter_missing", 'from,no-user-rc"', MissingMandatoryOptionValueError],
]
github ojarva / python-sshpubkeys / tests / invalid_options.py View on Github external
UnknownOptionNameError)

options = [
    ["includes_space", "no-user-rc ", InvalidOptionsError],
    ["includes_space_multiple", "no-user-rc, port-forwarding", InvalidOptionsError],
    ["includes_space_before_comma", "no-user-rc ,port-forwarding", InvalidOptionsError],
    ["empty_option_end", "no-user-rc,", InvalidOptionsError],
    ["empty_option_beginning", ",no-user-rc", InvalidOptionsError],
    ["empty_option_middle", "no-user-rc,,port-forwarding", InvalidOptionsError],
    ["unbalanced_quotes", 'from="asdf', InvalidOptionsError],
    ["invalid_characters_in_key_percent", 'from%', InvalidOptionNameError],
    ["invalid_characters_in_key_parenthesis", 'from)', InvalidOptionNameError],
    ["invalid_characters_in_key_space", 'fr om', InvalidOptionNameError],
    ["unknown_option_name", "random-option-name", UnknownOptionNameError],
    ["unbalanced_quotes_complex", 'from="asdf",no-user-rc"', InvalidOptionsError],
    ["parameter_missing", 'from,no-user-rc"', MissingMandatoryOptionValueError],
]