Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unopass-go

unopass-go is a Go package that allows you to retrieve secrets from the 1Password CLI using your biometrics.

Python version: HERE

Install

mkdir myproject && cd myproject
go mod init myproject
go get github.com/amadotejada/unopass-go/unopass

Usage

package main

import (
	"fmt"
	"log"

	"github.com/amadotejada/unopass-go/unopass"
)

/*
Parameters:

    VAULT (string): the name of the 1Password vault
    ITEM (string): the name of the item within the specified vault
    FIELD (string): the name of the field to retrieve within the specified item
    DEAUTHORIZE (bool): if true, sign out of the 1Password CLI session after the read

Returns:
(string, error) the value of the field, or an error
*/

func main() {
	username, err := unopass.Secret("personal", "server", "username", false)
	if err != nil {
		log.Fatal(err)
	}
	password, err := unopass.Secret("personal", "server", "password", true)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(username, password)
}

Requirements:

Security

Authorization expires after 10 minutes of inactivity in the session. There's a hard limit of 12 hours, after which you must reauthorize.

About

unopass-go is a Go package that allows you to retrieve secrets from the 1Password CLI

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages