Changeset View
Changeset View
Standalone View
Standalone View
keyserver/addons/rust-node-addon/src/identity_client/delete_user.rs
use super::*; | use super::*; | ||||
#[napi] | #[napi] | ||||
#[instrument(skip_all)] | #[instrument(skip_all)] | ||||
pub async fn delete_user(user_id: String) -> Result<()> { | pub async fn delete_user(user_id: String) -> Result<()> { | ||||
let channel = get_identity_service_channel().await?; | let channel = get_identity_service_channel().await?; | ||||
let token: MetadataValue<_> = AUTH_TOKEN | let token: MetadataValue<_> = IDENTITY_SERVICE_CONFIG | ||||
.identity_auth_token | |||||
.parse() | .parse() | ||||
.map_err(|_| Error::from_status(Status::GenericFailure))?; | .map_err(|_| Error::from_status(Status::GenericFailure))?; | ||||
let mut identity_client = | let mut identity_client = | ||||
IdentityServiceClient::with_interceptor(channel, |mut req: Request<()>| { | IdentityServiceClient::with_interceptor(channel, |mut req: Request<()>| { | ||||
req.metadata_mut().insert("authorization", token.clone()); | req.metadata_mut().insert("authorization", token.clone()); | ||||
Ok(req) | Ok(req) | ||||
}); | }); | ||||
Show All 10 Lines |