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
Offer configuration and viewing of images for Oauth2 resources #2665
base: master
Are you sure you want to change the base?
Offer configuration and viewing of images for Oauth2 resources #2665
Conversation
Should I prepend the configured origin set in |
Context would help for this question - the Kanidm client library has make_url which can do this for you, and on the web UI you should be using relative URLs |
sry, it was about the object that gets returned in |
But your answer (because this icon field will be used by the web_ui to download the icon) implies that this should return a relative path which a URL is not I think ? Or I'd have to parse the icon url in the web_ui and throw away the host and protocol to make it a rel path. |
Given this is an as-yet completely unused feature, we can define what it is right now in this PR 😄 Realistically since the URL is based on the name ( |
…ode it in the web_ui, we can just use a bool to represent whether this resource has an icon or not.
I'm still gonna add an admin web interface for it but the current code can already be reviewed if you want to review it in smaller parts :) |
@@ -113,6 +98,53 @@ pub async fn do_request<JV: AsRef<JsValue>>( | |||
Ok((kopid, status, body, headers)) | |||
} | |||
|
|||
/// Build and send a request to the backend, with some standard headers and pull back |
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.
I missed this
requested_rem, | ||
rem | ||
); | ||
security_error!("requested_rem: {:?} !⊆ allowed: {:?}", requested_rem, rem); |
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.
What version of rust are you on? Looks like cargo fmt fights here.
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.
rustc 1.77.0-nightly (5518eaa94 2024-01-29)
let name = name.clone(); | ||
spawn_local(async move { | ||
let (_, status, blob, _) = | ||
get_blob(format!("/ui/images/oauth2/{name}").as_str()).await.unwrap(); |
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.
Theres a server uri handler for this?
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.
I discussed with yaleman on the matrix channel about the blob stuff I'm using atm: |
Fixes #2056
Checklist