Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ansd/lastpass-go
Golang client for LastPass
https://github.com/ansd/lastpass-go
api go golang lastpass library
Last synced: 11 days ago
JSON representation
Golang client for LastPass
- Host: GitHub
- URL: https://github.com/ansd/lastpass-go
- Owner: ansd
- License: mit
- Created: 2019-07-11T14:26:39.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-05-25T14:48:47.000Z (over 1 year ago)
- Last Synced: 2024-10-13T18:44:20.068Z (26 days ago)
- Topics: api, go, golang, lastpass, library
- Language: Go
- Homepage:
- Size: 277 KB
- Stars: 34
- Watchers: 5
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - lastpass-go - Go client library for the [LastPass](https://www.lastpass.com/) API. (Third-party APIs / Utility/Miscellaneous)
- awesome-go-extra - lastpass-go - 07-11T14:26:39Z|2022-07-20T17:19:36Z| (Third-party APIs / Fail injection)
README
[![Documentation](https://godoc.org/github.com/ansd/lastpass-go?status.svg)](https://pkg.go.dev/github.com/ansd/lastpass-go)
[![Go Report Card](https://goreportcard.com/badge/github.com/ansd/lastpass-go)](https://goreportcard.com/report/github.com/ansd/lastpass-go)
![Test](https://github.com/ansd/lastpass-go/workflows/Test/badge.svg)
# 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:
```shell
$ go get github.com/ansd/lastpass-go
```Import:
```go
import "github.com/ansd/lastpass-go"
```## Usage
Below, error handling is excluded for brevity.
See [examples](./examples) directory for more examples.
```go
// 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](https://github.com/detunized/lastpass-ruby)
and a clone of [mattn/lastpass-go](https://github.com/mattn/lastpass-go).This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
This repository's `ecb` (Electronic Codebook) package contains code which is "Copyright 2013 The Go Authors. All rights reserved."