From 89a15c948b3555be7b42ee77be172ed8b7ce0dbb Mon Sep 17 00:00:00 2001 From: Marek Smolinski Date: Mon, 27 Sep 2021 14:16:49 +0200 Subject: [PATCH] update --- lib/auth/auth.go | 16 ---------------- lib/srv/db/common/role/role.go | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/lib/auth/auth.go b/lib/auth/auth.go index 3a78af3fab3ef..3e72baafbf0d7 100644 --- a/lib/auth/auth.go +++ b/lib/auth/auth.go @@ -3090,22 +3090,6 @@ func (a *Server) isMFARequired(ctx context.Context, checker services.AccessCheck return &proto.IsMFARequiredResponse{Required: true}, nil } -func databaseRoleMatchers(dbProtocol string, user, database string, labels map[string]string) services.RoleMatchers { - switch dbProtocol { - case defaults.ProtocolPostgres: - return services.RoleMatchers{ - &services.DatabaseLabelsMatcher{Labels: labels}, - &services.DatabaseUserMatcher{User: user}, - &services.DatabaseNameMatcher{Name: database}, - } - default: - return services.RoleMatchers{ - &services.DatabaseLabelsMatcher{Labels: labels}, - &services.DatabaseUserMatcher{User: user}, - } - } -} - // mfaAuthChallenge constructs an MFAAuthenticateChallenge for all MFA devices // registered by the user. func (a *Server) mfaAuthChallenge(ctx context.Context, user string, u2fStorage u2f.AuthenticationStorage) (*proto.MFAAuthenticateChallenge, error) { diff --git a/lib/srv/db/common/role/role.go b/lib/srv/db/common/role/role.go index 2d74ccf63be04..b9f901a85ad73 100644 --- a/lib/srv/db/common/role/role.go +++ b/lib/srv/db/common/role/role.go @@ -46,4 +46,4 @@ func DatabaseRoleMatchers(dbProtocol string, user, database string, labels map[s &services.DatabaseNameMatcher{Name: database}, } } -} \ No newline at end of file +}