Skip to content

Commit 93e8bf5

Browse files
committed
Change /healthcheck with database reponse to previous state
1 parent 87f81a3 commit 93e8bf5

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

ydb/core/viewer/viewer_healthcheck.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,20 +124,6 @@ class TJsonHealthCheck : public TViewerPipeClient {
124124
return checkAccessMonitoring;
125125
}
126126

127-
{ // TODO(yurikiselev): DEAL WITH IT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
128-
// When enforce_user_token is on and a token is present, require monitoring access for JSON
129-
// (do not use the legacy IsDatabaseRequest bypass that incorrectly allows e.g. user@builtin).
130-
const auto enforceUserToken = config.AppConfig.GetDomainsConfig().GetSecurityConfig().GetEnforceUserTokenRequirement();
131-
const TString tokenSerialized = GetRequest().GetUserTokenObject();
132-
if (enforceUserToken && !tokenSerialized.empty()) {
133-
return checkAccessMonitoring;
134-
}
135-
// Legacy: database-prefixed URL without token was historically allowed.
136-
if (enforceUserToken && tokenSerialized.empty() && !Database.empty()) {
137-
return true;
138-
}
139-
}
140-
141127
// The database requests were left without any authentication checks for a long time,
142128
// so we ignore access check for it by default.
143129
return IsDatabaseRequest() || checkAccessMonitoring;

ydb/tests/functional/security/test_mon_endpoints_auth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ def ydb_cluster_with_require_healthcheck_auth(certificates):
246246
},
247247
'/healthcheck?database=%2FRoot': {
248248
None: 200,
249-
'user@builtin': 403,
250-
'database@builtin': 403,
251-
'viewer@builtin': 403,
249+
'user@builtin': 200,
250+
'database@builtin': 200,
251+
'viewer@builtin': 200,
252252
'monitoring@builtin': 200,
253253
'root@builtin': 200,
254254
},

0 commit comments

Comments
 (0)