Skip to content

Commit 9470cd1

Browse files
committed
fix pyo3
1 parent 1692aa9 commit 9470cd1

7 files changed

Lines changed: 30 additions & 27 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: CI/CD
22

33
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
tags:
9+
- "v*"
10+
pull_request:
411
workflow_dispatch:
512
inputs:
613
publish_to_pypi:
@@ -27,7 +34,7 @@ jobs:
2734
- name: Setup Python
2835
uses: actions/setup-python@v5
2936
with:
30-
python-version: "3.12"
37+
python-version: "3.8"
3138

3239
- name: Build Wheels
3340
uses: PyO3/maturin-action@v1
@@ -38,7 +45,7 @@ jobs:
3845
args: >
3946
--release
4047
--out dist
41-
--interpreter python3.12
48+
--find-interpreter
4249
manylinux: auto
4350

4451
- uses: actions/upload-artifact@v4

‎Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[package]
22
name = "ciphertoken"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
edition = "2021"
55

66
[lib]
77
name = "ciphertoken"
88
crate-type = ["cdylib"]
99

1010
[dependencies]
11-
pyo3 = { version = "0.28.3", features = [
11+
pyo3 = { version = "0.20.3", features = [
1212
"extension-module",
1313
"abi3-py38"
1414
] }
15-
pyo3-asyncio = { version = "0.20", features = ["tokio-runtime"] }
15+
pyo3-asyncio = { version = "0.20.0", features = ["tokio-runtime"] }
1616

1717
jsonwebtoken = "9.2"
1818
serde = { version = "1.0", features = ["derive"] }

‎ciphertoken/__init__.pyi‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from .secret import secret_key, secret_key_with_size, generate_hmac_secret, generate_hmac_secret_async,generate_rsa_keypair
2-
from .utils import DEFAULT_SECRET_SIZE, EDDSA,ES256,ES384,HS256,HS384,HS512,MIN_SECRET_SIZE,PS256,PS384,PS512,RS256,RS384,RS512,TOKEN_ACCESS,TOKEN_REFRESH
3-
from .time import seconds, minutes, hours, days, weeks,now
4-
5-
from .ciphertoken import CipherToken, is_jwt_format,validate_jwt_format
1+
from .algorithms import EDDSA, ES256, ES384, HS256, HS384, HS512, PS256, PS384, PS512, RS256, RS384, RS512
2+
from .ciphertoken import CipherToken, is_jwt_format, validate_jwt_format
3+
from .secret import generate_hmac_secret, generate_hmac_secret_async, generate_rsa_keypair, secret_key, secret_key_with_size
4+
from .time import days, hours, minutes, now, seconds, weeks
5+
from .utils import DEFAULT_SECRET_SIZE, MIN_SECRET_SIZE, TOKEN_ACCESS, TOKEN_REFRESH

‎ciphertoken/ciphertoken.pyi‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
from typing import Optional, Dict, Any, Tuple, Awaitable
1+
from typing import Any, Dict, Optional, Tuple
22

33
class CipherToken:
44
def __init__(self, secret: str, algorithm: str, access_ttl: int, refresh_ttl: int) -> None: ...
5-
6-
# Sync methods
5+
76
def access(self, user_id: int, extra_payload: Optional[Dict[str, Any]] = None) -> str: ...
87
def refresh(self, user_id: int, extra_payload: Optional[Dict[str, Any]] = None) -> str: ...
98
def decode(self, token: str) -> Dict[str, Any]: ...
@@ -12,15 +11,12 @@ class CipherToken:
1211
def inspect(self, token: str) -> Dict[str, Any]: ...
1312
def remaining_time(self, token: str) -> Optional[int]: ...
1413
def algorithm_name(self) -> str: ...
15-
16-
# Async methods
17-
async def access_async(self, user_id: int, extra_payload: Optional[Dict[str, Any]] = None) -> Awaitable[str]: ...
18-
async def refresh_async(self, user_id: int, extra_payload: Optional[Dict[str, Any]] = None) -> Awaitable[str]: ...
19-
async def decode_async(self, token: str) -> Awaitable[Dict[str, Any]]: ...
20-
async def verify_async(self, token: str) -> Awaitable[bool]: ...
21-
async def rotation_async(self, refresh_token: str, extra_payload: Optional[Dict[str, Any]] = None) -> Awaitable[Tuple[str, str]]: ...
2214

23-
# Utility functions
15+
async def access_async(self, user_id: int, extra_payload: Optional[Dict[str, Any]] = None) -> str: ...
16+
async def refresh_async(self, user_id: int, extra_payload: Optional[Dict[str, Any]] = None) -> str: ...
17+
async def decode_async(self, token: str) -> Dict[str, Any]: ...
18+
async def verify_async(self, token: str) -> bool: ...
19+
async def rotation_async(self, refresh_token: str, extra_payload: Optional[Dict[str, Any]] = None) -> Tuple[str, str]: ...
20+
2421
def is_jwt_format(token: str) -> bool: ...
2522
def validate_jwt_format(token: str) -> bool: ...
26-

‎ciphertoken/secret.pyi‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from typing import Awaitable, Tuple, Optional
1+
from typing import Optional, Tuple
22

33
def secret_key() -> str: ...
44
def secret_key_with_size(size: int) -> str: ...
55
def generate_hmac_secret(size: int) -> str: ...
6-
async def generate_hmac_secret_async(size: int) -> Awaitable[str]: ...
7-
def generate_rsa_keypair(bits: Optional[int] = 2048) -> Tuple[str, str]:...
6+
async def generate_hmac_secret_async(size: int) -> str: ...
7+
def generate_rsa_keypair(bits: Optional[int] = 2048) -> Tuple[str, str]: ...

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "ciphertoken"
7-
version = "0.1.4"
7+
version = "0.1.5"
88
description = "High-performance token and crypto utilities written in Rust with PyO3"
99
readme = "README.md"
1010
requires-python = ">=3.8"

0 commit comments

Comments
 (0)