bitwarden_api_api/models/register_access_connector_request_model.rs
1/*
2 * Bitwarden Internal API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: latest
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15/// RegisterAccessConnectorRequestModel : Registers a new access connector (spec
16/// `ConnectorRegistration`).
17/// Bit.Services.Pam.AccessConnector.Api.Models.Request.RegisterAccessConnectorRequestModel.
18/// EncryptedPayload and
19/// Bit.Services.Pam.AccessConnector.Api.Models.Request.RegisterAccessConnectorRequestModel.Key
20/// carry the organization key wrapped client-side, so the server holds ciphertext only and never
21/// sees the plaintext key.
22/// Bit.Services.Pam.AccessConnector.Api.Models.Request.RegisterAccessConnectorRequestModel.Name is
23/// a plaintext display label.
24#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
25pub struct RegisterAccessConnectorRequestModel {
26 /// The access connector's plaintext display label, shown wherever access connectors are listed
27 /// and managed.
28 #[serde(rename = "name", alias = "Name")]
29 pub name: String,
30 /// The organization key, wrapped client-side with the encryption-key half of the access
31 /// connector's credential. Stored verbatim and handed back on every token response so the
32 /// access connector can unwrap it locally; the server only ever holds the ciphertext.
33 #[serde(rename = "encryptedPayload", alias = "EncryptedPayload")]
34 pub encrypted_payload: String,
35 /// The key protecting
36 /// Bit.Services.Pam.AccessConnector.Api.Models.Request.RegisterAccessConnectorRequestModel.
37 /// EncryptedPayload, itself uploaded wrapped -- opaque ciphertext the server stores but can
38 /// never use, recoverable only client-side.
39 #[serde(rename = "key", alias = "Key")]
40 pub key: String,
41}
42
43impl RegisterAccessConnectorRequestModel {
44 /// Registers a new access connector (spec `ConnectorRegistration`).
45 /// Bit.Services.Pam.AccessConnector.Api.Models.Request.RegisterAccessConnectorRequestModel.
46 /// EncryptedPayload and
47 /// Bit.Services.Pam.AccessConnector.Api.Models.Request.RegisterAccessConnectorRequestModel.Key
48 /// carry the organization key wrapped client-side, so the server holds ciphertext only and
49 /// never sees the plaintext key.
50 /// Bit.Services.Pam.AccessConnector.Api.Models.Request.RegisterAccessConnectorRequestModel.Name
51 /// is a plaintext display label.
52 pub fn new(
53 name: String,
54 encrypted_payload: String,
55 key: String,
56 ) -> RegisterAccessConnectorRequestModel {
57 RegisterAccessConnectorRequestModel {
58 name,
59 encrypted_payload,
60 key,
61 }
62 }
63}