Skip to content

Commit

Permalink
Remove user name and password from consumer and stream types
Browse files Browse the repository at this point in the history
  • Loading branch information
vavsab committed Jan 30, 2025
1 parent d1465a8 commit eb33c85
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 43 deletions.
17 changes: 4 additions & 13 deletions controllers/jetstream/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,10 @@ func (c *Controller) getAccountOverrides(account string, ns string) (*accountOve
}

type jsmcSpecOverrides struct {
servers []string
tls apis.TLS
creds string
nkey string
userName string
userPassword string
token string
servers []string
tls apis.TLS
creds string
nkey string
}

func (c *Controller) runWithJsmc(jsm jsmClientFunc, acc *accountOverrides, spec *jsmcSpecOverrides, o runtime.Object, op func(jsmClient) error) error {
Expand All @@ -580,12 +577,6 @@ func (c *Controller) runWithJsmc(jsm jsmClientFunc, acc *accountOverrides, spec
natsCtx.TLSCert = spec.tls.ClientCert
natsCtx.TLSKey = spec.tls.ClientKey
}
if spec.userName != "" && spec.userPassword != "" {
natsCtx.Username = spec.userName
natsCtx.Password = spec.userPassword
} else if spec.token != "" {
natsCtx.Token = spec.token
}

// Use fetched secrets for the account and server if defined.
if acc.remoteClientCert != "" && acc.remoteClientKey != "" {
Expand Down
24 changes: 0 additions & 24 deletions deploy/crds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,6 @@ spec:
description: NATS user NKey for connecting to servers.
type: string
default: ''
userName:
description: NATS user name for connecting to servers.
type: string
default: ''
userPassword:
description: NATS user password for connecting to servers.
type: string
default: ''
token:
description: The token to be used to connect to the NATS Service.
type: string
default: ''
tls:
description: A client's TLS certs and keys.
type: object
Expand Down Expand Up @@ -650,18 +638,6 @@ spec:
description: NATS user NKey for connecting to servers.
type: string
default: ''
userName:
description: NATS user name for connecting to servers.
type: string
default: ''
userPassword:
description: NATS user password for connecting to servers.
type: string
default: ''
token:
description: The token to be used to connect to the NATS Service.
type: string
default: ''
account:
description: Name of the account to which the Consumer belongs.
type: string
Expand Down
3 changes: 0 additions & 3 deletions pkg/jetstream/apis/jetstream/v1beta2/consumertypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ type ConsumerSpec struct {
MaxWaiting int `json:"maxWaiting"`
MemStorage bool `json:"memStorage"`
Nkey string `json:"nkey"`
UserName string `json:"userName"`
UserPassword string `json:"userPassword"`
Token string `json:"token"`
OptStartSeq int `json:"optStartSeq"`
OptStartTime string `json:"optStartTime"`
RateLimitBps int `json:"rateLimitBps"`
Expand Down
3 changes: 0 additions & 3 deletions pkg/jetstream/apis/jetstream/v1beta2/streamtypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ type StreamSpec struct {
Mirror *StreamSource `json:"mirror"`
Name string `json:"name"`
Nkey string `json:"nkey"`
UserName string `json:"userName"`
UserPassword string `json:"userPassword"`
Token string `json:"token"`
NoAck bool `json:"noAck"`
Placement *StreamPlacement `json:"placement"`
Replicas int `json:"replicas"`
Expand Down

0 comments on commit eb33c85

Please sign in to comment.