Skip to content

Commit 293462c

Browse files
committed
Rename field pccs_url to url
1 parent 35ea2c7 commit 293462c

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

crates/pccs/src/lib.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const STARTUP_PREWARM_CONCURRENCY: usize = 8;
3232
#[derive(Clone)]
3333
pub struct Pccs {
3434
/// The URL of the service used to fetch collateral (PCS / PCCS)
35-
pccs_url: String,
35+
url: String,
3636
/// The internal cache
3737
cache: Arc<RwLock<HashMap<PccsInput, CacheEntry>>>,
3838
/// The state of the initial pre-warm fetch
@@ -45,14 +45,14 @@ impl std::fmt::Debug for Pccs {
4545
/// Formats PCCS config for debug output without exposing cache
4646
/// internals
4747
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
48-
f.debug_struct("Pccs").field("pccs_url", &self.pccs_url).finish_non_exhaustive()
48+
f.debug_struct("Pccs").field("url", &self.url).finish_non_exhaustive()
4949
}
5050
}
5151

5252
impl Pccs {
5353
/// Creates a new PCCS cache using the provided URL or Intel PCS default
54-
pub fn new(pccs_url: Option<String>) -> Self {
55-
let pccs_url = pccs_url
54+
pub fn new(url: Option<String>) -> Self {
55+
let url = url
5656
.unwrap_or(PCS_URL.to_string())
5757
.trim_end_matches('/')
5858
.trim_end_matches("/sgx/certification/v4")
@@ -61,7 +61,7 @@ impl Pccs {
6161

6262
let (prewarm_outcome_tx, _) = watch::channel(None);
6363
let pccs = Self {
64-
pccs_url,
64+
url,
6565
cache: RwLock::new(HashMap::new()).into(),
6666
prewarm_stats: Arc::new(PrewarmStats::default()),
6767
prewarm_outcome_tx,
@@ -121,7 +121,7 @@ impl Pccs {
121121
}
122122
}
123123

124-
let collateral = fetch_collateral(&self.pccs_url, fmspc.clone(), ca).await?;
124+
let collateral = fetch_collateral(&self.url, fmspc.clone(), ca).await?;
125125
let next_update = extract_next_update(&collateral, now)?;
126126

127127
let mut cache = self.cache.write().await;
@@ -145,7 +145,7 @@ impl Pccs {
145145
ca: &'static str,
146146
now: i64,
147147
) -> Result<QuoteCollateralV3, PccsError> {
148-
let collateral = fetch_collateral(&self.pccs_url, fmspc.clone(), ca).await?;
148+
let collateral = fetch_collateral(&self.url, fmspc.clone(), ca).await?;
149149
let next_update = extract_next_update(&collateral, now)?;
150150
let cache_key = PccsInput::new(fmspc, ca);
151151

@@ -170,9 +170,9 @@ impl Pccs {
170170

171171
let weak_cache = Arc::downgrade(&self.cache);
172172
let key = cache_key.clone();
173-
let pccs_url = self.pccs_url.clone();
173+
let url = self.url.clone();
174174
entry.refresh_task = Some(tokio::spawn(async move {
175-
refresh_loop(weak_cache, pccs_url, key).await;
175+
refresh_loop(weak_cache, url, key).await;
176176
}));
177177
}
178178

@@ -271,7 +271,7 @@ impl Pccs {
271271

272272
/// Fetches available FMSPC entries from configured PCCS/PCS endpoint
273273
async fn fetch_fmspcs(&self) -> Result<Vec<FmspcEntry>, PccsError> {
274-
let url = format!("{}/sgx/certification/v4/fmspcs", self.pccs_url);
274+
let url = format!("{}/sgx/certification/v4/fmspcs", self.url);
275275
let client = reqwest::Client::builder().timeout(Duration::from_secs(15)).build()?;
276276
let response = client.get(&url).send().await?;
277277
if !response.status().is_success() {
@@ -314,12 +314,12 @@ impl PccsInput {
314314

315315
/// Fetches collateral from PCCS for a given FMSPC and CA
316316
async fn fetch_collateral(
317-
pccs_url: &str,
317+
url: &str,
318318
fmspc: String,
319319
ca: &'static str,
320320
) -> Result<QuoteCollateralV3, PccsError> {
321321
get_collateral_for_fmspc(
322-
pccs_url, fmspc, ca, false, // Indicates not SGX
322+
url, fmspc, ca, false, // Indicates not SGX
323323
)
324324
.await
325325
.map_err(Into::into)

0 commit comments

Comments
 (0)