Skip to main content

Module credentials

Module credentials 

Source
Expand description

Multi-tenant provider credential subsystem.

Provides encryption-at-rest (encryption) for per-user provider API keys. Storage (store), scoped resolution (resolver), and the wiring ProviderService are layered on top in subsequent steps.

Host source policy is independent of encrypted storage availability. Every ordinary provider capture must consume a policy decision.

Re-exports§

pub use policy::CredentialTenancyPolicy;
pub use policy::ProviderCredentialPolicyConfig;
pub use policy::CredentialSourceDecision;
pub use policy::CredentialSource;
pub use policy::CredentialPolicyError;
pub use owner::CredentialOwnerBinding;
pub use migration::PrincipalCredentialOwnerMapping;
pub use encryption::CredentialEncryption;
pub use resolver::CredentialResolver;
pub use resolver::ResolvedCredential;
pub use principal_store::CredentialMigrationError;
pub use principal_store::CredentialMigrationReceipt;
pub use principal_store::LegacyCredentialOwnerMapping;
pub use principal_store::PrincipalCredentialStore;
pub use store::SurrealCredentialStore;
pub use store::CredentialMetadata;
pub use store::CredentialRecord;
pub use store::CredentialScope;
pub use store::CredentialStore;
pub use store::InMemoryCredentialStore;
pub use store::SharedCredentialStore;

Modules§

encryption
AES-256-GCM encryption for provider API keys stored at rest.
maintenance
Explicit local metadata initialization. Never invoked by ordinary startup.
migration
Metadata-only migration inventory and conditional-copy contracts.
owner
Host-created credential namespace bindings. General principal keys stay unchanged.
policy
Independent host credential policy, present even without encrypted storage.
principal_store
Principal credentials and explicit legacy mapping transactions. The separate table/map is the ownership discriminator. An encoded owner key in the old subject-only namespace would still collide with arbitrary subjects.
resolver
Scoped credential resolution.
store
Storage for per-scope encrypted provider credentials.

Structs§

ProviderService
Wiring object that owns the credential store + encryption and hands out a CredentialResolver. Attached to AppState/RunManager as Option<Arc<ProviderService>>; source policy remains mandatory when absent.