tests.smartapp.test_signature¶
Module Contents¶
- tests.smartapp.test_signature.METHOD = 'POST'¶
- tests.smartapp.test_signature.HOST = 'example.com'¶
- tests.smartapp.test_signature.PATH = '/foo?param=value&pet=dog'¶
- tests.smartapp.test_signature.REQUEST_TARGET = 'post /foo?param=value&pet=dog'¶
- tests.smartapp.test_signature.DATE_STR = 'Thu, 05 Jan 2014 21:31:40 GMT'¶
- tests.smartapp.test_signature.DATE_OBJ¶
- tests.smartapp.test_signature.BODY = '{"hello": "world"}'¶
- tests.smartapp.test_signature.CONTENT_TYPE = 'application/json'¶
- tests.smartapp.test_signature.CONTENT_LENGTH = ''¶
- tests.smartapp.test_signature.DIGEST = 'SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE='¶
- tests.smartapp.test_signature.CORRELATION = 'XXX'¶
- tests.smartapp.test_signature.KEY_ID = 'Test'¶
- tests.smartapp.test_signature.ALGORITHM = 'rsa-sha256'¶
- tests.smartapp.test_signature.CLOCK_SKEW = 300¶
- tests.smartapp.test_signature.KEYSERVER_URL = 'https://key.smartthings.com'¶
- tests.smartapp.test_signature.KEY_DOWNLOAD_URL = 'https://key.smartthings.com/Test'¶
- tests.smartapp.test_signature.SMARTAPP_URL = 'https://example.com/foo?param=value&pet=dog'¶
- tests.smartapp.test_signature.PUBLIC_SIGNING_KEY = ''¶
- tests.smartapp.test_signature.WRONG_SIGNING_KEY = ''¶
- tests.smartapp.test_signature.DEFAULT_AUTHORIZATION = ''¶
- tests.smartapp.test_signature.DEFAULT_SIGNATURE = ''¶
- tests.smartapp.test_signature.DEFAULT_SIGNING_STRING = ''¶
- tests.smartapp.test_signature.DEFAULT_ORIGINAL_HEADERS¶
- tests.smartapp.test_signature.DEFAULT_SIGNING_HEADERS = 'Date'¶
- tests.smartapp.test_signature.DEFAULT_SIGNING_ATTRIBUTES¶
- tests.smartapp.test_signature.ALL_HEADERS_AUTHORIZATION = ''¶
- tests.smartapp.test_signature.ALL_HEADERS_SIGNATURE = ''¶
- tests.smartapp.test_signature.ALL_HEADERS_ORIGINAL_HEADERS¶
- tests.smartapp.test_signature.ALL_HEADERS_SIGNING_HEADERS = '(request-target) host date content-type digest content-length'¶
- tests.smartapp.test_signature.ALL_HEADERS_SIGNING_ATTRIBUTES¶
- tests.smartapp.test_signature.ALL_HEADERS_SIGNING_STRING = ''¶
- tests.smartapp.test_signature.TIMEOUT_MATCHER¶
- tests.smartapp.test_signature.build_config(clock_skew_sec: int | None = CLOCK_SKEW) smartapp.interface.SmartAppDispatcherConfig¶
Build configuration to test with.
- tests.smartapp.test_signature.build_definition(target_url: str = SMARTAPP_URL) smartapp.interface.SmartAppDefinition¶
Build a SmartApp definition to test with.
- tests.smartapp.test_signature.build_context(headers: dict[str, str]) smartapp.interface.SmartAppRequestContext¶
Build a request context to test with.
- class tests.smartapp.test_signature.TestSignatureVerifier¶
- test_default_signature_attributes()¶
- test_all_headers_signature_attributes()¶
- test_header()¶
- test_verify_date_valid(now, date)¶
- test_verify_date_invalid(now, date)¶
- test_verify_date_no_skew(now, date)¶
- test_default_verify_valid(now, retrieve)¶
- test_all_headers_verify_valid(now, retrieve)¶
- test_default_verify_key_download_failure(now, retrieve)¶
- test_all_headers_verify_download_failure(now, retrieve)¶
- test_default_verify_invalid_key(now, retrieve)¶
- test_all_headers_verify_invalid_key(now, retrieve)¶
- test_default_verify_wrong_key(now, retrieve)¶
- test_all_headers_verify_wrong_key(now, retrieve)¶
- test_default_verify_mismatch(now, retrieve)¶
- test_all_headers_verify_mismatch(now, retrieve)¶
- test_authorization_bad()¶
- test_authorization_missing_attribute(attribute)¶
- test_authorization_invalid_algorithm()¶