Skip to content

Commit

Permalink
Add 3.13 wheel and update dev deps (#14)
Browse files Browse the repository at this point in the history
Adds the 3.13 wheel to the CI build and test and update the build deps
to the latest versions.
  • Loading branch information
jborean93 authored Sep 17, 2024
1 parent a93a42a commit c2b62a5
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
rm sspilib-*.tar.gz
- name: build wheel
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.21.0
env:
CIBW_ARCHS: all
CIBW_TEST_SKIP: '*_arm64'
Expand Down Expand Up @@ -116,6 +116,7 @@ jobs:
- '3.10'
- '3.11'
- '3.12'
- '3.13.0-rc.2'
python-arch:
- x86
- x64
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
repos:
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 24.8.0
hooks:
- id: black

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.11.2
hooks:
- id: mypy
exclude: ^setup.py|build/
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
+ **Breaking Change** - The constructor arguments for `sspi.ClientSecurityContext` and `sspi.SeverSecurityContext` have made the `credential` argument non-optional and moved to the first positional argument
+ This is in reflection of the `credential` actually being mandatory
+ Update documentation for `accept_security_context` and `initialize_security_context` to properly reflect that the credential must be specified on the first call to those functions
+ Update `sspi-rs` to `0.13.0`

## 0.1.0 - 2024-10-04

Expand Down
2 changes: 1 addition & 1 deletion build_helpers/cibuildwheel-before-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -ex
# sspi-rs doesn't have versions, this just needs to be bumped when new changes
# are needed.
# https://github.com/Devolutions/sspi-rs
DEVOLUTIONS_COMMIT_ID="f349cf5c3df35b9e362291bf1526aba4c33d9b0c"
DEVOLUTIONS_COMMIT_ID="98e34308377877a6601a07f39da8c329a1e6b08e"

# Aligns to a release on https://github.com/unicode-org/icu/tree/main
ICU_VERSION="73.2"
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13"
]

[project.urls]
Expand Down
6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
black==23.9.1
isort==5.12.0
mypy==1.5.1
black==24.8.0
isort==5.13.2
mypy==1.11.2
pre-commit
pytest
3 changes: 1 addition & 2 deletions src/sspilib/_sec_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ def _step_internal(
self,
input_buffers: raw.SecBufferDesc | None,
output_buffers: raw.SecBufferDesc | None,
) -> tuple[int, int]:
...
) -> tuple[int, int]: ...

def _get_secbuffer_data(
self,
Expand Down
8 changes: 8 additions & 0 deletions src/sspilib/raw/_context_attributes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,23 @@ class SecPkgContextPackageInfo(SecPkgContext):
@property
def capabilities(self) -> SecurityPackageCapability:
"""Set of capabilities of the security package."""

@property
def version(self) -> int:
"""The version of the package."""

@property
def rpcid(self) -> int:
"""The DCE RPC identifier if appropriate."""

@property
def max_token(self) -> int:
"""The maximum size, in bytes, of the token."""

@property
def name(self) -> str:
"""The name of the security package."""

@property
def comment(self) -> str:
"""Additional information about the security package."""
Expand Down Expand Up @@ -92,12 +97,15 @@ class SecPkgContextSizes(SecPkgContext):
@property
def max_token(self) -> int:
"""Maximum security token sizes."""

@property
def max_signature(self) -> int:
"""Maximum signature size."""

@property
def block_size(self) -> int:
"""Preferred integral size of messages."""

@property
def security_trailer(self) -> int:
"""Size of the security trailer appended to messages."""
Expand Down
4 changes: 4 additions & 0 deletions src/sspilib/raw/_credential.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,19 @@ class WinNTAuthIdentity(AuthIdentity):
@property
def username(self) -> str | None:
"""The identity username."""

@property
def domain(self) -> str | None:
"""The identity domain."""

@property
def password(self) -> str | None:
"""The identity password."""

@property
def flags(self) -> WinNTAuthFlags:
"""Custom flags associated with the identity."""

@property
def package_list(self) -> str | None:
"""A comma-separated list of security packages that are available to the Negotiate provider."""
Expand Down
2 changes: 2 additions & 0 deletions src/sspilib/raw/_credential_attributes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ class SecPkgCredKdcProxySettings(SecPkgCred):
@property
def version(self) -> int:
"""The version of the internal structure."""

@property
def flags(self) -> KdcProxySettingsFlags:
"""Flags for the Kerberos proxy settings."""

@property
def proxy_server(self) -> str | None:
"""The proxy server value."""
Expand Down
13 changes: 13 additions & 0 deletions src/sspilib/raw/_security_buffer.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ class SecBufferDesc(t.Iterable):
) -> None: ...
def __iter__(self) -> t.Iterator[SecBuffer]:
"""Creates an iterable of the contained buffers."""

