keychain

package
v0.0.0-...-416c7cc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/.

Index

Constants

View Source
const (
	// KeyChainName is the name of the keychain used to store
	// passwords
	KeyChainName = "clisso"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultKeychain

type DefaultKeychain struct{}

DefaultKeychain provides a wrapper around github.com/tmc/keyring and provides defaults and abstractions for clisso to get passwords

func (DefaultKeychain) Get

func (DefaultKeychain) Get(provider string) (pw []byte, err error)

Get will, once given a valid provider, return the password associated in order for logins to happen. If any error occours while talking to the keychain provider, we silently swallow it and just ask the user for the password instead. Error could be anything from access denied to password not found.

func (DefaultKeychain) Set

func (DefaultKeychain) Set(provider string, password []byte) (err error)

Set takes a provider in an argument, and a password from STDIN, and sets it in a keychain, should one exist.

type Keychain

type Keychain interface {
	Get(string) ([]byte, error)
	Set(string, []byte) error
}

Keychain provides an interface to allow for the easy testing of this package

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL