addkey

package
v0.0.0-...-f587dad Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package addkey defines a custom job handler that will take 2 parameters: - a public key - a time duration The handler will add the key to the ~/.authorized_keys file where it will be valid according to the expiration time passed in. If the same public key had been added already in the past those previous entries will be removed to avoid cluttering the file. The expiration feature relies on the `expiry-time` option available in OpenSSH since version 7.7 (https://www.openssh.com/txt/release-7.7)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddPublicKeyCmd

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

func (*AddPublicKeyCmd) Execute

func (cmd *AddPublicKeyCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus

func (*AddPublicKeyCmd) Name

func (*AddPublicKeyCmd) Name() string

func (*AddPublicKeyCmd) SetFlags

func (cmd *AddPublicKeyCmd) SetFlags(f *flag.FlagSet)

func (*AddPublicKeyCmd) Synopsis

func (*AddPublicKeyCmd) Synopsis() string

func (*AddPublicKeyCmd) Usage

func (*AddPublicKeyCmd) Usage() string

type KeysStore

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

func NewKeysStore

func NewKeysStore(authorizedKeys io.Reader) *KeysStore

func (KeysStore) AddKey

func (p KeysStore) AddKey(publicKey string, expirationDuration time.Duration) (string, error)

Jump to

Keyboard shortcuts

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