def __len__(self) -> int:
"""Returns the number of buffers in this structure."""

def __getitem__(self, key: int) -> SecBuffer:
"""Gets the buffer at the specified index."""

@property
def version(self) -> int:
"""The version number of the structure."""
Expand Down Expand Up @@ -144,15 +147,19 @@ class SecBuffer:
@property
def count(self) -> int:
"""The length of the buffer."""

@property
def data(self) -> bytes:
"""A copy of the buffer bytes."""

@property
def buffer_type(self) -> SecBufferType:
"""The buffer type."""

@property
def buffer_flags(self) -> SecBufferFlags:
"""The buffer flags."""

def dangerous_get_view(self) -> memoryview:
"""The buffer memoryview.
Expand Down Expand Up @@ -204,18 +211,23 @@ class SecChannelBindings:
@property
def initiator_addr_type(self) -> int:
"""The initiator address type."""

@property
def initiator_addr(self) -> bytes | None:
"""A copy of the initiator address or None if not present."""

@property
def acceptor_addr_type(self) -> int:
"""The acceptor address type."""

@property
def acceptor_addr(self) -> bytes | None:
"""A copy of the acceptor address or None if not present."""

@property
def application_data(self) -> bytes | None:
"""A copy of the application data or None if not present."""

def get_sec_buffer_copy(self) -> SecBuffer:
"""The SecBuffer value.
Expand All @@ -232,6 +244,7 @@ class SecChannelBindings:
Returns:
SecBuffer: The security buffer with the copied memory.
"""

def dangerous_get_sec_buffer(self) -> SecBuffer:
"""The SecBuffer value.
Expand Down
1 change: 1 addition & 0 deletions tests/raw/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def test_verify_failure(
assert e.value.winerror == -2146893041 # SEC_E_MESSAGE_ALTERED


@pytest.mark.skipif(os.name != "nt", reason="Encryption not working sspi-rs")
def test_encrypt_and_decrypt(
authenticated_contexts: tuple[sr.CtxtHandle, sr.CtxtHandle],
) -> None:
Expand Down
3 changes: 3 additions & 0 deletions tests/test_sec_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def test_sec_context_signatures(
c_ctx.verify(server_data, s_signature)


@pytest.mark.skipif(os.name != "nt", reason="Encryption not working in sspi-rs")
def test_wrap_with_bytearray(
authenticated_contexts: tuple[sspilib.ClientSecurityContext, sspilib.ServerSecurityContext],
) -> None:
Expand All @@ -105,6 +106,7 @@ def test_wrap_with_bytearray(
assert bytes(b_wrapped_data) != wrapped_data


@pytest.mark.skipif(os.name != "nt", reason="Encryption not working in sspi-rs")
def test_wrap_with_writable_memoryview(
authenticated_contexts: tuple[sspilib.ClientSecurityContext, sspilib.ServerSecurityContext],
) -> None:
Expand All @@ -127,6 +129,7 @@ def test_wrap_with_writable_memoryview(
assert bytes(b_wrapped_data) != wrapped_data


@pytest.mark.skipif(os.name != "nt", reason="Encryption not working in sspi-rs")
def test_wrap_with_readonly_memoryview(
authenticated_contexts: tuple[sspilib.ClientSecurityContext, sspilib.ServerSecurityContext],
) -> None:
Expand Down

0 comments on commit c2b62a5

Please sign in to comment.