Skip to content

Commit 92b6bae

Browse files
author
Divjot Arora
committed
GODRIVER-1364 Allow authentication to all server types except arbiters (#203)
1 parent a2be3fb commit 92b6bae

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

x/mongo/driver/auth/auth.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ func (ah *authHandshaker) FinishHandshake(ctx context.Context, conn driver.Conne
8383
performAuth := ah.options.PerformAuthentication
8484
if performAuth == nil {
8585
performAuth = func(serv description.Server) bool {
86-
return serv.Kind == description.RSPrimary ||
87-
serv.Kind == description.RSSecondary ||
88-
serv.Kind == description.Mongos ||
89-
serv.Kind == description.Standalone
86+
// Authentication is possible against all server types except arbiters
87+
return serv.Kind != description.RSArbiter
9088
}
9189
}
9290
desc := conn.Description()

0 commit comments

Comments
 (0)