All Projects → ansd → lastpass-go

ansd / lastpass-go

Licence: MIT license
Golang client for LastPass

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to lastpass-go

Chezmoi
Manage your dotfiles across multiple diverse machines, securely.
Stars: ✭ 5,590 (+17932.26%)
Mutual labels:  lastpass
terraform-provider-lastpass
Terraform Lastpass provider
Stars: ✭ 55 (+77.42%)
Mutual labels:  lastpass
rofi-lpass
Lastpass integration with Rofi
Stars: ✭ 19 (-38.71%)
Mutual labels:  lastpass
buttercup-importer
🎣 3rd-party archive importer for Buttercup
Stars: ✭ 39 (+25.81%)
Mutual labels:  lastpass
emacs-lastpass
Emacs LastPass command wrapper.
Stars: ✭ 25 (-19.35%)
Mutual labels:  lastpass

Documentation Go Report Card Test

Go client for LastPass

Features

  • login with
    • user name and master password
    • two-factor authentication with out-of-band mechanism such as push notification to LastPass Authenticator or Duo Security
    • two-factor authentication with one-time password from LastPass Authenticator, Google Authenticator, Microsoft Authenticator, YubiKey, Duo Security, Sesame, etc.
    • trust: after first successful login with two-factor authentication, the second factor can be skipped
  • create account
  • read accounts
  • update account
  • delete account
  • create / read / update / delete account in shared folder
  • logout

Documentation

https://pkg.go.dev/github.com/ansd/lastpass-go

Installation

Install:

$ go get github.com/ansd/lastpass-go

Import:

import "github.com/ansd/lastpass-go"

Usage

Below, error handling is excluded for brevity.

See examples directory for more examples.

// authenticate with LastPass servers
client, _ := lastpass.NewClient(context.Background(), "user name", "master password")

// two-factor authentication with one-time password as second factor:
// client, _ := lastpass.NewClient(context.Background(), "user name", "master password", lastpass.WithOneTimePassword("123456"))

account := &lastpass.Account{
	Name:     "my site",
	Username: "my user",
	Password: "my pwd",
	URL:      "https://myURL",
	Group:    "my group",
	Notes:    "my notes",
}

// Add() account
client.Add(context.Background(), account)

// read all Accounts()
accounts, _ := client.Accounts(context.Background())

// Update() account
account.Password = "updated password"
client.Update(context.Background(), account)

// Delete() account
client.Delete(context.Background(), account)

// Logout()
client.Logout(context.Background())

Notes

This repository is a port of detunized/lastpass-ruby and a clone of mattn/lastpass-go.

This project is licensed under the MIT License - see the LICENSE file for details.

This repository's ecb (Electronic Codebook) package contains code which is "Copyright 2013 The Go Authors. All rights reserved."

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].