-
Notifications
You must be signed in to change notification settings - Fork 292
Move external auth cache configuration into the pool object #5983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
773b1bb
ce7e543
68744c2
19c6371
1c00a73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3781,6 +3781,29 @@ let set_local_auth_max_threads ~__context:_ ~self:_ ~value = | |
let set_ext_auth_max_threads ~__context:_ ~self:_ ~value = | ||
Xapi_session.set_ext_auth_max_threads value | ||
|
||
let set_ext_auth_cache_enabled ~__context ~self ~value:enabled = | ||
Db.Pool.set_ext_auth_cache_enabled ~__context ~self ~value:enabled ; | ||
if not enabled then | ||
Xapi_session.clear_external_auth_cache () | ||
|
||
let set_ext_auth_cache_size ~__context ~self ~value:capacity = | ||
if capacity < 0L then | ||
raise | ||
Api_errors.( | ||
Server_error (invalid_value, ["size"; Int64.to_string capacity]) | ||
) | ||
else | ||
Db.Pool.set_ext_auth_cache_size ~__context ~self ~value:capacity | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't you want to call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That could be the behaviour, if we wanted it. It's just quite a static setting overall, in that we don't support changing the size in a dynamic way that would imply the truncation of the cache's current contents at runtime. Kind of hoping these settings are fairly static and never played with. You don't need to restart xapi though, as disable and re-enabling both external authentication generally and the cache feature has the effect of clearing the cache (upon disable). So the new changes would be picked up at the next external authentication attempt. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, that's fine. If we were to actually publish this in the API docs, it would be good to mention this there (the need to disable+re-enable). |
||
|
||
let set_ext_auth_cache_expiry ~__context ~self ~value:expiry_seconds = | ||
if expiry_seconds <= 0L then | ||
raise | ||
Api_errors.( | ||
Server_error (invalid_value, ["expiry"; Int64.to_string expiry_seconds]) | ||
) | ||
else | ||
Db.Pool.set_ext_auth_cache_expiry ~__context ~self ~value:expiry_seconds | ||
|
||
let get_guest_secureboot_readiness ~__context ~self:_ = | ||
let auth_files = Sys.readdir !Xapi_globs.varstore_dir in | ||
let pk_present = Array.mem "PK.auth" auth_files in | ||
|
Uh oh!
There was an error while loading. Please reload this page.