Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
a683192b
Commit
a683192b
authored
1 year ago
by
Egor Ivkov
Committed by
Егор Ивков
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: skip on_auth checks for pico service user
parent
0c1d5ab0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!851
fix: panic after revoke login
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib.rs
+18
-1
18 additions, 1 deletion
src/lib.rs
with
18 additions
and
1 deletion
src/lib.rs
+
18
−
1
View file @
a683192b
...
...
@@ -301,6 +301,21 @@ fn set_login_check(storage: Clusterwide) {
let
compute_auth_verdict
=
move
|
user_name
:
String
,
successful_authentication
:
bool
|
{
use
std
::
collections
::
hash_map
::
Entry
;
// If the user is pico service (used for internal communication) we don't perform any additional checks.
// Map result to print audit message, tarantool handles auth automatically.
//
// The reason for not performaing checks is twofold:
// 1. We might not have the user or required privileges in _pico_* spaces yet.
// 2. We should never block pico service user or instances would loose ability to communicate
// with each other.
if
user_name
==
PICO_SERVICE_USER_NAME
{
if
successful_authentication
{
return
Verdict
::
AuthOk
;
}
else
{
return
Verdict
::
AuthFail
;
}
}
// Switch to admin to access system spaces.
let
admin_guard
=
session
::
su
(
ADMIN_ID
)
.expect
(
"switching to admin should not fail"
);
let
max_login_attempts
=
storage
...
...
@@ -406,7 +421,9 @@ fn set_login_check(storage: Clusterwide) {
);
// Raises an error instead of returning it as a function result.
// This is the behavior required by `on_auth` trigger to drop the connection.
// This is the behavior required by `on_auth` trigger to drop the connection
// even if auth was successful. If auth failed the connection will be dropped automatically.
//
// All the drop implementations are called, no need to clean anything up.
tlua
::
error!
(
lua
,
"{}"
,
err
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment