Skip to content

Commit 2a88dbe

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix/STACKITCLI-241-iaas-json-list-output
2 parents 1039dbc + f52c9ac commit 2a88dbe

397 files changed

Lines changed: 2090 additions & 2598 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/docs/contribution-guide/cmd.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@ import (
2222

2323
// Define consts for command flags
2424
const (
25-
someArg = "MY_ARG"
26-
someFlag = "my-flag"
25+
someArg = "MY_ARG"
26+
someFlag = "my-flag"
27+
secretFlag = "secret"
2728
)
2829

2930
// Struct to model user input (arguments and/or flags)
3031
type inputModel struct {
3132
*globalflags.GlobalFlagModel
3233
MyArg string
3334
MyFlag *string
35+
Secret *string
3436
}
3537

3638
// "bar" command constructor
@@ -85,8 +87,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
8587
}
8688

8789
// Configure command flags (type, default value, and description)
88-
func configureFlags(cmd *cobra.Command) {
90+
func configureFlags(cmd *cobra.Command, params *types.CmdParams) {
8991
cmd.Flags().StringP(someFlag, "shorthand", "defaultValue", "My flag description")
92+
secret := flags.SecretFlag(secretFlag, params)
93+
cmd.Flags().Var(secret, secretFlag, secret.Usage())
9094
}
9195

9296
// Parse user input (arguments and/or flags)
@@ -102,6 +106,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
102106
GlobalFlagModel: globalFlags,
103107
MyArg: myArg,
104108
MyFlag: flags.FlagToStringPointer(p, cmd, someFlag),
109+
Secret: flags.SecretFlagToStringPointer(p, cmd, secretFlag),
105110
}
106111

107112
// Write the input model to the debug logs

CONTRIBUTION.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ For prints that are specific to a certain log level, you can use the methods def
7676

7777
For command outputs that should always be displayed, no matter the defined verbosity, you should use the `print` methods `Outputf` and `Outputln`. These should only be used for the actual output of the commands, which can usually be described by "I ran the command to see _this_".
7878

79+
#### Handling secrets
80+
81+
If your command needs secrets as input, please make sure to use `flags.SecretFlag()` and `flags.SecretFlagToStringPointer()`.
82+
These functions implement reading from stdin or a file.
83+
84+
They also support reading the secret value as a command line argument (deprecated, marked for removal in Oct 2026).
85+
7986
### Onboarding a new STACKIT service
8087

8188
If you want to add a command that uses a STACKIT service `foo` that was not yet used by the CLI, you will first need to implement a few extra steps to configure the new service:

