pub struct ServerConfigBuilder { /* private fields */ }Expand description
Builds a rustls::ServerConfig backed by a live SPIFFE X509Source.
The resulting server configuration:
- presents the current SPIFFE X.509 SVID as the server certificate
- requires and validates client certificates (mTLS)
- authorizes the client by SPIFFE ID (URI SAN)
Implementations§
Source§impl ServerConfigBuilder
impl ServerConfigBuilder
Sourcepub fn new(source: Arc<X509Source>, opts: ServerConfigOptions) -> Self
pub fn new(source: Arc<X509Source>, opts: ServerConfigOptions) -> Self
Creates a new builder from an X509Source and options.
Sourcepub fn build(self) -> Result<ServerConfig>
pub fn build(self) -> Result<ServerConfig>
Builds the rustls::ServerConfig.
§Errors
Returns an error if:
- the SPIFFE
X509Sourcedoes not currently have an SVID, - the trust bundle for the configured trust domain is missing,
- rustls crypto providers are not installed,
- or the material watcher cannot be initialized.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ServerConfigBuilder
impl !RefUnwindSafe for ServerConfigBuilder
impl Send for ServerConfigBuilder
impl Sync for ServerConfigBuilder
impl Unpin for ServerConfigBuilder
impl !UnwindSafe for ServerConfigBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request