risingwave_frontend/catalog/
secret_catalog.rs1use risingwave_pb::catalog::PbSecret;
16
17use crate::catalog::{DatabaseId, OwnedByUserCatalog, SchemaId, SecretId};
18use crate::user::UserId;
19
20#[derive(Clone, Debug, PartialEq, Eq, Hash)]
21pub struct SecretCatalog {
22 pub id: SecretId,
23 pub name: String,
24 pub database_id: DatabaseId,
25 pub schema_id: SchemaId,
26 pub value: Vec<u8>,
27 pub owner: UserId,
28}
29
30impl From<&PbSecret> for SecretCatalog {
31 fn from(value: &PbSecret) -> Self {
32 Self {
33 id: SecretId::new(value.id),
34 database_id: value.database_id,
35 owner: value.owner,
36 name: value.name.clone(),
37 value: value.value.clone(),
38 schema_id: value.schema_id,
39 }
40 }
41}
42
43impl OwnedByUserCatalog for SecretCatalog {
44 fn owner(&self) -> UserId {
45 self.owner
46 }
47}