Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace lastpass cli with 1password cli #39

Merged
merged 4 commits into from
Nov 20, 2023
Merged

replace lastpass cli with 1password cli #39

merged 4 commits into from
Nov 20, 2023

Conversation

Brunope
Copy link
Contributor

@Brunope Brunope commented Nov 16, 2023

No description provided.

@Brunope Brunope marked this pull request as ready for review November 16, 2023 00:50
@Brunope Brunope linked an issue Nov 16, 2023 that may be closed by this pull request
Copy link
Contributor

@naswierczek naswierczek left a comment

Choose a reason for hiding this comment

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

I feel like the right call here is to add support for 1password and throw some deprecated warnings around lpass.

I know that Elijah Howells uses the CLI version of records-mover and thus is still reliant on lpass to retrieve core secrets. I had to install the 1password CLI myself so I'm pretty sure other people will have to as well. There's certain to be other people that use records-mover in a similar way.

Copy link

@monikered monikered left a comment

Choose a reason for hiding this comment

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

This is looking great. I've left some notes on your comments and the tests that were deleted. Basically, as long as we're going the quick and dirty route of swapping out the guts without relabeling everything, the disclaimer comment needs to be more strongly worded and harder to miss. 😉

.python-version Outdated
@@ -1 +1 @@
db_facts-3.8.4
db_facts-5.0.0

Choose a reason for hiding this comment

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

This looks like it normally refers to the Python version. Should that be updated here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Great catch! Yes, this change should be reverted.

This refers to the python version selected for the local development python virtual environment. The venv gets created in deps.sh.

FWIW, circleci ignores this file so it doesn't affect any of those pipelines, only local dev.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh woops yeah i messed this file up mb

tests/test_lpass.py Show resolved Hide resolved
Comment on lines -31 to -37
@patch('db_facts.lpass.check_output')
def test_lpass_field_url(self, mock_check_output):
mock_check_output.return_value = "fakeurl\n".encode("utf-8")
out = lpass.lpass_field('my_name', 'url')
mock_check_output.\
assert_called_with(['lpass', 'show', '--url', 'my_name'])
assert out == "fakeurl"

Choose a reason for hiding this comment

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

same deal as with the Notes field test function -- I'd prefer for this to throw an error rather than be deleted entirely

Comment on lines +22 to +25
# This used to use the lastpass-cli to pull credentials. But we've moved
# from lastpass to 1password. This command retrieves the fields in the
# same format from 1password instead.

Choose a reason for hiding this comment

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

Can you make this comment even more explicit? I'd like it to make clear that ALL functions referencing LastPass/lpass are being redirected to pull data from 1Password instead. The names have not been changed in the interest of time. This needs to be an unmissable comment for anyone working on this in the future, so you can go wild with all caps.

@@ -4,61 +4,47 @@


Choose a reason for hiding this comment

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

Please add an impossible-to-miss comment here with the same disclaimer from lpass.py

@monikered
Copy link

@naswierczek

I feel like the right call here is to add support for 1password and throw some deprecated warnings around lpass.

I know that Elijah Howells uses the CLI version of records-mover and thus is still reliant on lpass to retrieve core secrets. I had to install the 1password CLI myself so I'm pretty sure other people will have to as well. There's certain to be other people that use records-mover in a similar way.

Ngl throwing some warnings in the code a couple months ago would have been the more elegant solution! But as you mentioned in the slack thread, there have been ample warnings about the deprecation of LastPass elsewhere so this isn't a surprise to anyone. Right now, just getting this to work with 1Password is the top priority.

I do agree that it's confusing to have things improperly named, and I'd love to fix that in the next release. Some of the functions/variables referring to LastPass might be more maintainable if they referred to the broader category "PasswordManager" instead (rather than replacing with "1Password"). Let's come back to names in a couple weeks.

Everyone is going to have to install the 1Password CLI regardless of our work on this library, so that shouldn't be a factor here.

@naswierczek
Copy link
Contributor

@monikered Is having 1password CLI on everyones' laptop a ticket for alectronica to work on?

@monikered
Copy link

monikered commented Nov 17, 2023

@naswierczek

Is having 1password CLI on everyones' laptop a ticket for alectronica to work on?

Yes! They're also looking at options for distributing these updates.

@naswierczek
Copy link
Contributor

@monikered

Yes! They're also looking at options for distributing these updates.

Great! :) Is there already a ticket for that alectronica and if so can we link it here?

Also, should we create a jira ticket for this work in addition to the git issue you opened? I don't have an opinion either way but I wanted to ask the question in case there were additional processes we needed to follow. :)

@Brunope
Copy link
Contributor Author

Brunope commented Nov 17, 2023

The new db-facts homebrew formula can list the 1password cli as a dependency so it would auto install when updating db-facts via homebrew

tests/test_lpass.py Outdated Show resolved Hide resolved
tests/test_lpass.py Outdated Show resolved Hide resolved
Copy link

@monikered monikered left a comment

Choose a reason for hiding this comment

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

LGTM!

@Brunope Brunope merged commit 4ddd21f into master Nov 20, 2023
1 check passed
@Brunope Brunope deleted the onepassword branch November 20, 2023 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning: LastPass deprecation
4 participants