securitydept_token_set_context/
orchestration.rs1pub use securitydept_oauth_provider::OidcSharedConfig;
16pub use securitydept_oauth_provider::{OAuthProviderConfig, OAuthProviderRuntime};
19pub use securitydept_oauth_resource_server::{
20 OAuthResourceServerConfig, OAuthResourceServerIntrospectionConfig,
21};
22pub use securitydept_oidc_client::{
23 OidcClient, OidcClientConfig, OidcClientRawConfig, PendingOauthStoreConfig,
24};
25
26#[derive(Debug)]
36pub enum BackendConfigError {
37 OidcClient(securitydept_oidc_client::OidcError),
38 ResourceServer(securitydept_oauth_resource_server::OAuthResourceServerError),
39 BackendOidcModeRuntime(crate::backend_oidc_mode::BackendOidcModeRuntimeError),
40 TokenPropagation(crate::access_token_substrate::TokenPropagatorError),
41}
42
43impl std::fmt::Display for BackendConfigError {
44 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
45 match self {
46 Self::OidcClient(e) => write!(f, "oidc_client config: {e}"),
47 Self::ResourceServer(e) => write!(f, "oauth_resource_server config: {e}"),
48 Self::BackendOidcModeRuntime(e) => write!(f, "backend_oidc_mode_runtime: {e}"),
49 Self::TokenPropagation(e) => write!(f, "token_propagation config: {e}"),
50 }
51 }
52}
53
54impl std::error::Error for BackendConfigError {
55 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
56 match self {
57 Self::OidcClient(e) => Some(e),
58 Self::ResourceServer(e) => Some(e),
59 Self::BackendOidcModeRuntime(e) => Some(e),
60 Self::TokenPropagation(e) => Some(e),
61 }
62 }
63}
64
65impl From<securitydept_oidc_client::OidcError> for BackendConfigError {
66 fn from(e: securitydept_oidc_client::OidcError) -> Self {
67 Self::OidcClient(e)
68 }
69}
70
71impl From<securitydept_oauth_resource_server::OAuthResourceServerError> for BackendConfigError {
72 fn from(e: securitydept_oauth_resource_server::OAuthResourceServerError) -> Self {
73 Self::ResourceServer(e)
74 }
75}
76
77impl From<crate::backend_oidc_mode::BackendOidcModeRuntimeError> for BackendConfigError {
78 fn from(e: crate::backend_oidc_mode::BackendOidcModeRuntimeError) -> Self {
79 Self::BackendOidcModeRuntime(e)
80 }
81}