pub mod bootstrap;
pub mod rotate;
pub mod rules_export;
pub mod validate;
pub use bootstrap::{
BootstrapError, BootstrapInput, BootstrapOutcome, BoundSecretSink, RunBootstrapError,
ZeroizedAdmin, run_bootstrap,
};
pub use rotate::{RotateOutcome, RunRotateError, run_rotate};
pub use rules_export::{RulesExportError, RulesPack, RulesPackEntry, write_rules_pack};
pub use validate::{
Capability, CapabilityCheck, CapabilityStatus, RequirementsReport, ValidateError,
ValidationContext, validate_requirements,
};
use chrono::{DateTime, Utc};
pub trait DeployerCredentials: std::fmt::Debug + Send + Sync {
fn requires_credentials_material(&self) -> bool {
true
}
fn required_capabilities(&self) -> Vec<Capability>;
fn validate(&self, ctx: &ValidationContext<'_>) -> RequirementsReport;
fn bootstrap(&self, input: &BootstrapInput<'_>) -> Result<BootstrapOutcome, BootstrapError>;
fn rollback_bound_material(&self, _env_id: &greentic_deploy_spec::EnvId) {}
fn rotate_at(&self, _material: &str) -> Option<DateTime<Utc>> {
None
}
fn rotation_due(&self, material: &str, now: DateTime<Utc>) -> bool {
match self.rotate_at(material) {
Some(rotate_at) => now >= rotate_at,
None => true,
}
}
}