mirror of
https://github.com/bitwarden/browser
synced 2026-02-10 21:50:15 +00:00
Merge branch 'nathan/autofill-fix' into anders/passkeys
This commit is contained in:
1
.github/workflows/build-desktop.yml
vendored
1
.github/workflows/build-desktop.yml
vendored
@@ -22,6 +22,7 @@ on:
|
||||
- 'main'
|
||||
- 'rc'
|
||||
- 'hotfix-rc-desktop'
|
||||
- 'nathan/autofill-fix'
|
||||
paths:
|
||||
- 'apps/desktop/**'
|
||||
- 'libs/**'
|
||||
|
||||
@@ -56,19 +56,19 @@ pub fn path(name: &str) -> std::path::PathBuf {
|
||||
.position(|c| c.as_os_str() == "Containers");
|
||||
|
||||
// If the app is sanboxed, we need to use the App Group directory
|
||||
if let Some(position) = containers_position {
|
||||
// We want to use App Groups in /Users/<user>/Library/Group Containers/LTZ2PFU5D6.com.bitwarden.desktop,
|
||||
// so we need to remove all the components after the user. We can use the previous position to do this.
|
||||
while home.components().count() > position - 1 {
|
||||
home.pop();
|
||||
}
|
||||
|
||||
let tmp = home.join("Library/Group Containers/LTZ2PFU5D6.com.bitwarden.desktop/tmp");
|
||||
|
||||
// The tmp directory might not exist, so create it
|
||||
let _ = std::fs::create_dir_all(&tmp);
|
||||
return tmp.join(format!("app.{name}"));
|
||||
let position = containers_position.unwrap_or(4);
|
||||
|
||||
// We want to use App Groups in /Users/<user>/Library/Group Containers/LTZ2PFU5D6.com.bitwarden.desktop,
|
||||
// so we need to remove all the components after the user. We can use the previous position to do this.
|
||||
while home.components().count() > position - 1 {
|
||||
home.pop();
|
||||
}
|
||||
|
||||
let tmp = home.join("Library/Group Containers/LTZ2PFU5D6.com.bitwarden.desktop/tmp");
|
||||
|
||||
// The tmp directory might not exist, so create it
|
||||
let _ = std::fs::create_dir_all(&tmp);
|
||||
return tmp.join(format!("app.{name}"));
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
|
||||
@@ -151,16 +151,18 @@ class CredentialProviderViewController: ASCredentialProviderViewController {
|
||||
override func loadView() {
|
||||
let view = NSView()
|
||||
// Hide the native window since we only need the IPC connection
|
||||
view.isHidden = true
|
||||
// view.isHidden = true
|
||||
self.view = view
|
||||
}
|
||||
|
||||
override func prepareInterfaceForExtensionConfiguration() {
|
||||
logger.log("[autofill-extension] prepareInterfaceForExtensionConfiguration called")
|
||||
client.sendNativeStatus(key: "request-sync", value: "")
|
||||
self.extensionContext.completeExtensionConfigurationRequest()
|
||||
}
|
||||
|
||||
override func provideCredentialWithoutUserInteraction(for credentialRequest: any ASCredentialRequest) {
|
||||
logger.log("[autofill-extension] provideCredentialWithoutUserInteraction called \(credentialRequest.description)")
|
||||
let timeoutTimer = createTimer()
|
||||
|
||||
if let request = credentialRequest as? ASPasskeyCredentialRequest {
|
||||
@@ -227,16 +229,14 @@ class CredentialProviderViewController: ASCredentialProviderViewController {
|
||||
logger.log("[autofill-extension] provideCredentialWithoutUserInteraction2 called wrong")
|
||||
self.extensionContext.cancelRequest(withError: BitwardenError.Internal("Invalid authentication request"))
|
||||
}
|
||||
|
||||
/*
|
||||
Implement this method if provideCredentialWithoutUserInteraction(for:) can fail with
|
||||
ASExtensionError.userInteractionRequired. In this case, the system may present your extension's
|
||||
UI and call this method. Show appropriate UI for authenticating the user then provide the password
|
||||
by completing the extension request with the associated ASPasswordCredential.
|
||||
|
||||
|
||||
// Implement this method if provideCredentialWithoutUserInteraction(for:) can fail with
|
||||
// ASExtensionError.userInteractionRequired. In this case, the system may present your extension's
|
||||
// UI and call this method. Show appropriate UI for authenticating the user then provide the password
|
||||
// by completing the extension request with the associated ASPasswordCredential.
|
||||
override func prepareInterfaceToProvideCredential(for credentialIdentity: ASPasswordCredentialIdentity) {
|
||||
logger.log("[autofill-extension] prepareInterfaceToProvideCredential called \(credentialIdentity)")
|
||||
}
|
||||
*/
|
||||
|
||||
private func createTimer() -> DispatchWorkItem {
|
||||
// Create a timer for 600 second timeout
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.developer.authentication-services.autofill-credential-provider</key>
|
||||
<true/>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<key>com.apple.developer.authentication-services.autofill-credential-provider</key>
|
||||
<true/>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>LTZ2PFU5D6.com.bitwarden.desktop</string>
|
||||
</array>
|
||||
|
||||
@@ -10,5 +10,9 @@
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>LTZ2PFU5D6.com.bitwarden.desktop</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
Reference in New Issue
Block a user