-
Notifications
You must be signed in to change notification settings - Fork 225
Draft: Support Axum 0.8 #3603
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
base: master
Are you sure you want to change the base?
Draft: Support Axum 0.8 #3603
Conversation
@yaleman Given I'm busy can you have an initial review of this, and I'll take a look in a few days as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking awesome so far, thanks for taking the time to do this upgrade 🥳
I've got a patch here for the tracer shutdown - yaleman@2c0fbf7
Actually trying to run the server stack overflows on startup for me because it wa hitting juhaku/utoipa#1226 - as it works OK if I comment out the swagger UI route here: https://github.com/yaleman/kanidm/blob/2c0fbf7f5dc7690ed1d9880ad3889915513e0a9e/server/core/src/https/apidocs/mod.rs#L329-L333
Currently fiddling with that...
#[utoipa::path( | ||
get, | ||
path = "/v1/jwk/{key_id}", | ||
responses( | ||
(status=200, body=Jwk, content_type="application/json"), | ||
(status=200, body=JwkResponse, content_type="application/json"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please change the import and use this pattern instead? Just from a code clarity perspective.
(status=200, body=JwkResponse, content_type="application/json"), | |
(status=200, body=response_schema::Jwk, content_type="application/json"), |
) -> axum::response::Result<Response> { | ||
let cu_session_token: CUSessionToken = get_cu_session(&jar).await?; | ||
let swapped_handler_trigger = | ||
HxResponseTrigger::after_swap([HxEvent::new("addPasswordSwapped".to_string())]); | ||
|
||
let new_passwords = match opt_form { | ||
None => { | ||
Err(_) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add something here to display the message or at least log the issue, rather than just silently ignore it. (or a // TODO: log/handle errors
)
) -> axum::response::Result<Response> { | ||
let cu_session_token: CUSessionToken = get_cu_session(&jar).await?; | ||
let swapped_handler_trigger = | ||
HxResponseTrigger::after_swap([HxEvent::new("addPasswordSwapped".to_string())]); | ||
|
||
let new_passwords = match opt_form { | ||
None => { | ||
Err(_) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add something here to display the message or at least log the issue, rather than just silently ignore it. (or a // TODO: log/handle errors
)
let cu_session_token: CUSessionToken = get_cu_session(&jar).await?; | ||
|
||
let new_key = match opt_form { | ||
None => { | ||
Err(_e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add something here to display the message or at least log the issue, rather than just silently ignore it. (or a // TODO: log/handle errors
)
@@ -14,7 +14,8 @@ | |||
|
|||
<hr> | |||
|
|||
(% if scim_effective_access.search.check(Attribute::Mail|as_ref) %) | |||
<!-- TODO: issues with as_ref --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Askama comments so we don't shame ourselves too publicly 🤣
<!-- TODO: issues with as_ref --> | |
{# TODO: issues with as_ref #} |
@@ -33,7 +34,8 @@ | |||
</form> | |||
(% endif %) | |||
|
|||
(% if scim_effective_access.search.check(Attribute::DirectMemberOf|as_ref) %) | |||
<!-- TODO: issues with as_ref --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<!-- TODO: issues with as_ref --> | |
{# TODO: issues with as_ref #} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth I hate having logic in the template here, can you move the scim_effective_access.search.check(
out into the rust code please, or add a TODO to do so?
Aha! Found it. yaleman@d5fbff7 fixes the recursion issue/crasher. |
I've PR'd the changes into your branch here: humandi#1 |
Change summary
This adds support for Axum 0.8. Main changes are:
Fixes #
Checklist