You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/src/handlers/http/modal/mod.rs
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,7 @@ pub struct IngestorMetadata {
61
61
pubdomain_name:String,
62
62
pubbucket_name:String,
63
63
pubtoken:String,
64
+
pubingestor_id:String,
64
65
}
65
66
66
67
implIngestorMetadata{
@@ -71,6 +72,7 @@ impl IngestorMetadata {
71
72
bucket_name:String,
72
73
username:&str,
73
74
password:&str,
75
+
ingestor_id:String,
74
76
) -> Self{
75
77
let token = base64::prelude::BASE64_STANDARD.encode(format!("{}:{}", username, password));
76
78
@@ -82,8 +84,13 @@ impl IngestorMetadata {
82
84
version,
83
85
bucket_name,
84
86
token,
87
+
ingestor_id,
85
88
}
86
89
}
90
+
91
+
pubfnget_ingestor_id(&self) -> String{
92
+
self.ingestor_id.clone()
93
+
}
87
94
}
88
95
89
96
#[cfg(test)]
@@ -102,9 +109,10 @@ mod test {
102
109
"somebucket".to_string(),
103
110
"admin",
104
111
"admin",
112
+
"ingestor_id".to_string(),
105
113
);
106
114
107
-
let rhs = serde_json::from_slice::<IngestorMetadata>(br#"{"version":"v3","port":"8000","domain_name":"https://localhost:8000","bucket_name":"somebucket","token":"Basic YWRtaW46YWRtaW4="}"#).unwrap();
115
+
let rhs = serde_json::from_slice::<IngestorMetadata>(br#"{"version":"v3","port":"8000","domain_name":"https://localhost:8000","bucket_name":"somebucket","token":"Basic YWRtaW46YWRtaW4=", "ingestor_id": "ingestor_id"}"#).unwrap();
108
116
109
117
assert_eq!(rhs, lhs);
110
118
}
@@ -118,13 +126,14 @@ mod test {
118
126
"somebucket".to_string(),
119
127
"admin",
120
128
"admin",
129
+
"ingestor_id".to_string(),
121
130
);
122
131
123
132
let lhs = serde_json::to_string(&im)
124
133
.unwrap()
125
134
.try_into_bytes()
126
135
.unwrap();
127
-
let rhs = br#"{"version":"v3","port":"8000","domain_name":"https://localhost:8000","bucket_name":"somebucket","token":"Basic YWRtaW46YWRtaW4="}"#
136
+
let rhs = br#"{"version":"v3","port":"8000","domain_name":"https://localhost:8000","bucket_name":"somebucket","token":"Basic YWRtaW46YWRtaW4=","ingestor_id":"ingestor_id"}"#
0 commit comments