Skip to content

Commit e9de734

Browse files
committed
feat: re-architecturing
1 parent fa7ff07 commit e9de734

64 files changed

Lines changed: 125 additions & 128 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Engine (cross platform)
1+
name: Runtime (cross platform)
22
on:
33
push:
44
branches:
@@ -7,33 +7,33 @@ on:
77
- 'v*'
88
pull_request:
99
paths:
10-
- 'engine/**'
10+
- 'runtime/**'
1111
jobs:
1212
tests-windows:
1313
permissions:
1414
id-token: write
1515
contents: read
16-
name: WindowsEngineTests
16+
name: WindowsRuntimeTests
1717
runs-on: windows-latest
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: ./.github/actions/go
2121
with:
2222
app_id: ${{ vars.DOCKER_READ_APP_ID }}
2323
app_private_key: ${{ secrets.DOCKER_READ_APP_PRIVATE_KEY }}
24-
- name: Test engine
25-
run: make engine-unit-tests
24+
- name: Test runtime
25+
run: make runtime-unit-tests
2626
tests-macos:
2727
permissions:
2828
id-token: write
2929
contents: read
30-
name: MacOSEngineTests
30+
name: MacOSRuntimeTests
3131
runs-on: macos-latest
3232
steps:
3333
- uses: actions/checkout@v4
3434
- uses: ./.github/actions/go
3535
with:
3636
app_id: ${{ vars.DOCKER_READ_APP_ID }}
3737
app_private_key: ${{ secrets.DOCKER_READ_APP_PRIVATE_KEY }}
38-
- name: Test engine
39-
run: CGO_ENABLED=1 make engine-unit-tests
38+
- name: Test runtime
39+
run: CGO_ENABLED=1 make runtime-unit-tests

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ keychain-linux-unit-tests:
8181
keychain-unit-tests:
8282
CGO_ENABLED=1 go test -trimpath -race -v $$(go list ./store/keychain/...)
8383

84-
engine-unit-tests:
85-
go test -trimpath -race -v $$(go list ./engine/...)
84+
runtime-unit-tests:
85+
go test -trimpath -race -v $$(go list ./runtime/...)
8686

8787
proto-generate:
8888
@docker buildx build $(DOCKER_BUILD_ARGS) -o . --target=proto-generate .

client/.gomodguard.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
blocked:
33
modules:
4-
- github.com/docker/secrets-engine/engine:
4+
- github.com/docker/secrets-engine/runtime:
55
reason: "Forbidden dependency"
66
- github.com/docker/secrets-engine/injector:
77
reason: "Forbidden dependency"

client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func New(options ...Option) (Client, error) {
102102
}
103103
c := &http.Client{
104104
Transport: &http.Transport{
105-
// re-use the same connection to the engine, this speeds up subsequent
105+
// re-use the same connection to the runtime, this speeds up subsequent
106106
// calls.
107107
MaxConnsPerHost: api.DefaultClientMaxConnsPerHost,
108108
MaxIdleConnsPerHost: api.DefaultClientMaxIdleConnsPerHost,

go.work

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ go 1.25.0
22

33
use (
44
./client
5-
./engine
65
./plugin
76
./plugins/credentialhelper
87
./plugins/pass
8+
./runtime
99
./store
1010
./x
1111
)

go.work.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2
4646
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
4747
github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw=
4848
github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
49+
github.com/go-chi/chi/v5 v5.2.3/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
4950
github.com/go-jose/go-jose/v4 v4.0.5/go.mod h1:s3P1lRrkT8igV8D9OjyL4WRyHvjB6a4JSllnOrmmBOA=
5051
github.com/go-jose/go-jose/v4 v4.1.1/go.mod h1:BdsZGqgdO3b6tTc6LSE56wcDbMMLuPsw5d4ZD5f94kA=
5152
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=

plugin/.gomodguard.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ blocked:
33
modules:
44
- github.com/docker/secrets-engine/client:
55
reason: "Forbidden dependency"
6-
- github.com/docker/secrets-engine/engine:
6+
- github.com/docker/secrets-engine/runtime:
77
reason: "Forbidden dependency"
88
- github.com/docker/secrets-engine/injector:
99
reason: "Forbidden dependency"

plugin/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
const hijackTimeout = 2 * time.Second
1717

1818
// ManualLaunchOption to apply to a plugin during its creation
19-
// when it's manually launched (not by the secrets engine).
19+
// when it's manually launched (not by the secrets runtime).
2020
type ManualLaunchOption func(c *cfg) error
2121

2222
// WithPluginName sets the name to use in plugin registration.
@@ -38,7 +38,7 @@ func WithRegistrationTimeout(timeout time.Duration) ManualLaunchOption {
3838
}
3939
}
4040

41-
// WithConnection sets an existing secrets engine connection to use.
41+
// WithConnection sets an existing secrets runtime connection to use.
4242
func WithConnection(conn net.Conn) ManualLaunchOption {
4343
return func(s *cfg) error {
4444
if s.conn != nil {

plugin/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ func Test_restoreConfig(t *testing.T) {
113113
test func(t *testing.T)
114114
}{
115115
{
116-
name: "no config from the engine",
116+
name: "no config from the runtime",
117117
test: func(t *testing.T) {
118118
_, err := restoreConfig(&mockPlugin{})
119119
assert.ErrorIs(t, err, errPluginNotLaunchedByEngine)
120120
},
121121
},
122122
{
123-
name: "invalid config from the engine",
123+
name: "invalid config from the runtime",
124124
test: func(t *testing.T) {
125125
t.Setenv(api.PluginLaunchedByEngineVar, "test-plugin")
126126
_, err := restoreConfig(&mockPlugin{})

plugin/setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func setup(ctx context.Context, config cfg, onClose func(err error)) (io.Closer,
4848
<-closed
4949
ipc.Close()
5050
}()
51-
config.Logger.Printf("Started plugin (engine: %s@%s) %s...", runtimeCfg.Engine, runtimeCfg.Version, config.name)
51+
config.Logger.Printf("Started plugin (runtime: %s@%s) %s...", runtimeCfg.Engine, runtimeCfg.Version, config.name)
5252
close(setupCompleted)
5353
return ipc, nil
5454
}

0 commit comments

Comments
 (0)