Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to new actions. #13

Merged
merged 4 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
whoami
make deps build
ls -lah bin/launchr
./bin/launchr login --url=http://***.git --username="***" --password="***" --keyring-passphrase="***"
./bin/launchr keyring:login --url=http://***.git --username="***" --password="***" --keyring-passphrase="***"
commands-ok:
name: Ensure main commands do not fail
Expand All @@ -39,9 +39,9 @@ jobs:
whoami
make deps build
ls -lah bin/launchr
./bin/launchr set vaultpass --value "***" --keyring-passphrase "***"
./bin/launchr keyring:set vaultpass "***" --keyring-passphrase "***"
ls -lah .launchr/keyring.yaml.age
./bin/launchr unset vaultpass --keyring-passphrase "***"
./bin/launchr keyring:unset vaultpass --keyring-passphrase "***"
ls -lah .launchr/keyring.yaml.age
go-linters:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FIRST_GOPATH:=$(firstword $(subst :, ,$(GOPATH)))

# Build available information.
GIT_HASH:=$(shell git log --format="%h" -n 1 2> /dev/null)
GIT_BRANCH:=$(shell git branch 2> /dev/null | grep '*' | cut -f2 -d' ')
GIT_BRANCH:=$(shell git rev-parse --abbrev-ref HEAD)
APP_VERSION:="$(GIT_BRANCH)-$(GIT_HASH)"
GOPKG:=github.com/launchrctl/launchr

Expand Down
15 changes: 15 additions & 0 deletions action.login.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
runtime: plugin
action:
title: "Keyring: Log in"
description: >-
Logs in to services like git, docker, etc.
options:
- name: url
title: URL
default: ""
- name: username
title: Username
default: ""
- name: password
title: Password
default: ""
16 changes: 16 additions & 0 deletions action.logout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
runtime: plugin
action:
title: "Keyring: Log out"
description: >-
Logs out from a service
arguments:
- name: url
title: URL
description: URL to log out
minLength: 1
options:
- name: all
title: All
description: Logs out from all services
type: boolean
default: false
4 changes: 4 additions & 0 deletions action.purge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
runtime: plugin
action:
title: "Keyring: Purge"
description: Remove existing keyring file
14 changes: 14 additions & 0 deletions action.set.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
runtime: plugin
action:
title: "Keyring: Set"
description: >-
Store new key-value pair to keyring
arguments:
- name: key
title: Key
description: Key of the value
required: true
minLength: 1
- name: value
title: Value
description: Value
16 changes: 16 additions & 0 deletions action.unset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
runtime: plugin
action:
title: "Keyring: Unset"
description: >-
Removes key-value pair from keyring
arguments:
- name: key
title: Key
description: Key to delete
minLength: 1
options:
- name: all
title: All
description: "Removes all key-pairs"
type: boolean
default: false
2 changes: 1 addition & 1 deletion askpass.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (a AskPassWithTerminal) NewPass() (string, error) {
func (a AskPassWithTerminal) readPass(prompt string) (string, error) {
var bytePassword []byte
var err error
err = withTerminal(func(in, out *os.File) error {
err = withTerminal(func(in, _ *os.File) error {
fmt.Print(prompt)
bytePassword, err = term.ReadPassword(int(in.Fd()))
fmt.Println()
Expand Down
44 changes: 22 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
module github.com/launchrctl/keyring

go 1.23.1
go 1.23.2

toolchain go1.23.4

require (
filippo.io/age v1.2.0
github.com/launchrctl/launchr v0.16.4
github.com/spf13/cobra v1.8.1
golang.org/x/term v0.25.0
filippo.io/age v1.2.1
github.com/launchrctl/launchr v0.17.1
golang.org/x/term v0.28.0
gopkg.in/yaml.v3 v3.0.1
)

require (
atomicgo.dev/cursor v0.2.0 // indirect
atomicgo.dev/keyboard v0.2.9 // indirect
atomicgo.dev/schedule v0.1.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/containerd/console v1.0.4 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v27.3.1+incompatible // indirect
github.com/docker/docker v27.5.0+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
Expand All @@ -32,7 +33,6 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/knadh/koanf v1.5.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/lithammer/fuzzysearch v1.1.8 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
Expand All @@ -44,33 +44,33 @@ require (
github.com/moby/sys/signal v0.7.1 // indirect
github.com/moby/sys/user v0.3.0 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/moby/term v0.5.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pterm/pterm v0.12.79 // indirect
github.com/pterm/pterm v0.12.80 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.13.1 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect
go.opentelemetry.io/otel v1.31.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect
go.opentelemetry.io/otel v1.33.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 // indirect
go.opentelemetry.io/otel/metric v1.31.0 // indirect
go.opentelemetry.io/otel/trace v1.31.0 // indirect
go.opentelemetry.io/otel/metric v1.33.0 // indirect
go.opentelemetry.io/otel/trace v1.33.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/mock v0.5.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
Loading
Loading