Skip to content

Commit

Permalink
Merge pull request #518 from openlawlibrary/sbojanic/move-yubikey-uti…
Browse files Browse the repository at this point in the history
…ls-v2

Sbojanic/move yubikey utils v2
  • Loading branch information
n-dusan authored Aug 29, 2024
2 parents 0143ffa + 0c12ee0 commit ee6df3c
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 19 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ and this project adheres to [Semantic Versioning][semver].

### Fixed

## [0.30.3] - 08/29/2024

### Added

### Changed

### Fixed

- Move `yubikey_utils` module to include it in wheel ([516])

[516]: https://github.com/openlawlibrary/taf/pull/516

## [0.30.2] - 08/20/2024

### Added
Expand Down Expand Up @@ -1142,7 +1154,8 @@ and this project adheres to [Semantic Versioning][semver].

[keepachangelog]: https://keepachangelog.com/en/1.0.0/
[semver]: https://semver.org/spec/v2.0.0.html
[unreleased]: https://github.com/openlawlibrary/taf/compare/v0.30.2...HEAD
[unreleased]: https://github.com/openlawlibrary/taf/compare/v0.30.3...HEAD
[0.30.3]: https://github.com/openlawlibrary/taf/compare/v0.30.2...v0.30.3
[0.30.2]: https://github.com/openlawlibrary/taf/compare/v0.30.1...v0.30.2
[0.30.1]: https://github.com/openlawlibrary/taf/compare/v0.30.0...v0.30.1
[0.30.0]: https://github.com/openlawlibrary/taf/compare/v0.29.1...v0.30.0
Expand Down
13 changes: 1 addition & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from setuptools import find_packages, setup
from importlib.util import find_spec
import sys

PACKAGE_NAME = "taf"
VERSION = "0.30.2"
VERSION = "0.30.3"
AUTHOR = "Open Law Library"
AUTHOR_EMAIL = "[email protected]"
DESCRIPTION = "Implementation of archival authentication"
Expand Down Expand Up @@ -112,14 +111,4 @@ def finalize_options(self):
],
}


try:
tests_exist = find_spec("taf.tests")
except ModuleNotFoundError:
tests_exist = False # type: ignore
if tests_exist:
kwargs["entry_points"]["pytest11"] = (
["taf_yubikey_utils = taf.tests.yubikey_utils"],
)

setup(**kwargs)
3 changes: 2 additions & 1 deletion taf/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -1647,7 +1647,8 @@ def _find_url(path, url):
self._validate_url(url)
else:
# resolve paths and deduplicate
urls = list({_find_url(self.path, url) for url in urls})
# list is sorted to guarantee deterministic order of elements
urls = sorted((_find_url(self.path, url) for url in urls), reverse=True)
return urls


Expand Down
2 changes: 1 addition & 1 deletion taf/tests/test_repository_tool/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import_rsa_publickey_from_file,
)
from taf.repository_tool import Repository
from taf.tests.yubikey_utils import (
from taf.tools.yubikey.yubikey_utils import (
Root1YubiKey,
Root2YubiKey,
Root3YubiKey,
Expand Down
2 changes: 1 addition & 1 deletion taf/tests/test_repository_tool/test_repository_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import taf.yubikey as yk
from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME
from taf.tests import TEST_WITH_REAL_YK
from taf.tests.yubikey_utils import VALID_PIN
from taf.tools.yubikey.yubikey_utils import VALID_PIN
from taf.utils import to_tuf_datetime_format


Expand Down
2 changes: 1 addition & 1 deletion taf/tests/test_yubikey/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from taf.tests.conftest import KEYSTORE_PATH

from pytest import fixture
from taf.tests.yubikey_utils import TargetYubiKey, _yk_piv_ctrl_mock
from taf.tools.yubikey.yubikey_utils import TargetYubiKey, _yk_piv_ctrl_mock


def pytest_configure(config):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import datetime
import random
import secrets
from contextlib import contextmanager

from cryptography import x509
Expand All @@ -19,7 +19,7 @@ def __init__(self, priv_key_path, pub_key_path, scheme, serial=None, pin=VALID_P
self.priv_key_pem = priv_key_path.read_bytes()
self.pub_key_pem = pub_key_path.read_bytes()

self._serial = serial if serial else random.randint(100000, 999999)
self._serial = serial if serial else secrets.randbelow(900000) + 100000
self._pin = pin

self.scheme = scheme
Expand Down

0 comments on commit ee6df3c

Please sign in to comment.