WIP fase 2b-3: rimozione sottosistemi solo-ChatGPT (plugin remoti, image gen, daybreak, cyber, attestation, cloud config, app/connettori) - test in corso
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,8 +6,6 @@ use rmcp::transport::DynamicTransportError;
|
||||
use rmcp::transport::auth::AuthError;
|
||||
use rmcp::transport::streamable_http_client::StreamableHttpError;
|
||||
|
||||
use crate::ema_auth_policy::EmaAuthFailure;
|
||||
use crate::ema_auth_policy::EmaInvalidGrantSource;
|
||||
use crate::http_client_adapter::StreamableHttpClientAdapterError;
|
||||
use crate::rmcp_client::ClientOperationError;
|
||||
|
||||
@@ -18,31 +16,9 @@ use crate::rmcp_client::ClientOperationError;
|
||||
/// transport error, which is not part of the standard error source chain.
|
||||
pub fn is_authentication_required_error(error: &Error) -> bool {
|
||||
error.chain().any(|source| {
|
||||
if let Some(error) = source.downcast_ref::<crate::EmaTokenSourceError>() {
|
||||
return error.is_authentication_required();
|
||||
}
|
||||
source
|
||||
.downcast_ref::<AuthError>()
|
||||
.is_some_and(auth_error_requires_authentication)
|
||||
|| source
|
||||
.downcast_ref::<EmaAuthFailure>()
|
||||
.is_some_and(|error| match error {
|
||||
EmaAuthFailure::InvalidGrant {
|
||||
grant_source: EmaInvalidGrantSource::EnterpriseIdentity,
|
||||
}
|
||||
| EmaAuthFailure::InsufficientUserAuthentication {
|
||||
grant_source: EmaInvalidGrantSource::EnterpriseIdentity,
|
||||
}
|
||||
| EmaAuthFailure::IdentityClientRejected
|
||||
| EmaAuthFailure::ReauthenticationRequired => true,
|
||||
// Rejecting an ID-JAG does not invalidate the enterprise login itself.
|
||||
EmaAuthFailure::InvalidGrant {
|
||||
grant_source: EmaInvalidGrantSource::ResourceAuthorization,
|
||||
}
|
||||
| EmaAuthFailure::InsufficientUserAuthentication {
|
||||
grant_source: EmaInvalidGrantSource::ResourceAuthorization,
|
||||
} => false,
|
||||
})
|
||||
|| source
|
||||
.downcast_ref::<ExecServerError>()
|
||||
.is_some_and(exec_server_error_requires_authentication)
|
||||
|
||||
Reference in New Issue
Block a user