#[serde(rename = "publicKey", with = "base64::fixed_length")]
public_key: [u8; PublicKey::LENGTH],
// Note: OnPrem directory omits this parameter for some reason, so we need a default #[serde(default, rename = "state")]
activity_state: ActivityState,
/// Process the identities result and map it to all valid identities. /// /// IMPORTANT: Identities that do not exist or have already been revoked will not be included! pub(crate) fn handle_identities_result(result: HttpsResult) -> Result<Vec<ContactInit>, HttpsEndpointError> { let response = handle_status(result, |_| None)?; let IdentitiesResponse { identities } = serde_json::from_slice(&response.body)?;
Ok(identities.into_iter().map(ContactInit::from).collect())
}
/// Process the result after attempting to create an identity. pub(crate) fn handle_create_identity_result(
result: HttpsResult,
) -> Result<CreateIdentityResponse, HttpsEndpointError> { let response = handle_status_and_awkward_response(result, |_| None)?;
Ok(serde_json::from_slice(&response.body)?)
}
/// Request an authentication challenge to update work properties. /// /// Note: Technically, this is a part that the work directory should do but historically it is part of the /// directory. So, we're reflecting that... for now. pub(crate) fn update_work_properties_authentication_request(
client_info: &ClientInfo,
directory_server_url: &DirectoryServerBaseUrl,
work_context: &WorkContext,
identity: ThreemaId,
) -> HttpsRequest {
HttpsRequest {
timeout: TIMEOUT,
url: directory_server_url.update_work_properties_path(),
method: HttpsMethod::Post,
headers: https_headers_with_authentication(work_context)
.accept("application/json")
.build(client_info),
body: serde_json::to_vec(&UpdateWorkPropertiesRequest {
credentials: (&work_context.credentials).into(),
identity,
version: &client_info.to_semicolon_separated(),
})
.expect("Failed to create update work properties challenge request body"),
}
}
/// Update work properties. /// /// Note: Technically, this is a part that the work directory should do but historically it is part of the /// directory. So, we're reflecting that... for now. pub(crate) fn update_work_properties_request(
client_info: &ClientInfo,
directory_server_url: &DirectoryServerBaseUrl,
work_context: &WorkContext,
identity: ThreemaId,
authentication: AuthenticationChallengeResponse,
) -> HttpsRequest {
HttpsRequest {
timeout: TIMEOUT,
url: directory_server_url.update_work_properties_path(),
method: HttpsMethod::Post,
headers: https_headers_with_authentication(work_context)
.accept("application/json")
.build(client_info),
body: serde_json::to_vec(&UpdateWorkPropertiesAuthenticatedRequest {
request: UpdateWorkPropertiesRequest {
credentials: (&work_context.credentials).into(),
identity,
version: &client_info.to_semicolon_separated(),
},
authentication,
})
.expect("Failed to create update work properties request body"),
}
}
/// Process the result after attempting to update work properties. pub(crate) fn handle_update_work_properties_result(result: HttpsResult) -> Result<(), HttpsEndpointError> { let _ = handle_status_and_awkward_response(result, |_| None)?;
Ok(())
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.