Skip to content

Commit

Permalink
Revert "DEVPROD-6951 add static auth (#7864)" (#7925)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybrill authored May 28, 2024
1 parent 3b3e907 commit 791501c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 30 deletions.
5 changes: 1 addition & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (

// ClientVersion is the commandline version string used to control updating
// the CLI. The format is the calendar date (YYYY-MM-DD).
ClientVersion = "2024-05-23"
ClientVersion = "2024-05-24"

// Agent version to control agent rollover. The format is the calendar date
// (YYYY-MM-DD).
Expand Down Expand Up @@ -696,9 +696,6 @@ type DBSettings struct {
WriteConcernSettings WriteConcern `yaml:"write_concern"`
ReadConcernSettings ReadConcern `yaml:"read_concern"`
AWSAuthEnabled bool `yaml:"aws_auth_enabled"`
// TODO (DEVPROD-6951): remove static auth once IRSA auth is reliable again.
Username string `yaml:"username"`
Password string `yaml:"password"`
}

// supported banner themes in Evergreen
Expand Down
16 changes: 2 additions & 14 deletions environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,7 @@ func (e *envState) initDB(ctx context.Context, settings DBSettings, tracer trace
SetConnectTimeout(5 * time.Second).
SetMonitor(apm.NewMonitor(apm.WithCommandAttributeDisabled(false), apm.WithCommandAttributeTransformer(redactSensitiveCollections)))

// TODO (DEVPROD-6951): remove static auth once IRSA auth is reliable again.
if settings.Username != "" && settings.Password != "" {
opts.SetAuth(options.Credential{
Username: settings.Username,
Password: settings.Password,
})
} else if settings.AWSAuthEnabled {
if settings.AWSAuthEnabled {
opts.SetAuth(options.Credential{
AuthMechanism: awsAuthMechanism,
AuthSource: mongoExternalAuthSource,
Expand Down Expand Up @@ -413,13 +407,7 @@ func (e *envState) createRemoteQueues(ctx context.Context, tracer trace.Tracer)
SetWriteConcern(e.settings.Database.WriteConcernSettings.Resolve()).
SetMonitor(apm.NewMonitor(apm.WithCommandAttributeDisabled(false)))

// TODO (DEVPROD-6951): remove static auth once IRSA auth is reliable again.
if e.settings.Database.Username != "" && e.settings.Database.Password != "" {
opts.SetAuth(options.Credential{
Username: e.settings.Database.Username,
Password: e.settings.Database.Password,
})
} else if e.settings.Database.AWSAuthEnabled {
if e.settings.Database.AWSAuthEnabled {
opts.SetAuth(options.Credential{
AuthMechanism: awsAuthMechanism,
AuthSource: mongoExternalAuthSource,
Expand Down
4 changes: 0 additions & 4 deletions globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,6 @@ const (
EvergreenVersionID = "EVG_VERSION_ID"
TraceEndpoint = "TRACE_ENDPOINT"

// TODO (DEVPROD-6951): remove static auth once IRSA auth is reliable again.
MongoUsername = "MONGO_USERNAME"
MongoPassword = "MONGO_PASSWORD"

// localLoggingOverride is a special log path indicating that the app server
// should attempt to log to systemd if available, and otherwise fall back to
// logging to stdout.
Expand Down
8 changes: 0 additions & 8 deletions operations/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,10 @@ func parseDB(c *cli.Context) *evergreen.DBSettings {
}
url := c.String(dbUrlFlagName)
awsAuthEnabled := c.Bool(dbAWSAuthFlagName)

// TODO (DEVPROD-6951): remove static auth once IRSA auth is reliable again.
username := os.Getenv(evergreen.MongoUsername)
password := os.Getenv(evergreen.MongoPassword)

envUrl := os.Getenv(evergreen.MongodbUrl)
if url == evergreen.DefaultDatabaseURL && envUrl != "" {
url = envUrl
}

return &evergreen.DBSettings{
Url: url,
DB: c.String(dbNameFlagName),
Expand All @@ -65,8 +59,6 @@ func parseDB(c *cli.Context) *evergreen.DBSettings {
Level: c.String(dbRmodeFlagName),
},
AWSAuthEnabled: awsAuthEnabled,
Username: username,
Password: password,
}
}

Expand Down

0 comments on commit 791501c

Please sign in to comment.