Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cmd/passless/src/authenticator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,17 @@ impl<S: CredentialStorage + 'static> AuthenticatorService<S> {
/// Create a new authenticator service
pub fn new(storage: S, security_config: SecurityConfig) -> Result<Self> {
let options = AuthenticatorOptions {
rk: true, // Resident keys (passkeys)
up: true, // User presence
uv: Some(true), // User verification
plat: true, // Platform authenticator
client_pin: None, // Client PIN support
pin_uv_auth_token: Some(true), // PIN UV auth token
cred_mgmt: Some(true), // Credential management enabled
rk: true,
up: true,
uv: Some(true), // Support user verification via request_up callback
plat: true,
client_pin: Some(false),
pin_uv_auth_token: Some(true),
cred_mgmt: Some(true),
bio_enroll: None,
large_blobs: None,
ep: None,
always_uv: Some(true),
always_uv: Some(false), // Don't require UV for all operations
make_cred_uv_not_required: Some(true),
};

Expand Down
15 changes: 14 additions & 1 deletion cmd/passless/src/storage/local/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use log::{info, warn};

/// Ensure local storage directory is initialized
///
/// If the directory doesn't exist, prompts the user via desktop notification
/// If the directory doesn't exist, prompts user via desktop notification
/// to confirm creation.
pub fn ensure_initialized(storage_path: &Path) -> Result<()> {
if storage_path.exists() {
Expand All @@ -26,6 +26,19 @@ pub fn ensure_initialized(storage_path: &Path) -> Result<()> {
storage_path
);

// Check for E2E test mode (only available in debug builds)
#[cfg(debug_assertions)]
{
if std::env::var("PASSLESS_E2E_AUTO_ACCEPT_UV").is_ok() {
info!("E2E test mode: Auto-creating local storage directory");
fs::create_dir_all(storage_path).map_err(|e| {
Error::Storage(format!("Failed to create storage directory: {}", e))
})?;
info!("Created local storage directory at {:?}", storage_path);
return Ok(());
}
}

match show_yes_no_notification(
"Local Storage Not Initialized",
&format!(
Expand Down
18 changes: 18 additions & 0 deletions cmd/passless/src/storage/pass/init/uninitialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@ impl Uninitialized {
}

pub fn prompt_user(self) -> Result<DirectoryCreated> {
// Check for E2E test mode (only available in debug builds)
#[cfg(debug_assertions)]
{
if std::env::var("PASSLESS_E2E_AUTO_ACCEPT_UV").is_ok() {
info!("E2E test mode: Auto-creating password store directory");
if !self.store_path.exists() {
fs::create_dir_all(&self.store_path).map_err(|e| {
Error::Storage(format!("Failed to create store directory: {}", e))
})?;
info!("Created store directory at {:?}", self.store_path);
}
return Ok(DirectoryCreated {
store_path: self.store_path,
gpg_backend: self.gpg_backend,
});
}
}

match show_yes_no_notification(
"Password Store Not Initialized",
&format!(
Expand Down
13 changes: 13 additions & 0 deletions cmd/passless/src/storage/tpm/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ pub fn ensure_initialized(storage_path: &Path) -> Result<()> {

info!("TPM storage directory does not exist at {:?}", storage_path);

// Check for E2E test mode (only available in debug builds)
#[cfg(debug_assertions)]
{
if std::env::var("PASSLESS_E2E_AUTO_ACCEPT_UV").is_ok() {
info!("E2E test mode: Auto-creating TPM storage directory");
fs::create_dir_all(storage_path).map_err(|e| {
Error::Storage(format!("Failed to create storage directory: {}", e))
})?;
info!("Created TPM storage directory at {:?}", storage_path);
return Ok(());
}
}

match show_yes_no_notification(
"TPM Storage Not Initialized",
&format!(
Expand Down
Loading
Loading