diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..000231e --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,19 @@ +# Read the Docs configuration file for Sphinx projects +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +sphinx: + configuration: docs/conf.py + +python: + install: + - requirements: requirements-dev.txt + - method: pip + path: . \ No newline at end of file diff --git a/bankid/__version__.py b/bankid/__version__.py index 86f674f..15729d5 100644 --- a/bankid/__version__.py +++ b/bankid/__version__.py @@ -4,5 +4,5 @@ Version info """ -__version__ = "0.14.0" +__version__ = "0.14.1" version = __version__ # backwards compatibility name diff --git a/bankid/certs/FPTestcert4_20230629.p12 b/bankid/certs/FPTestcert4_20230629.p12 new file mode 100644 index 0000000..bac3dc9 Binary files /dev/null and b/bankid/certs/FPTestcert4_20230629.p12 differ diff --git a/bankid/certs/FPTestcert4_20230629_cert.pem b/bankid/certs/FPTestcert4_20230629_cert.pem new file mode 100644 index 0000000..5b52ce9 --- /dev/null +++ b/bankid/certs/FPTestcert4_20230629_cert.pem @@ -0,0 +1,32 @@ +Bag Attributes + localKeyID: A9 F3 0C D7 04 B6 7D 23 86 84 71 C3 E9 42 62 8B 1B D7 75 C3 +subject=C = SE, O = Testbank A AB (publ), serialNumber = 5566304928, name = Test av BankID, CN = FP Testcert 4 +issuer=C = SE, O = Testbank A AB (publ), serialNumber = 111111111111, CN = Testbank A RP CA v1 for BankID Test +-----BEGIN CERTIFICATE----- +MIIEyjCCArKgAwIBAgIIMLbIMaRHjMMwDQYJKoZIhvcNAQELBQAwcTELMAkGA1UE +BhMCU0UxHTAbBgNVBAoMFFRlc3RiYW5rIEEgQUIgKHB1YmwpMRUwEwYDVQQFEwwx +MTExMTExMTExMTExLDAqBgNVBAMMI1Rlc3RiYW5rIEEgUlAgQ0EgdjEgZm9yIEJh +bmtJRCBUZXN0MB4XDTIyMDgxNzIyMDAwMFoXD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03WpKW +WAB1NCMMyNcszkLZ9OO3IRz8iyWV/KWGI07ngVuGa7dHuTje6ZjcObBCr2e4uuU+ +CLENcretUAv0BtCsOBhQLXZ0qzqrgsVebTRQzm2zTM0yfBpcTtPd3MOMFeMQTHJJ +8QH6twAKeJfY1lUCTXJYy1ZcrKnrNehksST8tk98Km9t5M2X59QZk7mJzzsUbnWr +t+izid7xF7FAgDYj9XJgQHz04a4RjRSw5/6dgexAgvGoeOkG7uUhYd5DEYQCyQyR +Zy69pJN32L0nM2dC2e3NFU5BOBwocoKza3hdtSqqvIkj2kzyeU38uaJUco/Vk3OU +s+sQNZbk5C1pxkLLwzu815tKg77Om4Nwbi+bgDvI +-----END CERTIFICATE----- diff --git a/bankid/certs/FPTestcert4_20230629_key.pem b/bankid/certs/FPTestcert4_20230629_key.pem new file mode 100644 index 0000000..18291aa --- /dev/null +++ b/bankid/certs/FPTestcert4_20230629_key.pem @@ -0,0 +1,31 @@ +Bag Attributes + localKeyID: A9 F3 0C D7 04 B6 7D 23 86 84 71 C3 E9 42 62 8B 1B D7 75 C3 +Key Attributes: +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC+C/BERzUouyaY +fYI+GoeyHqJOZWR2WzcltQIiSdTn3g9ZWwM8UonbU7ujXwvN88Qoy6tPdZR2ORu3 +aTQ7dazeWPo0L67XC3PJ1KYKi3xFJ2xis2Wh5Tve44eqajvJ4/5mpU61iO9Ba+kj +t0sW7IMbsCV5UVAEMSNJj7w9YDnfrspgPhKnWEt/YowtniAh0n+21ML5rHMvEwMh +HE+BmJnI2otb2yI5YXppgL/jSiYkqQ/s6r7hxiMwZu9fxXenEwF6pB5Kk5SbMRdp +unqIygn3JubgL0k14VWxjNeecJqcy7JM5ENHcei20TbQPgQ3tTLAAL/GhNhUNI99 +QC4GXj2NAgMBAAECggEBAKiJH9b9Kxhm9/BNhZ4bmvEMF7XcVv5bIAnRfwX3YdcK +Z6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y56ZS9RmgNEyz4HNXZcQ56inMNY6Z +M+o1wGEKJKLBtCJHZp7Sh8zy/RMI3naF4vc4r4BpK9k5ZAEL8gHVm9M5C2ZG8whc +r+Uu/g0P3m8w7INgsjxQy/U= +-----END PRIVATE KEY----- diff --git a/bankid/certs/__init__.py b/bankid/certs/__init__.py index 82b7198..427af6c 100644 --- a/bankid/certs/__init__.py +++ b/bankid/certs/__init__.py @@ -5,11 +5,11 @@ def get_test_cert_p12(): - return (Path(__file__).parent / "FPTestcert4_20220818.p12").resolve() + return (Path(__file__).parent / "FPTestcert4_20230629.p12").resolve() def get_test_cert_and_key(): return ( - (Path(__file__).parent / "FPTestcert4_20220818_cert.pem").resolve(), - (Path(__file__).parent / "FPTestcert4_20220818_key.pem").resolve(), + (Path(__file__).parent / "FPTestcert4_20230629_cert.pem").resolve(), + (Path(__file__).parent / "FPTestcert4_20230629_key.pem").resolve(), ) diff --git a/bankid/certutils.py b/bankid/certutils.py index f1074ab..0dbd1a3 100644 --- a/bankid/certutils.py +++ b/bankid/certutils.py @@ -15,7 +15,6 @@ from bankid.exceptions import BankIDError _TEST_CERT_PASSWORD = "qwerty123" -_TEST_CERT_URL = "https://www.bankid.com/assets/bankid/rp/FPTestcert4_20220818.p12" def create_bankid_test_server_cert_and_key(destination_path): diff --git a/bankid/jsonclient.py b/bankid/jsonclient.py index 4edfea1..6523ba1 100644 --- a/bankid/jsonclient.py +++ b/bankid/jsonclient.py @@ -74,10 +74,10 @@ def authenticate(self, end_user_ip, personal_number=None, requirement=None, **kw .. code-block:: json { - 'orderRef': 'ee3421ea-2096-4000-8130-82648efe0927', - 'autoStartToken': 'e8df5c3c-c67b-4a01-bfe5-fefeab760beb', - 'qrStartToken': '01f94e28-857f-4d8a-bf8e-6c5a24466658', - 'qrStartSecret': 'b4214886-3b5b-46ab-bc08-6862fddc0e06' + "orderRef": "ee3421ea-2096-4000-8130-82648efe0927", + "autoStartToken": "e8df5c3c-c67b-4a01-bfe5-fefeab760beb", + "qrStartToken": "01f94e28-857f-4d8a-bf8e-6c5a24466658", + "qrStartSecret": "b4214886-3b5b-46ab-bc08-6862fddc0e06" } :param end_user_ip: IP address of the user requesting @@ -131,10 +131,10 @@ def sign( .. code-block:: json { - 'orderRef': 'ee3421ea-2096-4000-8130-82648efe0927', - 'autoStartToken': 'e8df5c3c-c67b-4a01-bfe5-fefeab760beb', - 'qrStartToken': '01f94e28-857f-4d8a-bf8e-6c5a24466658', - 'qrStartSecret': 'b4214886-3b5b-46ab-bc08-6862fddc0e06' + "orderRef": "ee3421ea-2096-4000-8130-82648efe0927", + "autoStartToken": "e8df5c3c-c67b-4a01-bfe5-fefeab760beb", + "qrStartToken": "01f94e28-857f-4d8a-bf8e-6c5a24466658", + "qrStartSecret": "b4214886-3b5b-46ab-bc08-6862fddc0e06" } :param end_user_ip: IP address of the user requesting diff --git a/docs/conf.py b/docs/conf.py index 7d33fd4..aff8650 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,6 +14,12 @@ import sys import os +import re +import pathlib + +_version = {} +_version_file = pathlib.Path(__file__).parent.parent / "bankid" / "__version__.py" +exec(_version_file.read_text(encoding="utf-8"), _version) # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -51,7 +57,7 @@ # General information about the project. project = "PyBankID" -copyright = "2018, Henrik Blidh" +copyright = "2023, Henrik Blidh" author = "Henrik Blidh" # The version info for the project you're documenting, acts as replacement for @@ -59,9 +65,9 @@ # built documents. # # The short X.Y version. -version = "0.7.0" +version = _version['__version__'] # The full version, including alpha/beta/rc tags. -release = "0.7.0" +release = _version['__version__'] # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -113,7 +119,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -# html_theme = "sphinx_rtd_theme" +html_theme = "sphinx_rtd_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/requirements-dev.txt b/requirements-dev.txt index 55b033e..8a33915 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1 +1,3 @@ -pytest \ No newline at end of file +pytest +sphinx +sphinx-rtd-theme \ No newline at end of file