File tree 4 files changed +21
-2
lines changed
4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ type authAccountCommand struct {
101
101
prefix string
102
102
tags []string
103
103
rmTags []string
104
+ signingKey string
104
105
}
105
106
106
107
func configureAuthAccountCommand (auth commandHost ) {
@@ -135,6 +136,7 @@ func configureAuthAccountCommand(auth commandHost) {
135
136
add := acct .Command ("add" , "Adds a new Account" ).Alias ("create" ).Alias ("new" ).Action (c .addAction )
136
137
add .Arg ("name" , "Unique name for this Account" ).StringVar (& c .accountName )
137
138
add .Flag ("operator" , "Operator to add the account to" ).StringVar (& c .operatorName )
139
+ add .Flag ("key" , "The public key to use when signing the user" ).StringVar (& c .signingKey )
138
140
addCreateFlags (add , false )
139
141
add .Flag ("defaults" , "Accept default values without prompting" ).UnNegatableBoolVar (& c .defaults )
140
142
@@ -912,6 +914,21 @@ func (c *authAccountCommand) addAction(_ *fisk.ParseContext) error {
912
914
return err
913
915
}
914
916
917
+ if c .signingKey != "" {
918
+ sk , err := au .SelectSigningKey (acct , c .signingKey )
919
+ if err != nil {
920
+ return err
921
+ }
922
+ c .signingKey = sk .Key ()
923
+ }
924
+
925
+ if c .signingKey != "" {
926
+ err = acct .SetIssuer (c .signingKey )
927
+ if err != nil {
928
+ return err
929
+ }
930
+ }
931
+
915
932
err = au .UpdateTags (acct .Tags (), c .tags , c .rmTags )
916
933
if err != nil {
917
934
return err
Original file line number Diff line number Diff line change @@ -261,7 +261,7 @@ func configureConsumerCommand(app commandHost) {
261
261
consNext .Flag ("wait" , "Wait up to this period to acknowledge messages" ).DurationVar (& c .ackWait )
262
262
consNext .Flag ("count" , "Number of messages to try to fetch from the pull consumer" ).Default ("1" ).IntVar (& c .pullCount )
263
263
264
- consSub := cons .Command ("sub" , "Retrieves messages from Consumers" ).Action (c .subAction )
264
+ consSub := cons .Command ("sub" , "Retrieves messages from Consumers" ).Action (c .subAction ). Hidden ()
265
265
consSub .Arg ("stream" , "Stream name" ).StringVar (& c .stream )
266
266
consSub .Arg ("consumer" , "Consumer name" ).StringVar (& c .consumer )
267
267
consSub .Flag ("ack" , "Acknowledge received message" ).Default ("true" ).BoolVar (& c .ack )
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ require (
26
26
github.com/nats-io/nuid v1.0.1
27
27
github.com/prometheus/client_golang v1.21.1
28
28
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
29
- github.com/synadia-io/jwt-auth-builder.go v0.0.6
29
+ github.com/synadia-io/jwt-auth-builder.go v0.0.7-0.20250307212657-0e3f1ee00864
30
30
github.com/tylertreat/hdrhistogram-writer v0.0.0-20210816161836-2e440612a39f
31
31
golang.org/x/crypto v0.36.0
32
32
golang.org/x/term v0.30.0
Original file line number Diff line number Diff line change @@ -154,6 +154,8 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
154
154
github.com/stretchr/testify v1.10.0 /go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY =
155
155
github.com/synadia-io/jwt-auth-builder.go v0.0.6 h1:F3bTGWlKzWHwRqtTt35fRmhrxXLgkI8qz8QvvzxKSko =
156
156
github.com/synadia-io/jwt-auth-builder.go v0.0.6 /go.mod h1:8WYR7+nLQcDMBpocuPgdFJ5/2UOr+HPll3qv+KNdGvs =
157
+ github.com/synadia-io/jwt-auth-builder.go v0.0.7-0.20250307212657-0e3f1ee00864 h1:itO+DjIffRn+nN3jHxHNcCiJIsL1BMZF7p3wYeTN7xs =
158
+ github.com/synadia-io/jwt-auth-builder.go v0.0.7-0.20250307212657-0e3f1ee00864 /go.mod h1:8WYR7+nLQcDMBpocuPgdFJ5/2UOr+HPll3qv+KNdGvs =
157
159
github.com/tylertreat/hdrhistogram-writer v0.0.0-20210816161836-2e440612a39f h1:SGznmvCovewbaSgBsHgdThtWsLj5aCLX/3ZXMLd1UD0 =
158
160
github.com/tylertreat/hdrhistogram-writer v0.0.0-20210816161836-2e440612a39f /go.mod h1:IY84XkhrEJTdHYLNy/zObs8mXuUAp9I65VyarbPSCCY =
159
161
github.com/yuin/goldmark v1.4.13 /go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY =
You can’t perform that action at this time.
0 commit comments