Skip to content

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

License

Notifications You must be signed in to change notification settings

amadotejada/unopass-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unopass-go

Written by Amado Tejada

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

Python version: HERE

Install

go get -u github.com/amadotejada/unopass-go

Usage

package main

import (
	"fmt"
	"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

Returns:
(string) the value of the specified fields within the specified item

OPTIONAL: To sign out of the 1Password CLI session, call 'unopass.Signout(true)'
*/

func main() {
	username := unopass.Secret("personal", "server", "username", true)
	password := unopass.Secret("personal", "server", "password", true)
	fmt.Println(username, password, unopass.Signout(true))
}

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

License

Stars

Watchers

Forks

Releases

No releases published

Languages