sshkey

package
v0.5.18 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package sshkey manages SSH keys for organizations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*otfhttp.Client
}

Client is an HTTP client for the SSH key API, used by agent runners.

func (*Client) GetSSHKeyPrivateKey added in v0.5.18

func (c *Client) GetSSHKeyPrivateKey(ctx context.Context, id resource.TfeID) ([]byte, error)

type CreateOptions

type CreateOptions struct {
	Organization organization.Name `schema:"organization_name"`
	Name         string
	PrivateKey   string `schema:"private-key"`
}

CreateOptions are the options for creating a new SSH key.

type Options

type Options struct {
	DB         *sql.DB
	Responder  *tfeapi.Responder
	Logger     logr.Logger
	Authorizer *authz.Authorizer
}

type SSHKey

type SSHKey struct {
	ID           resource.TfeID    `db:"ssh_key_id"`
	Name         string            `db:"name"`
	Organization organization.Name `db:"organization_name"`
}

SSHKey is an SSH key belonging to an organization.

func New

func New(opts CreateOptions) (*SSHKey, []byte, error)

func (*SSHKey) LogValue

func (key *SSHKey) LogValue() slog.Value

LogValue implements slog.LogValuer.

type SSHKeyClient added in v0.5.18

type SSHKeyClient = Client

Alias client to permit embedding it with other clients in a struct without a name clash.

type SSHKeyService added in v0.5.18

type SSHKeyService = Service

Alias service to permit embedding it with other services in a struct without a name clash.

type Service

type Service struct {
	logr.Logger
	*authz.Authorizer
	// contains filtered or unexported fields
}

func NewService

func NewService(opts Options) *Service

func (*Service) AddHandlers

func (s *Service) AddHandlers(r *mux.Router)

func (*Service) CreateSSHKey added in v0.5.18

func (s *Service) CreateSSHKey(ctx context.Context, opts CreateOptions) (*SSHKey, error)

func (*Service) DeleteSSHKey added in v0.5.18

func (s *Service) DeleteSSHKey(ctx context.Context, id resource.TfeID) (*SSHKey, error)

func (*Service) GetSSHKey added in v0.5.18

func (s *Service) GetSSHKey(ctx context.Context, id resource.TfeID) (*SSHKey, error)

func (*Service) GetSSHKeyPrivateKey added in v0.5.18

func (s *Service) GetSSHKeyPrivateKey(ctx context.Context, id resource.TfeID) ([]byte, error)

func (*Service) ListSSHKeys added in v0.5.18

func (s *Service) ListSSHKeys(ctx context.Context, org organization.Name) ([]*SSHKey, error)

func (*Service) UpdateSSHKey added in v0.5.18

func (s *Service) UpdateSSHKey(ctx context.Context, id resource.TfeID, opts UpdateOptions) (*SSHKey, error)

type TFESSHKey

type TFESSHKey struct {
	ID        resource.TfeID `jsonapi:"primary,ssh-keys"`
	CreatedAt time.Time      `jsonapi:"attribute" json:"created-at"`
	UpdatedAt time.Time      `jsonapi:"attribute" json:"updated-at"`
	Name      string         `jsonapi:"attribute" json:"name"`
}

TFESSHKey represents an SSH key in the TFE API.

type UpdateOptions

type UpdateOptions struct {
	Name *string
}

UpdateOptions are the options for updating an SSH key.

Jump to

Keyboard shortcuts

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