spakky-cryptography
spakky-cryptography는 암호화 utility와 서명된AuthContextSnapshot전파를 제공합니다. Password hash 검증과 snapshot sign/verify capability를spakky-authprovider contribution으로 연결합니다.
유지되는 Utility
Key,Base64Encoder,Hash,HMACICryptor,ISignerAes,Gcm,Rsa,AsymmetricKeyArgon2PasswordEncoder,BcryptPasswordEncoder,Pbkdf2PasswordEncoder,ScryptPasswordEncoder
JWT/OIDC token 검증은 이 패키지의 범위 밖이며 spakky-oidc가 담당합니다.
설치
pip install spakky-cryptography
Auth snapshot propagation이나 password provider로 쓰려면 spakky-auth와 함께 로드합니다.
pip install spakky-auth spakky-cryptography
설정
CryptographyAuthProviderConfig는 SPAKKY_CRYPTOGRAPHY_ 접두사의 환경변수를 읽습니다.
| 환경변수 | 의미 | 기본값 |
|---|---|---|
SPAKKY_CRYPTOGRAPHY_SNAPSHOT_KEY |
snapshot HMAC key, URL-safe base64 문자열 | 런타임 생성 32-byte key |
SPAKKY_CRYPTOGRAPHY_SNAPSHOT_KEY_ID |
signed snapshot envelope에 들어갈 key id | spakky-cryptography:default |
SPAKKY_CRYPTOGRAPHY_SNAPSHOT_TTL |
새 snapshot 유효 기간. 환경변수로 지정할 때는 초 단위 숫자 또는 Pydantic duration 형식을 사용 | 300 |
SPAKKY_CRYPTOGRAPHY_VERIFICATION_AVAILABLE |
snapshot verification provider 가용성 | true |
SPAKKY_CRYPTOGRAPHY_PASSWORD_AVAILABLE |
password hash/verify provider 가용성 | true |
운영에서는 모든 프로세스가 같은 snapshot을 검증할 수 있도록 SNAPSHOT_KEY를 명시적으로 고정하세요. 기본 key는 프로세스 시작마다 생성되므로 단일 프로세스 개발용입니다.
Auth Provider Capability
플러그인은 다음 capability를 구현하는 CryptographyAuthProvider를 등록합니다.
AuthCapability.SNAPSHOT_SIGNAuthCapability.SNAPSHOT_VERIFYAuthCapability.PASSWORD_HASHAuthCapability.PASSWORD_VERIFY
Snapshot verification은 누락, invalid, expired envelope을 CHALLENGE decision으로
매핑합니다. Provider를 사용할 수 없는 상태는 ERROR로 매핑합니다.
플러그인 등록
Base plugin entry point는 CryptographyAuthProviderConfig, CryptographyAuthProvider를 등록하고 다음 port를 같은 provider 구현체에 binding합니다.
IAuthContextSnapshotSignerIAuthContextSnapshotVerifierIPasswordHasherIPasswordVerifier
Auth feature contribution entry point는 spakky.contributions.spakky.auth group에 AuthProviderContribution capability metadata를 등록합니다. spakky-auth의 startup validation은 이 metadata로 snapshot/password capability provider count를 검증합니다.
사용 예
import spakky.auth
import spakky.plugins.cryptography
from spakky.core.application.application import SpakkyApplication
from spakky.core.application.application_context import ApplicationContext
app = (
SpakkyApplication(ApplicationContext())
.load_plugins(
include={
spakky.auth.PLUGIN_NAME,
spakky.plugins.cryptography.PLUGIN_NAME,
}
)
.start()
)
개발 검증
패키지 단위 검증은 해당 패키지 디렉토리에서 실행합니다.
uv run ruff format .
uv run ruff check .
uv run pyrefly check
uv run pytest
pytest는 각 패키지 pyproject.toml의 coverage 설정을 사용합니다.
라이선스
MIT License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spakky_cryptography-6.13.0.tar.gz.
File metadata
- Download URL: spakky_cryptography-6.13.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f167eefcc470f6953c657bb136431a528b291999870e91b3b97f695c5c13a6a5
|
|
| MD5 |
42c6cee59ec876c62f626f3581e66112
|
|
| BLAKE2b-256 |
55b8c9c4452c162f88f22e9aa82fe7d535cc259099f766bb54476bb70ce248fa
|
Provenance
The following attestation bundles were made for spakky_cryptography-6.13.0.tar.gz:
Publisher:
release.yml on E5presso/spakky-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spakky_cryptography-6.13.0.tar.gz -
Subject digest:
f167eefcc470f6953c657bb136431a528b291999870e91b3b97f695c5c13a6a5 - Sigstore transparency entry: 1968028258
- Sigstore integration time:
-
Permalink:
E5presso/spakky-framework@a56e768557ee4c0b927ff45f029608fa573377e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/E5presso
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a56e768557ee4c0b927ff45f029608fa573377e8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file spakky_cryptography-6.13.0-py3-none-any.whl.
File metadata
- Download URL: spakky_cryptography-6.13.0-py3-none-any.whl
- Upload date:
- Size: 26.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16a971e314b6e0330cd65f9767892c1e4e13641dd8f0efa809a0ad2152c74aaf
|
|
| MD5 |
8bed5b76f6347354caef9258b63e66d7
|
|
| BLAKE2b-256 |
a1095ccb521fedfec1d45e75a9ebd8ca69c1e35ea3fd348b57660db678f0b5e5
|
Provenance
The following attestation bundles were made for spakky_cryptography-6.13.0-py3-none-any.whl:
Publisher:
release.yml on E5presso/spakky-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spakky_cryptography-6.13.0-py3-none-any.whl -
Subject digest:
16a971e314b6e0330cd65f9767892c1e4e13641dd8f0efa809a0ad2152c74aaf - Sigstore transparency entry: 1968028392
- Sigstore integration time:
-
Permalink:
E5presso/spakky-framework@a56e768557ee4c0b927ff45f029608fa573377e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/E5presso
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a56e768557ee4c0b927ff45f029608fa573377e8 -
Trigger Event:
workflow_dispatch
-
Statement type: