secflow-sdk
SecFlow Runtime/Data API로 secret에 접근하는 Python SDK입니다. 애플리케이션 런타임 코드에서 계정에 묶인 SDK 토큰으로만 쓰고, Admin API 세션 토큰은 쓰지 않습니다. 평문 secret 값을 출력하거나 로그·트레이스에 남기거나 저장하지 않습니다.
요구 사항
Python 3.10 이상. 표준 라이브러리만 쓰며 다른 의존성은 없습니다.
설치
python -m pip install secflow-sdk
런타임 환경에 SECFLOW_SDK_TOKEN(필수), SECFLOW_BASE_URL(기본값 https://secflow.intflow.dev), SECFLOW_TARGET_ENVIRONMENT(기본값 dev)를 둡니다. 원격 주소는 https://만 허용합니다.
사용 예
from secflow_sdk import SecFlowClient, SecFlowHttpError, SecFlowItemError
SECRET_REF = "secret://dev/example-service/token/app-config"
client = SecFlowClient.from_env()
try:
secret_value = client.resolve_text(SECRET_REF)
except (SecFlowItemError, SecFlowHttpError) as error:
raise RuntimeError(f"SecFlow resolve failed: code={error.code} retryable={error.retryable}") from error
configure_application(secret_value)
클라이언트 인스턴스 하나를 재사용합니다. 바이너리 값은 resolve_bytes(), 여러 값은 resolve_many()나 성공한 항목만 돌려주는 resolve_many_partial()을 씁니다.
캐시 provider / 자동 갱신
from secflow_sdk import SecFlowSecretProvider
provider = SecFlowSecretProvider(client, ttl_seconds=300)
secret_value = provider.get_text(SECRET_REF)
캐시 미스, TTL 만료, invalidate() 뒤에 갱신합니다. 항목 단위 실패는 캐시 항목을 지우고 오래된 값을 돌려주지 않습니다.
메타데이터, 검증, lease
metadata = client.metadata([SECRET_REF])[SECRET_REF]
resolved = client.resolve_many([SECRET_REF])[SECRET_REF]
client.revoke_leases([resolved.lease_id], reason="job_completed")
비동기 애플리케이션
SecFlowClient는 동기 방식이므로 asyncio에서는 워커 스레드에서 호출합니다.
async def load_secret(secret_ref: str) -> str:
return await asyncio.to_thread(client.resolve_text, secret_ref)
문서
- Python SDK의 설정, 메서드, 오류, 재시도, 안전한 로깅: https://github.com/yeon3724/secflow/blob/main/docs/sdk.md
- 저장소:
yeon3724/secflow(읽기 전용 미러intflow/secflow)
라이선스
MIT
Metadata
Release files for secflow-sdk 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| secflow_sdk-0.1.11-py3-none-any.whl | Python 3 | none | any | Details for secflow_sdk-0.1.11-py3-none-any.whl |
Release files / secflow_sdk-0.1.11-py3-none-any.whl
| Download URL | secflow_sdk-0.1.11-py3-none-any.whl |
|---|---|
| Size | 23.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf3f4b0b42e06e68ebfa8c21e35fd3ecc4ff18ea672e2453d1f29b8976e65c5e
|
|
BLAKE2b-256 checksum How to use checksums |
ad7d4307aa975a63934a3836d3b250766ac0b69c49f8714ca6b22a1027a9f7ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logSecurity for secflow-sdk 0.1.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
1 file in this release has been uploaded with provenance metadata.
Attestation for secflow_sdk-0.1.11-py3-none-any.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.