provider

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BitwardenDefaultPrefix default prefix for BitwardenItem.
	BitwardenDefaultPrefix = "SSHKeys__"
	// BitwardenCommand base command for Bitwarden.
	BitwardenCommand = "bw"
)
View Source
const (
	// OnePasswordDefaultPrefix default prefix for OnePasswordItem.
	//nolint:gosec // not security issue.
	OnePasswordDefaultPrefix = "SSHKeys__"
	// OnePasswordCommand base command for OnePassword.
	OnePasswordCommand = "op"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitwarden

type Bitwarden struct {
	Commander internal.Commander
}

Bitwarden for connection.

func (Bitwarden) Add

func (b Bitwarden) Add(item *Item) error

Add adds given item to Bitwarden.

func (Bitwarden) Get

func (b Bitwarden) Get(name string) (*Item, error)

Get gets Item from Bitwarden with given item name.

func (Bitwarden) GetName added in v0.8.0

func (b Bitwarden) GetName() string

GetName returns name of the provider.

func (Bitwarden) List

func (b Bitwarden) List() ([]*Item, error)

List lists all added SSH keys.

func (Bitwarden) Sync

func (b Bitwarden) Sync() error

Sync syncs Bitwarden vault.

type BitwardenItem

type BitwardenItem struct {
	ID    *string `json:"id"`
	Type  int     `json:"type"`
	Name  string  `json:"name"`
	Notes string  `json:"notes"`
	Login string  `json:"login"`
}

BitwardenItem is item adapter for provider Item.

type ExecutionFailedError

type ExecutionFailedError struct {
	Command string
	Message string
}

ExecutionFailedError occurs when an execution fails.

func (ExecutionFailedError) Error

func (e ExecutionFailedError) Error() string

type Field

type Field struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Field is custom fields under Item.

type Interface added in v0.8.0

type Interface interface {
	GetName() string
	Add(item *Item) error
	Get(name string) (*Item, error)
	List() ([]*Item, error)
}

Interface is an interface for all providers.

type Item

type Item struct {
	ID     string  `json:"id,omitempty"`
	Name   string  `json:"name"`
	Values []Field `json:"value"`
}

Item is a secure item of provider.

func (Item) EncodeValues

func (i Item) EncodeValues() (string, error)

EncodeValues encodes Values.

type ItemAlreadyExistsError added in v0.9.0

type ItemAlreadyExistsError struct {
	Name string
}

ItemAlreadyExistsError occurs when given item is not found in the provder.

func (ItemAlreadyExistsError) Error added in v0.9.0

func (e ItemAlreadyExistsError) Error() string

type NotFoundError added in v0.9.0

type NotFoundError struct {
	Name *string
}

NotFoundError occurs when no provider found.

func (NotFoundError) Error added in v0.9.0

func (e NotFoundError) Error() string

type OnePassword

type OnePassword struct {
	Commander internal.Commander
}

OnePassword for connection.

func (OnePassword) Add

func (o OnePassword) Add(item *Item) error

Add adds given item to OnePassword.

func (OnePassword) Get

func (o OnePassword) Get(name string) (*Item, error)

Get gets Item from OnePassword with given item name.

func (OnePassword) GetName added in v0.8.0

func (o OnePassword) GetName() string

GetName returns name of the provider.

func (OnePassword) List

func (o OnePassword) List() ([]*Item, error)

List lists all added SSH keys.

type OnePasswordItem

type OnePasswordItem struct {
	UUID     *string                 `json:"uuid"`
	Details  OnePasswordItemDetails  `json:"details"`
	Overview OnePasswordItemOverview `json:"overview"`
}

OnePasswordItem is item adapter for provider OnePasswordItem.

type OnePasswordItemDetails

type OnePasswordItemDetails struct {
	NotesPlain *string `json:"notesPlain"`
}

OnePasswordItemDetails is item adapter for provider Item.

type OnePasswordItemOverview

type OnePasswordItemOverview struct {
	Title *string `json:"title"`
}

OnePasswordItemOverview is item adapter for provider OnePasswordItem.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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