Skip to content

Add 'Search Bitwarden Vault Items' Extension - #67

Merged
PitNikola merged 24 commits into
raycast:mainfrom
pomdtr:bitwarden
Oct 25, 2021
Merged

PitNikola merged 24 commits into
raycast:mainfrom
pomdtr:bitwarden

Conversation

@pomdtr

@pomdtr pomdtr commented Oct 17, 2021 •

Copy link
Copy Markdown
Contributor

Description

Add a bitwarden extension allowing to search items from your vault.

Type of change

  • New extension

Screencast

image

Checklist

@PitNikola PitNikola added the new extension Label for PRs with new extensions label Oct 17, 2021

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice first pass! Most of my comments are around UX, but one big code-related takeaway is that we should never be calling a bw CLI command inline within one of the extension's commands. It would be much safer and more reusable to instead create a new file containing a legitimate bw SDK, that exports functions wrapping those CLI calls. Let me know if that's unclear, or if you want some help getting started on an implementation for that.

Comment thread extensions/bitwarden/package.json Outdated
"commands": [
{
"name": "list",
"title": "Search Vault Items",

ghost Oct 18, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"title": "Search Vault Items",
"title": "Search Vault",

ghost Oct 19, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with Phil, "Search Vault" sounds better, items doesn't add much value here.

Comment thread extensions/bitwarden/package.json Resolved
Comment thread extensions/bitwarden/package.json Resolved
Comment thread extensions/bitwarden/package.json Resolved
Comment thread extensions/bitwarden/package.json Resolved
Comment thread extensions/bitwarden/src/list.tsx Resolved
Comment thread extensions/bitwarden/src/list.tsx Resolved
Comment thread extensions/bitwarden/src/list.tsx Resolved
Comment thread extensions/bitwarden/src/list.tsx Resolved
Comment thread extensions/bitwarden/src/list.tsx Resolved
@pomdtr
pomdtr marked this pull request as ready for review October 19, 2021 10:04
@pomdtr pomdtr changed the title Add Bitwarden Extension Add 'Search Bitwarden Vault Items' Extension Oct 19, 2021

ghost left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty cool! Thanks for building it @pomdtr!
@PSalant726, thanks for reviewing the code and giving helpful suggestions. Highly appreciate it since I'm not Bitwarden user myself.

I suggested some minor nits and we are ready to merge afterwards.

Comment thread extensions/bitwarden/package.json Resolved
Comment thread extensions/bitwarden/package.json Outdated
"commands": [
{
"name": "list",
"title": "Search Vault Items",

ghost Oct 19, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with Phil, "Search Vault" sounds better, items doesn't add much value here.

@pomdtr

ghost commented Oct 19, 2021

Copy link
Copy Markdown
Contributor Author

Done! Thanks a lot to both of you for the review.

@pomdtr
pomdtr requested a review from PitNikola October 19, 2021 21:36
@PSalant726

ghost commented Oct 19, 2021

Copy link
Copy Markdown
Contributor

If it's ok with everyone, I would really like to review this again before it gets merged. I should have a chance tomorrow.

@pomdtr

ghost commented Oct 19, 2021

Copy link
Copy Markdown
Contributor Author

If it's ok with everyone, I would really like to review this again before it gets merged. I should have a chance tomorrow.

Go ahead, there is no rush :)

@PitNikola

ghost commented Jan 20, 2022

Copy link
Copy Markdown
Member

@PSalant726, @pomdtr, this question popped up on Twitter. Could you please help me with understanding whether this is an expected behavior, and whether it is potentially an issue?

For instance, it seems that once it has been opened the Vault doesn't automatically locks itself. Can this become a potential security breach?

@PSalant726

ghost commented Jan 20, 2022

Copy link
Copy Markdown
Contributor

I replied on Twitter. To close the loop here: it's correct that the vault does not auto-lock based on any system event (ex. "sleep" or "screen saver"), but that's because of the nature of Raycast and extensions. Raycast does not support long-lived processes that can monitor/listen for those events, and execute scripts when they occur (nor do I believe it should). Instead, there is a lock-vault.ts script that enables a user to manually lock an unlocked vault. This is undoubtedly less secure than an automatic lock mechanism, but it's no less secure than leaving your entire system unlocked when you walk away from your computer, and it's the best we were able to do within the limitations of Raycast.

@pomdtr

ghost commented Jan 20, 2022

Copy link
Copy Markdown
Contributor Author

The extension use the same logic as the cli. I store the session token, and check if it is still valid when the user launch the extension. If it is not the case, the extension ask the user for a password.

@pomdtr

ghost commented Jan 20, 2022

Copy link
Copy Markdown
Contributor Author

We could add an artificial auto-lock feature by storing when the last session token was generated.

@PSalant726

ghost commented Jan 20, 2022

Copy link
Copy Markdown
Contributor

@pomdtr

We could add an artificial auto-lock feature by storing when the last session token was generated.

In general I think this would be nice to add, as long as it were adequately configurable. Still I don't think it completely addresses the concern from the tweet. My assumption is that the user is attempting to find feature-parity between the official Bitwarden apps and this Raycast extension. We simply won't be able to expire a CLI token based on system events unless the macOS keychain supported it. Even then, that would only affect the validity of the token with respect to the extension. If a user were to submit CLI commands directly, and include the "expired" token, those commands would still succeed because Bitwarden itself has not deemed the token invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new extension Label for PRs with new extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants