filesystem

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package filesystem provides a plugin implementing the secret plugin protocol for creating/resolving secrets from the local filesystem. It's only intended to use for local development or testing. Do not use it in production.

Index

Constants

View Source
const (
	SECRET_FOLDER                          = "secrets"
	FileModeSensitiveDirectory os.FileMode = 0700
	FileModeSensitiveWritable  os.FileMode = 0600
)
View Source
const PluginKey = plugins.PluginInterface + ".porter.filesystem"

Variables

This section is empty.

Functions

func NewPlugin

func NewPlugin(c *config.Config, rawCfg interface{}) plugin.Plugin

Types

type Plugin

type Plugin struct {
	secrets.Store
}

Plugin is the plugin wrapper for accessing secrets from a local filesystem.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements an file system secrets store for testing and local development.

func NewStore

func NewStore(c *config.Config) *Store

NewStore returns a new instance of the filesystem secret store.

func (*Store) Close

func (s *Store) Close() error

Close implements the Close method on the secret plugins' interface.

func (*Store) Connect

func (s *Store) Connect(ctx context.Context) error

Connect initializes the plugin for use. The plugin itself is responsible for ensuring it was called. Close is called automatically when the plugin is used by Porter.

func (*Store) Create

func (s *Store) Create(ctx context.Context, keyName string, keyValue string, value string) error

Create implements the Create method on the secret plugins' interface.

func (*Store) Resolve

func (s *Store) Resolve(ctx context.Context, keyName string, keyValue string) (string, error)

Resolve implements the Resolve method on the secret plugins' interface.

func (*Store) SetSecretDir

func (s *Store) SetSecretDir() (string, error)

SetSecretDir configures the directory path for storing secrets.

Jump to

Keyboard shortcuts

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