mirror of
https://github.com/kanidm/kanidm.git
synced 2025-06-12 11:07:46 +02:00
Refactored prefix stripping to make clippy happy
This commit is contained in:
parent
ecff7bb92c
commit
de38b4e72e
server/core/src
|
@ -1517,12 +1517,12 @@ impl QueryServerReadV1 {
|
|||
)]
|
||||
pub async fn handle_oauth2_webfinger_discovery(
|
||||
&self,
|
||||
client_id: String,
|
||||
resource_id: String,
|
||||
client_id: &str,
|
||||
resource_id: &str,
|
||||
eventid: Uuid,
|
||||
) -> Result<OidcWebfingerResponse, OperationError> {
|
||||
let mut idms_prox_read = self.idms.proxy_read().await?;
|
||||
idms_prox_read.oauth2_openid_webfinger(&client_id, &resource_id)
|
||||
idms_prox_read.oauth2_openid_webfinger(client_id, resource_id)
|
||||
}
|
||||
|
||||
#[instrument(
|
||||
|
|
|
@ -554,15 +554,11 @@ pub async fn oauth2_openid_webfinger_get(
|
|||
) -> impl IntoResponse {
|
||||
let Oauth2OpenIdWebfingerQuery { resource } = query;
|
||||
|
||||
let cleaned_resource = if resource.starts_with("acct:") {
|
||||
resource[5..].to_string()
|
||||
} else {
|
||||
resource.clone()
|
||||
};
|
||||
let cleaned_resource = resource.strip_prefix("acct:").unwrap_or(&resource);
|
||||
|
||||
let res = state
|
||||
.qe_r_ref
|
||||
.handle_oauth2_webfinger_discovery(client_id, cleaned_resource, kopid.eventid)
|
||||
.handle_oauth2_webfinger_discovery(&client_id, cleaned_resource, kopid.eventid)
|
||||
.await;
|
||||
|
||||
match res {
|
||||
|
|
Loading…
Reference in a new issue