sansmoraxz commented on code in PR #4055:
URL: https://github.com/apache/iggy/pull/4055#discussion_r3980423652


##########
core/server/src/http/handlers.rs:
##########
@@ -1799,6 +1866,103 @@ pub(in crate::http) async fn delete_pat(
     Ok(StatusCode::NO_CONTENT)
 }
 
+/// Try external auth for an HTTP login. Returns `Some(result)` when the
+/// external service responded (grant or deny) or when a callout failure
+/// produces a terminal deny. Returns `None` when the caller should fall
+/// through to built-in credential verification.
+async fn try_external_auth_http_login(
+    state: &HttpInner,
+    credential_type: CredentialType,
+    username: &str,
+    credential_value: &str,
+    client_address: &str,
+) -> Option<Result<Json<IdentityInfo>, CustomError>> {
+    use configs::external_auth::ExternalAuthErrorStrategy;
+
+    let credential = state
+        .external_auth
+        .forward_credentials
+        .then(|| credential_value.to_owned());
+    let request = ExternalAuthRequest {
+        credential_type,
+        credential,
+        username: username.to_owned(),
+        transport: "http".to_owned(),
+        client_address: client_address.to_owned(),
+    };
+    let decision = match try_external_auth(&state.external_auth, 
request).await {
+        Ok(Some(decision)) => decision,
+        Ok(None) => return None,
+        Err(_) => {

Review Comment:
   no longer relevant



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to