Skip to main content

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)

문서

라이선스

MIT

Metadata

Release files for secflow-sdk 0.1.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for secflow-sdk 0.1.12
File Interpreter ABI Platform Actions
secflow_sdk-0.1.12-py3-none-any.whl Python 3 none any Details for secflow_sdk-0.1.12-py3-none-any.whl

Release files / secflow_sdk-0.1.12-py3-none-any.whl

Download URL secflow_sdk-0.1.12-py3-none-any.whl
Size 23.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bca49e55532a76a3b6be6a5d7265747f68c1d8f1d5bc614c0dc897c698f559d6
BLAKE2b-256 checksum
How to use checksums
8df43cc4a5b1c2eb6c4403b284e59fdc9e94c723c39bb28e887c210485409bb8
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 23, 2026.

Transparency log

Security for secflow-sdk 0.1.12

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.12-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 23, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page