How amals367/credweave works
CredWeave is a provider-agnostic Python library for managing credential pools; it does not make upstream network requests. The main workflow is: an application acquires a lease, uses the credential with its own client, then reports an outcome so CredWeave can update lifecycle state and scheduling eligibility. The graph includes documented scheduling and failover capabilities. Some implementation relationships are supported by the SOURCE INDEX rather than full excerpts; unsampled details are not inferred.
Main entry points: pool.py Credential pool · composition.py Default composition · lifecycle.py Lifecycle engine · _eligibility.py Eligibility filtering
Components 23
Public API
- CredWeave API
src/credweave/__init__.py
Pool Orchestration
- Credential pool
src/credweave/application/services/pool.py - Strategy port
src/credweave/application/ports/strategy.py - Credential source port
src/credweave/application/ports/credential_source.py - Clock port
src/credweave/application/ports/clock.py - Default composition
src/credweave/_internal/composition.py
Credential Lifecycle
- Credential model
src/credweave/domain/models.py - Outcome model
src/credweave/domain/outcomes.py - Lifecycle states
src/credweave/domain/enums.py - Domain errors
src/credweave/domain/errors.py - Backoff policy
src/credweave/domain/backoff.py - Lifecycle engine
src/credweave/application/services/lifecycle.py - State store port
src/credweave/application/ports/state_store.py
Strategies and Adapters
- Round-robin
src/credweave/strategies/round_robin.py - Weighted selection
src/credweave/strategies/weighted.py - Failover selection
src/credweave/strategies/failover.py - Other strategies
src/credweave/strategies - Eligibility filtering
src/credweave/strategies/_eligibility.py - Static source
src/credweave/infrastructure/sources/static.py - Memory state store
src/credweave/infrastructure/stores/memory.py - System clock
src/credweave/infrastructure/clocks/system.py
Other components
- Client application
- Provider API
Connections 28
- Client application → CredWeave API: acquires lease
README.md - CredWeave API → Credential pool: exposes pool
src/credweave/__init__.py - Client application → Provider API: makes request
README.md - Client application → CredWeave API: reports outcome
README.md - Credential pool → Strategy port: selects credential
src/credweave/application/services/pool.py - Credential pool → Credential source port: loads credentials
src/credweave/application/services/pool.py - Credential pool → State store port: reads and updates
src/credweave/application/services/pool.py - Credential pool → Clock port: reads time
src/credweave/application/services/pool.py - Credential pool → Lifecycle engine: delegates transitions
src/credweave/application/services/pool.py - Default composition → Credential pool: constructs default
src/credweave/_internal/composition.py - Default composition → Memory state store: configures store
src/credweave/_internal/composition.py - Default composition → Static source: configures source
src/credweave/_internal/composition.py - Default composition → System clock: configures clock
src/credweave/_internal/composition.py - Default composition → Round-robin: configures strategy
src/credweave/_internal/composition.py - Credential pool → Credential model: leases credential
README.md - Credential pool → Outcome model: accepts report
README.md - Lifecycle engine → Backoff policy: computes cooldown
src/credweave/application/services/lifecycle.py - Lifecycle engine → Lifecycle states: transitions state
src/credweave/application/services/lifecycle.py - Memory state store → Lifecycle engine: applies transitions
src/credweave/infrastructure/stores/memory.py - Memory state store → State store port: implements port
src/credweave/infrastructure/stores/memory.py - Static source → Credential source port: implements port
src/credweave/infrastructure/sources/static.py - System clock → Clock port: implements port
src/credweave/infrastructure/clocks/system.py - Round-robin → Eligibility filtering: filters candidates
src/credweave/strategies/round_robin.py - Weighted selection → Eligibility filtering: filters candidates
src/credweave/strategies/weighted.py - Failover selection → Eligibility filtering: filters candidates
src/credweave/strategies/failover.py - Other strategies → Eligibility filtering: shares filtering
src/credweave/strategies/failover.py - Outcome model → Lifecycle states: uses outcome types
src/credweave/domain/outcomes.py - Backoff policy → Domain errors: raises configuration errors
src/credweave/domain/backoff.py