Skip to content

Commit 6acbf48

Browse files
committed
feat(oauth): use oauth to unify service-to-service authentication.
1 parent bcfd7d4 commit 6acbf48

18 files changed

Lines changed: 1277 additions & 133 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ coverage.txt
66
testdata/hooks/pre-receive
77
.idea/
88
.vscode/
9+
.sisyphus/

boot.go

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/drycc/builder/pkg"
1515
"github.com/drycc/builder/pkg/cleaner"
1616
"github.com/drycc/builder/pkg/conf"
17+
"github.com/drycc/builder/pkg/controller/token"
1718
"github.com/drycc/builder/pkg/gitreceive"
1819
"github.com/drycc/builder/pkg/healthsrv"
1920
"github.com/drycc/builder/pkg/k8s"
@@ -47,7 +48,7 @@ func main() {
4748
Name: "server",
4849
Aliases: []string{"srv"},
4950
Usage: "Run the git server",
50-
Action: func(ctx context.Context, cmd *cli.Command) error {
51+
Action: func(_ context.Context, _ *cli.Command) error {
5152
cnf := new(sshd.Config)
5253
if err := envconfig.Process(serverConfAppName, cnf); err != nil {
5354
return fmt.Errorf("getting config for %s [%s]", serverConfAppName, err)
@@ -106,7 +107,7 @@ func main() {
106107
Name: "git-receive",
107108
Aliases: []string{"gr"},
108109
Usage: "Run the git-receive hook",
109-
Action: func(ctx context.Context, cmd *cli.Command) error {
110+
Action: func(_ context.Context, _ *cli.Command) error {
110111
cnf := new(gitreceive.Config)
111112
if err := envconfig.Process(gitReceiveConfAppName, cnf); err != nil {
112113
return fmt.Errorf("error getting config for %s [%s]", gitReceiveConfAppName, err)
@@ -129,6 +130,23 @@ func main() {
129130
return nil
130131
},
131132
},
133+
{
134+
Name: "refresh-token",
135+
Usage: "Refresh the OAuth m2m access token in Valkey (CronJob entry point)",
136+
Flags: []cli.Flag{
137+
&cli.BoolFlag{
138+
Name: "force",
139+
Usage: "Refresh regardless of current token lifetime",
140+
},
141+
},
142+
Action: func(ctx context.Context, c *cli.Command) error {
143+
if err := token.Refresh(ctx, c.Bool("force")); err != nil {
144+
return fmt.Errorf("token refresh failed: %w", err)
145+
}
146+
log.Printf("Token refresh completed successfully")
147+
return nil
148+
},
149+
},
132150
}
133151

134152
if err := app.Run(context.Background(), os.Args); err != nil {

charts/builder/templates/_helpers.tpl

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ env:
66
value: "2223"
77
- name: "TTL_SECONDS_AFTER_FINISHED"
88
value: "{{ .Values.global.ttlSecondsAfterFinished }}"
9+
{{- if (.Values.valkeyUrl) }}
10+
- name: DRYCC_VALKEY_URL
11+
value: "{{ .Values.valkeyUrl }}"
12+
{{- else }}
13+
- name: DRYCC_VALKEY_PASSWORD
14+
valueFrom:
15+
secretKeyRef:
16+
name: valkey-creds
17+
key: password
18+
- name: DRYCC_VALKEY_URL
19+
value: "redis://:$(DRYCC_VALKEY_PASSWORD)@drycc-valkey:16379/3"
20+
{{- end }}
921
# Set GIT_LOCK_TIMEOUT to number of minutes you want to wait to git push again to the same repository
1022
- name: "GIT_LOCK_TIMEOUT"
1123
value: "30"
@@ -22,6 +34,50 @@ env:
2234
fieldPath: metadata.namespace
2335
- name: "DRYCC_CONTROLLER_URL"
2436
value: http://drycc-controller-api
37+
{{- if .Values.passport.enabled }}
38+
- name: "DRYCC_PASSPORT_URL"
39+
{{- if .Values.global.certManagerEnabled }}
40+
value: https://drycc-passport.{{ .Values.global.platformDomain }}
41+
{{- else }}
42+
value: http://drycc-passport.{{ .Values.global.platformDomain }}
43+
{{- end }}
44+
- name: DRYCC_PASSPORT_KEY
45+
valueFrom:
46+
secretKeyRef:
47+
name: passport-creds
48+
key: drycc-passport-builder-key
49+
- name: DRYCC_PASSPORT_SECRET
50+
valueFrom:
51+
secretKeyRef:
52+
name: passport-creds
53+
key: drycc-passport-builder-secret
54+
- name: DRYCC_PASSPORT_SCOPES
55+
valueFrom:
56+
secretKeyRef:
57+
name: passport-creds
58+
key: drycc-passport-builder-scopes
59+
{{- else if .Values.passportUrl }}
60+
- name: DRYCC_PASSPORT_URL
61+
valueFrom:
62+
secretKeyRef:
63+
name: builder-secret
64+
key: passport-url
65+
- name: DRYCC_PASSPORT_KEY
66+
valueFrom:
67+
secretKeyRef:
68+
name: builder-secret
69+
key: passport-key
70+
- name: DRYCC_PASSPORT_SECRET
71+
valueFrom:
72+
secretKeyRef:
73+
name: builder-secret
74+
key: passport-secret
75+
- name: DRYCC_PASSPORT_SCOPES
76+
valueFrom:
77+
secretKeyRef:
78+
name: builder-secret
79+
key: passport-scopes
80+
{{- end }}
2581
{{- if (.Values.storageEndpoint) }}
2682
- name: "DRYCC_STORAGE_BUCKET"
2783
valueFrom:
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: batch/v1
2+
kind: CronJob
3+
metadata:
4+
name: drycc-builder-token-refresher
5+
labels:
6+
heritage: drycc
7+
app: drycc-builder
8+
component: token-refresher
9+
spec:
10+
schedule: "0 2 * * *"
11+
concurrencyPolicy: Forbid
12+
successfulJobsHistoryLimit: 3
13+
failedJobsHistoryLimit: 3
14+
jobTemplate:
15+
spec:
16+
backoffLimit: 3
17+
template:
18+
metadata:
19+
labels: {{- include "common.labels.standard" . | nindent 12 }}
20+
app: drycc-builder
21+
component: token-refresher
22+
spec:
23+
affinity:
24+
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values ) | nindent 14 }}
25+
serviceAccount: drycc-builder
26+
restartPolicy: OnFailure
27+
containers:
28+
- name: token-refresher
29+
image: {{ .Values.imageRegistry }}/{{ .Values.imageOrg }}/builder:{{ .Values.imageTag }}
30+
imagePullPolicy: {{ .Values.imagePullPolicy }}
31+
args: ["refresh-token"]
32+
{{- include "builder.envs" . | indent 12 }}

charts/builder/templates/builder-secret.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ metadata:
77
type: Opaque
88
data:
99
{{- if (.Values.registryHost) }}
10+
{{- if (.Values.passportUrl) }}
11+
passport-url: {{ .Values.passportUrl | b64enc }}
12+
{{- end }}
13+
{{- if (.Values.passportKey) }}
14+
passport-key: {{ .Values.passportKey | b64enc }}
15+
{{- end }}
16+
{{- if (.Values.passportSecret) }}
17+
passport-secret: {{ .Values.passportSecret | b64enc }}
18+
{{- end }}
19+
{{- if (.Values.passportScopes) }}
20+
passport-scopes: {{ .Values.passportScopes | b64enc }}
21+
{{- end }}
1022
registry-host: {{ .Values.registryHost | b64enc }}
1123
registry-username: {{ .Values.registryUsername | b64enc }}
1224
registry-password: {{ .Values.registryPassword | b64enc }}

charts/builder/values.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,19 @@ registry:
7777
enabled: true
7878
proxy:
7979
port: 5555
80+
81+
# Override DRYCC_VALKEY_URL when running against an external Valkey/Redis.
82+
# When empty, the chart wires the in-cluster drycc-valkey service.
83+
valkeyUrl: ""
84+
85+
# Passport configuration
86+
# When enabled, uses the in-cluster drycc-passport service
87+
# When disabled, uses external passport credentials from secrets
88+
passport:
89+
enabled: true
90+
91+
# The following parameters are used when passport.enabled is false
92+
passportUrl: ""
93+
passportKey: ""
94+
passportSecret: ""
95+
passportScopes: ""

go.mod

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@ module github.com/drycc/builder
33
go 1.26
44

55
require (
6+
github.com/alicebob/miniredis/v2 v2.37.0
67
github.com/aws/aws-sdk-go-v2 v1.36.3
78
github.com/aws/aws-sdk-go-v2/config v1.29.14
89
github.com/aws/aws-sdk-go-v2/credentials v1.17.67
910
github.com/aws/aws-sdk-go-v2/service/ecr v1.44.1
10-
github.com/distribution/distribution/v3 v3.1.0
11-
github.com/drycc/controller-sdk-go v0.0.0-20260416093543-28d3a22ab999
11+
github.com/distribution/distribution/v3 v3.1.1
12+
github.com/drycc/controller-sdk-go v0.0.0-20260511051139-2b7986fe96fd
1213
github.com/drycc/pkg v0.0.0-20250917064731-345368da3dbf
1314
github.com/google/uuid v1.6.0
1415
github.com/kelseyhightower/envconfig v1.4.0
1516
github.com/stretchr/testify v1.11.1
1617
github.com/urfave/cli/v3 v3.3.3
17-
golang.org/x/crypto v0.50.0
18+
github.com/valkey-io/valkey-go v1.0.74
19+
golang.org/x/crypto v0.51.0
1820
gopkg.in/yaml.v3 v3.0.1
1921
k8s.io/api v0.35.4
2022
k8s.io/apimachinery v0.35.4
@@ -64,6 +66,7 @@ require (
6466
github.com/prometheus/procfs v0.20.1 // indirect
6567
github.com/sirupsen/logrus v1.9.4 // indirect
6668
github.com/x448/float16 v0.8.4 // indirect
69+
github.com/yuin/gopher-lua v1.1.1 // indirect
6770
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
6871
go.opentelemetry.io/contrib/bridges/prometheus v0.67.0 // indirect
6972
go.opentelemetry.io/contrib/exporters/autoexport v0.67.0 // indirect
@@ -88,11 +91,11 @@ require (
8891
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
8992
go.yaml.in/yaml/v2 v2.4.3 // indirect
9093
go.yaml.in/yaml/v3 v3.0.4 // indirect
91-
golang.org/x/net v0.52.0 // indirect
94+
golang.org/x/net v0.54.0 // indirect
9295
golang.org/x/oauth2 v0.35.0 // indirect
93-
golang.org/x/sys v0.43.0 // indirect
94-
golang.org/x/term v0.42.0 // indirect
95-
golang.org/x/text v0.36.0 // indirect
96+
golang.org/x/sys v0.44.0 // indirect
97+
golang.org/x/term v0.43.0 // indirect
98+
golang.org/x/text v0.37.0 // indirect
9699
golang.org/x/time v0.14.0 // indirect
97100
google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect
98101
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect

go.sum

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1
22
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
33
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
44
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
5+
github.com/alicebob/miniredis/v2 v2.37.0 h1:RheObYW32G1aiJIj81XVt78ZHJpHonHLHW7OLIshq68=
6+
github.com/alicebob/miniredis/v2 v2.37.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM=
57
github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU=
68
github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
79
github.com/aws/aws-sdk-go-v2 v1.36.3 h1:mJoei2CxPutQVxaATCzDUjcZEjVRdpsiiXi2o38yqWM=
@@ -44,12 +46,12 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
4446
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4547
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
4648
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
47-
github.com/distribution/distribution/v3 v3.1.0 h1:u1v788HreKTLGdNY6s7px8Exgrs9mZ9UrCDjSrpCM8g=
48-
github.com/distribution/distribution/v3 v3.1.0/go.mod h1:73BuF5/ziMHNVt7nnL1roYpH4Eg/FgUlKZm3WryIx/o=
49+
github.com/distribution/distribution/v3 v3.1.1 h1:KUbk7C8CfaLXy8kbf/hGq9cad/wCoLB6dbWH6DMbmX0=
50+
github.com/distribution/distribution/v3 v3.1.1/go.mod h1:d7lXwZpph0bVcOj4Aqn0nMrWHIwRQGdiV5TLeI+/w6Y=
4951
github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=
5052
github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw=
51-
github.com/drycc/controller-sdk-go v0.0.0-20260416093543-28d3a22ab999 h1:yHGZInF3xoLRHDgIPQFnfXF8EGaPZZXaRXf0I4pxnWI=
52-
github.com/drycc/controller-sdk-go v0.0.0-20260416093543-28d3a22ab999/go.mod h1:eHcmYwg81ASlP55/U587xnBZnZoeZnPHXGeQ8nYWnsg=
53+
github.com/drycc/controller-sdk-go v0.0.0-20260511051139-2b7986fe96fd h1:zeDC7WbB3yGjuviC0u4eHaiylt7ixVbfL8Ope+FwEtM=
54+
github.com/drycc/controller-sdk-go v0.0.0-20260511051139-2b7986fe96fd/go.mod h1:jV1AUDHtY8aPMF95evHQGXZOX6tUXaf7wgqzUEnD5SM=
5355
github.com/drycc/pkg v0.0.0-20250917064731-345368da3dbf h1:CYy3NoPhfFhkGAbEppTOQfY/HC2s0FJDcBgbtRKeweg=
5456
github.com/drycc/pkg v0.0.0-20250917064731-345368da3dbf/go.mod h1:BrrNrNskHKm+nJYhXfGuI114w8nupi0AMo8QZHID7CM=
5557
github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU=
@@ -132,8 +134,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m
132134
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
133135
github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns=
134136
github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
135-
github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
136-
github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
137+
github.com/onsi/gomega v1.38.3 h1:eTX+W6dobAYfFeGC2PV6RwXRu/MyT+cQguijutvkpSM=
138+
github.com/onsi/gomega v1.38.3/go.mod h1:ZCU1pkQcXDO5Sl9/VVEGlDyp+zm0m1cmeG5TOzLgdh4=
137139
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
138140
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
139141
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
@@ -175,8 +177,12 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
175177
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
176178
github.com/urfave/cli/v3 v3.3.3 h1:byCBaVdIXuLPIDm5CYZRVG6NvT7tv1ECqdU4YzlEa3I=
177179
github.com/urfave/cli/v3 v3.3.3/go.mod h1:FJSKtM/9AiiTOJL4fJ6TbMUkxBXn7GO9guZqoZtpYpo=
180+
github.com/valkey-io/valkey-go v1.0.74 h1:NqtBHzjybz+is+c71hsyZP7hoE5lwCHQX026me0Vb08=
181+
github.com/valkey-io/valkey-go v1.0.74/go.mod h1:VGhZ6fs68Qrn2+OhH+6waZH27bjpgQOiLyUQyXuYK5k=
178182
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
179183
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
184+
github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
185+
github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
180186
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
181187
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
182188
go.opentelemetry.io/contrib/bridges/prometheus v0.67.0 h1:dkBzNEAIKADEaFnuESzcXvpd09vxvDZsOjx11gjUqLk=
@@ -231,14 +237,14 @@ go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
231237
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
232238
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
233239
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
234-
golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI=
235-
golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q=
236-
golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI=
237-
golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=
240+
golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI=
241+
golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8=
242+
golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM=
243+
golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU=
238244
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
239245
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
240-
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
241-
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
246+
golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w=
247+
golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ=
242248
golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ=
243249
golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
244250
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -249,17 +255,17 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h
249255
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
250256
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
251257
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
252-
golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
253-
golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
254-
golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY=
255-
golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY=
258+
golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ=
259+
golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
260+
golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4=
261+
golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk=
256262
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
257-
golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg=
258-
golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164=
263+
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
264+
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
259265
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
260266
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
261-
golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=
262-
golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0=
267+
golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c=
268+
golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI=
263269
gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4=
264270
gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E=
265271
google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 h1:VPWxll4HlMw1Vs/qXtN7BvhZqsS9cdAittCNvVENElA=

pkg/conf/config.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
package conf
33

44
import (
5-
"fmt"
65
"net"
76
"net/url"
8-
"os"
97
"strings"
108

119
"github.com/drycc/builder/pkg/sys"
@@ -19,22 +17,9 @@ const (
1917
storagePathStyleEnvVar = "DRYCC_STORAGE_PATH_STYLE"
2018
)
2119

22-
// ServiceKeyLocation holds the path of the service key secret.
23-
var ServiceKeyLocation = "/var/run/secrets/drycc/controller/service-key"
24-
2520
// Parameters is map which contains storage params
2621
type Parameters map[string]any
2722

28-
// GetServiceKey returns the key to be used as token to interact with drycc-controller
29-
func GetServiceKey() (string, error) {
30-
serviceKeyBytes, err := os.ReadFile(ServiceKeyLocation)
31-
if err != nil {
32-
return "", fmt.Errorf("couldn't get builder key from %s (%s)", ServiceKeyLocation, err)
33-
}
34-
serviceKey := strings.TrimSuffix(string(serviceKeyBytes), "\n")
35-
return serviceKey, nil
36-
}
37-
3823
// GetStorageParams returns the credentials required for connecting to object storage
3924
func GetStorageParams(env sys.Env) (Parameters, error) {
4025
params := make(map[string]any)

0 commit comments

Comments
 (0)