provider

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 12 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"
)
View Source
const (
	// S3ProviderName is provider name for s3.
	S3ProviderName = "s3"
)

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(options GetOptions) (*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(_ ListOptions) ([]*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 GetOptions added in v0.12.0

type GetOptions struct {
	Name   string
	Bucket *string
}

GetOptions is options for Get method.

type Interface added in v0.8.0

type Interface interface {
	GetName() string
	Add(item *Item) error
	Get(options GetOptions) (*Item, error)
	List(options ListOptions) ([]*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"`
	Bucket *string
}

Item is a secure item of provider.

func (Item) EncodeValues

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

EncodeValues encodes Values.

func (Item) MarshalValues added in v0.12.0

func (i Item) MarshalValues() ([]byte, error)

MarshalValues encodes the Values to JSON bytes.

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 ListOptions added in v0.12.0

type ListOptions struct {
	Bucket *string
}

ListOptions is options for List method.

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(options GetOptions) (*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(_ ListOptions) ([]*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.

type S3 added in v0.12.0

type S3 struct {
	API aws.S3Interface
}

S3 is s3 provider.

func NewS3Provider added in v0.12.0

func NewS3Provider() S3

NewS3Provider inits new provider.

func (S3) Add added in v0.12.0

func (p S3) Add(item *Item) error

Add adds given item to S3.

func (S3) Get added in v0.12.0

func (p S3) Get(options GetOptions) (*Item, error)

Get gets Item from S3 with given item name.

func (S3) GetName added in v0.12.0

func (p S3) GetName() string

GetName returns name of the provider.

func (S3) List added in v0.12.0

func (p S3) List(options ListOptions) ([]*Item, error)

List lists all added SSH keys from S3.

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