pub struct RevocationClientBuilder { /* private fields */ }Expand description
Builder for RevocationClient. Obtain one via
RevocationClient::builder.
Implementations§
Source§impl RevocationClientBuilder
impl RevocationClientBuilder
Sourcepub fn client_id(self, client_id: impl Into<String>) -> Self
pub fn client_id(self, client_id: impl Into<String>) -> Self
Sets the OAuth client identifier. Required.
Sourcepub fn client_secret(self, client_secret: impl Into<String>) -> Self
pub fn client_secret(self, client_secret: impl Into<String>) -> Self
Sets the OAuth client secret. Required — RFC 7009 §2.1 requires the revocation endpoint to authenticate the client.
Sourcepub fn revocation_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn revocation_endpoint(self, endpoint: impl Into<String>) -> Self
Sets the revocation endpoint URL. Required.
This is the revocation_endpoint member of the authorization server’s
metadata document (RFC 8414 §2, REV-005), so it can be taken straight
from crate::discovery::ProviderMetadata::revocation_endpoint rather
than configured by hand.
Sourcepub fn auth_method(self, method: ClientAuthMethod) -> Self
pub fn auth_method(self, method: ClientAuthMethod) -> Self
Selects the client-authentication method. Defaults to
client_secret_basic.
Sourcepub fn extra_param(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn extra_param( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Adds one extra form parameter. Reserved parameters are ignored — see
RevocationClient::revoke.
Sourcepub fn extra_params(self, params: HashMap<String, String>) -> Self
pub fn extra_params(self, params: HashMap<String, String>) -> Self
Adds several extra form parameters.
Sourcepub fn http_client(self, client: HttpClient) -> Self
pub fn http_client(self, client: HttpClient) -> Self
Supplies a pre-configured HTTP client.
Defaults to a non-redirecting client. The token travels in the request
body, and following a redirect either drops it (301/302/303, where the
POST is rewritten to a GET) and reports a false success, or replays it —
with client_secret on the client_secret_post path — to the redirect
target (307/308). A caller who overrides this takes on that risk.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Sets the per-request timeout. Zero means the 30-second default.
Sourcepub fn allow_http(self, allow: bool) -> Self
pub fn allow_http(self, allow: bool) -> Self
Permits a plain-http revocation endpoint. Development only: the token being revoked travels in the request body.
Sourcepub fn build(self) -> Result<RevocationClient>
pub fn build(self) -> Result<RevocationClient>
Builds the client.
§Errors
IdentityError::Configuration if client_id, client_secret, or
revocation_endpoint is missing or empty.