INSTALLATION.md

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,6 @@ brew tap stackitcloud/tap
2020
brew install --cask stackit
2121
```
2222

23-
#### Formula deprecated
24-
25-
The homebrew formula is deprecated, will no longer be updated and will be removed after 2026-01-22.
26-
You need to install the STACKIT CLI as cask.
27-
Therefor you need to uninstall the formula and reinstall it as cask.
28-
29-
Your profiles should normally remain. To ensure that nothing will be gone, you should backup them.
30-
31-
1. Export your existing profiles. This will create a json file in your current directory.
32-
```shell
33-
stackit config profile export default
34-
```
35-
36-
2. If you have multiple profiles, then execute the export command for each of them. You can find your profiles via:
37-
38-
```shell
39-
stackit config profile list
40-
stackit config profile export <profile-name>
41-
```
42-
43-
3. Uninstall the formula.
44-
```shell
45-
brew uninstall stackit
46-
```
47-
48-
4. Install the STACKIT CLI as cask.
49-
```shell
50-
brew install --cask stackit
51-
```
52-
53-
5. Check if your configs are still stored.
54-
```shell
55-
stackit config profile list
56-
```
57-
58-
6. In case the profiles are gone, import your profiles via:
59-
```shell
60-
$ stackit config profile import -c @default.json --name myProfile
61-
```
62-
6323
### Linux
6424

6525
#### Snapcraft

docs/stackit_beta_alb_observability-credentials_add.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ stackit beta alb observability-credentials add [flags]
1414

1515
```
1616
Add observability credentials to a load balancer with username "xxx" and display name "yyy", providing the path to a file with the password as flag
17-
$ stackit beta alb observability-credentials add --username xxx --password @./password.txt --display-name yyy
17+
$ stackit beta alb observability-credentials add --username xxx --password @./password.txt --displayname yyy
1818
```
1919

2020
### Options
2121

2222
```
2323
-d, --displayname string Displayname for the credentials
2424
-h, --help Help for "stackit beta alb observability-credentials add"
25-
--password string Password. Can be a string or a file path, if prefixed with "@" (example: @./password.txt).
25+
--password string Password. Can be a string (deprecated) or a file path, if prefixed with '@' (example: @./secret.txt). Will be read from stdin when empty.
2626
-u, --username string Username for the credentials
2727
```
2828

go.mod

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/stackitcloud/stackit-cli
33
go 1.25.0
44

55
require (
6-
github.com/fatih/color v1.18.0
6+
github.com/fatih/color v1.19.0
77
github.com/goccy/go-yaml v1.19.2
88
github.com/golang-jwt/jwt/v5 v5.3.1
99
github.com/google/go-cmp v0.7.0
@@ -38,16 +38,16 @@ require (
3838
github.com/stackitcloud/stackit-sdk-go/services/ske v1.11.0
3939
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.4.3
4040
github.com/zalando/go-keyring v0.2.6
41-
golang.org/x/mod v0.33.0
41+
golang.org/x/mod v0.34.0
4242
golang.org/x/oauth2 v0.35.0
43-
golang.org/x/term v0.40.0
44-
golang.org/x/text v0.34.0
45-
k8s.io/apimachinery v0.35.2
43+
golang.org/x/term v0.42.0
44+
golang.org/x/text v0.35.0
45+
k8s.io/apimachinery v0.35.3
4646
k8s.io/client-go v0.35.1
4747
)
4848

4949
require (
50-
golang.org/x/net v0.49.0 // indirect
50+
golang.org/x/net v0.52.0 // indirect
5151
golang.org/x/time v0.11.0 // indirect
5252
gopkg.in/inf.v0 v0.9.1 // indirect
5353
)
@@ -70,12 +70,12 @@ require (
7070
github.com/BurntSushi/toml v1.6.0 // indirect
7171
github.com/Djarvur/go-err113 v0.1.1 // indirect
7272
github.com/Masterminds/semver/v3 v3.4.0 // indirect
73-
github.com/MirrexOne/unqueryvet v1.4.0 // indirect
73+
github.com/MirrexOne/unqueryvet v1.5.4 // indirect
7474
github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect
75-
github.com/alecthomas/chroma/v2 v2.21.1 // indirect
75+
github.com/alecthomas/chroma/v2 v2.23.1 // indirect
7676
github.com/alecthomas/go-check-sumtype v0.3.1 // indirect
7777
github.com/alexkohler/nakedret/v2 v2.0.6 // indirect
78-
github.com/alexkohler/prealloc v1.0.1 // indirect
78+
github.com/alexkohler/prealloc v1.1.0 // indirect
7979
github.com/alfatraining/structtag v1.0.0 // indirect
8080
github.com/alingse/asasalint v0.0.11 // indirect
8181
github.com/alingse/nilnesserr v0.2.0 // indirect
@@ -86,7 +86,7 @@ require (
8686
github.com/bkielbasa/cyclop v1.2.3 // indirect
8787
github.com/blizzy78/varnamelen v0.8.0 // indirect
8888
github.com/bombsimon/wsl/v4 v4.7.0 // indirect
89-
github.com/bombsimon/wsl/v5 v5.3.0 // indirect
89+
github.com/bombsimon/wsl/v5 v5.6.0 // indirect
9090
github.com/breml/bidichk v0.3.3 // indirect
9191
github.com/breml/errchkjson v0.4.1 // indirect
9292
github.com/butuzov/ireturn v0.4.0 // indirect
@@ -97,7 +97,7 @@ require (
9797
github.com/charithe/durationcheck v0.0.11 // indirect
9898
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
9999
github.com/charmbracelet/lipgloss v1.1.0 // indirect
100-
github.com/charmbracelet/x/ansi v0.8.0 // indirect
100+
github.com/charmbracelet/x/ansi v0.10.1 // indirect
101101
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
102102
github.com/charmbracelet/x/term v0.2.1 // indirect
103103
github.com/ckaznocha/intrange v0.3.1 // indirect
@@ -111,7 +111,7 @@ require (
111111
github.com/firefart/nonamedreturns v1.0.6 // indirect
112112
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
113113
github.com/fzipp/gocyclo v0.6.0 // indirect
114-
github.com/ghostiam/protogetter v0.3.18 // indirect
114+
github.com/ghostiam/protogetter v0.3.20 // indirect
115115
github.com/go-critic/go-critic v0.14.3 // indirect
116116
github.com/go-toolsmith/astcast v1.1.0 // indirect
117117
github.com/go-toolsmith/astcopy v1.1.0 // indirect
@@ -120,19 +120,19 @@ require (
120120
github.com/go-toolsmith/astp v1.1.0 // indirect
121121
github.com/go-toolsmith/strparse v1.1.0 // indirect
122122
github.com/go-toolsmith/typep v1.1.0 // indirect
123-
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
123+
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
124124
github.com/go-xmlfmt/xmlfmt v1.1.3 // indirect
125125
github.com/gobwas/glob v0.2.3 // indirect
126-
github.com/godoc-lint/godoc-lint v0.11.1 // indirect
126+
github.com/godoc-lint/godoc-lint v0.11.2 // indirect
127127
github.com/gofrs/flock v0.13.0 // indirect
128128
github.com/golang/protobuf v1.5.3 // indirect
129129
github.com/golangci/asciicheck v0.5.0 // indirect
130130
github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect
131131
github.com/golangci/go-printf-func-name v0.1.1 // indirect
132132
github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d // indirect
133-
github.com/golangci/golangci-lint/v2 v2.8.0 // indirect
134-
github.com/golangci/golines v0.14.0 // indirect
135-
github.com/golangci/misspell v0.7.0 // indirect
133+
github.com/golangci/golangci-lint/v2 v2.11.4 // indirect
134+
github.com/golangci/golines v0.15.0 // indirect
135+
github.com/golangci/misspell v0.8.0 // indirect
136136
github.com/golangci/plugin-module-register v0.1.2 // indirect
137137
github.com/golangci/revgrep v0.8.0 // indirect
138138
github.com/golangci/swaggoswag v0.0.0-20250504205917-77f2aca3143e // indirect
@@ -151,7 +151,7 @@ require (
151151
github.com/jjti/go-spancheck v0.6.5 // indirect
152152
github.com/julz/importas v0.2.0 // indirect
153153
github.com/karamaru-alpha/copyloopvar v1.2.2 // indirect
154-
github.com/kisielk/errcheck v1.9.0 // indirect
154+
github.com/kisielk/errcheck v1.10.0 // indirect
155155
github.com/kkHAIKE/contextcheck v1.1.6 // indirect
156156
github.com/kulti/thelper v0.7.1 // indirect
157157
github.com/kunwardeep/paralleltest v1.0.15 // indirect
@@ -172,15 +172,15 @@ require (
172172
github.com/matoous/godox v1.1.0 // indirect
173173
github.com/mattn/go-isatty v0.0.20 // indirect
174174
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
175-
github.com/mgechev/revive v1.13.0 // indirect
175+
github.com/mgechev/revive v1.15.0 // indirect
176176
github.com/mitchellh/go-homedir v1.1.0 // indirect
177177
github.com/moricho/tparallel v0.3.2 // indirect
178178
github.com/muesli/termenv v0.16.0 // indirect
179179
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
180180
github.com/nakabonne/nestif v0.3.1 // indirect
181181
github.com/nishanths/exhaustive v0.12.0 // indirect
182182
github.com/nishanths/predeclared v0.2.2 // indirect
183-
github.com/nunnatsa/ginkgolinter v0.21.2 // indirect
183+
github.com/nunnatsa/ginkgolinter v0.23.0 // indirect
184184
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
185185
github.com/prometheus/client_golang v1.12.1 // indirect
186186
github.com/prometheus/client_model v0.2.0 // indirect
@@ -194,15 +194,15 @@ require (
194194
github.com/raeperd/recvcheck v0.2.0 // indirect
195195
github.com/rogpeppe/go-internal v1.14.1 // indirect
196196
github.com/ryancurrah/gomodguard v1.4.1 // indirect
197-
github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect
197+
github.com/ryanrolds/sqlclosecheck v0.6.0 // indirect
198198
github.com/sanposhiho/wastedassign/v2 v2.1.0 // indirect
199199
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
200200
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
201201
github.com/sashamelentyev/usestdlibvars v1.29.0 // indirect
202-
github.com/securego/gosec/v2 v2.22.11 // indirect
203-
github.com/sirupsen/logrus v1.9.3 // indirect
202+
github.com/securego/gosec/v2 v2.24.8-0.20260309165252-619ce2117e08 // indirect
203+
github.com/sirupsen/logrus v1.9.4 // indirect
204204
github.com/sivchari/containedctx v1.0.3 // indirect
205-
github.com/sonatard/noctx v0.4.0 // indirect
205+
github.com/sonatard/noctx v0.5.1 // indirect
206206
github.com/sourcegraph/go-diff v0.7.0 // indirect
207207
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect
208208
github.com/stbenjam/no-sprintf-host-port v0.3.1 // indirect
@@ -215,7 +215,7 @@ require (
215215
github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect
216216
github.com/ultraware/funlen v0.2.0 // indirect
217217
github.com/ultraware/whitespace v0.2.0 // indirect
218-
github.com/uudashr/gocognit v1.2.0 // indirect
218+
github.com/uudashr/gocognit v1.2.1 // indirect
219219
github.com/uudashr/iface v1.4.1 // indirect
220220
github.com/x448/float16 v0.8.4 // indirect
221221
github.com/xen0n/gosmopolitan v1.3.0 // indirect
@@ -226,19 +226,18 @@ require (
226226
gitlab.com/bosi/decorder v0.4.2 // indirect
227227
go-simpler.org/musttag v0.14.0 // indirect
228228
go-simpler.org/sloglint v0.11.1 // indirect
229-
go.augendre.info/arangolint v0.3.1 // indirect
229+
go.augendre.info/arangolint v0.4.0 // indirect
230230
go.augendre.info/fatcontext v0.9.0 // indirect
231-
go.uber.org/automaxprocs v1.6.0 // indirect
232231
go.uber.org/multierr v1.10.0 // indirect
233232
go.uber.org/zap v1.27.0 // indirect
234233
go.yaml.in/yaml/v2 v2.4.3 // indirect
235234
go.yaml.in/yaml/v3 v3.0.4 // indirect
236-
golang.org/x/exp/typeparams v0.0.0-20251023183803-a4bb9ffd2546 // indirect
237-
golang.org/x/sync v0.19.0 // indirect
238-
golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 // indirect
239-
golang.org/x/tools v0.41.0 // indirect
235+
golang.org/x/exp/typeparams v0.0.0-20260209203927-2842357ff358 // indirect
236+
golang.org/x/sync v0.20.0 // indirect
237+
golang.org/x/telemetry v0.0.0-20260311193753-579e4da9a98c // indirect
238+
golang.org/x/tools v0.43.0 // indirect
240239
google.golang.org/protobuf v1.36.8 // indirect
241-
honnef.co/go/tools v0.6.1 // indirect
240+
honnef.co/go/tools v0.7.0 // indirect
242241
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
243242
mvdan.cc/gofumpt v0.9.2 // indirect
244243
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 // indirect
@@ -275,7 +274,7 @@ require (
275274
github.com/stackitcloud/stackit-sdk-go/services/redis v0.25.6
276275
github.com/stackitcloud/stackit-sdk-go/services/sfs v0.4.0
277276
github.com/subosito/gotenv v1.6.0 // indirect
278-
golang.org/x/sys v0.41.0 // indirect
277+
golang.org/x/sys v0.43.0 // indirect
279278
gopkg.in/yaml.v3 v3.0.1 // indirect
280279
k8s.io/api v0.35.1 // indirect
281280
k8s.io/klog/v2 v2.130.1 // indirect

0 commit comments

Comments
 (0)