CoRIM Store (V2)#
Fetches CoRIM bodies from rim-locator URLs for the local verifier.
Configure it, then inject it into nvat_local_corim_verifier_create.
Functions#
- nvat_rc_t nvat_corim_store_add_allowed_url_prefix(nvat_corim_store_t store, const char *prefix)
Append an https:// prefix to the raw-URL allowlist checked before any rewrite.
- nvat_rc_t nvat_corim_store_add_url_rewrite(nvat_corim_store_t store, const char *pattern, const char *replacement)
Append a rim-locator URL rewrite rule (prefix substitution).
- nvat_rc_t nvat_corim_store_create(nvat_corim_store_t *out_store, const char *service_key, const nvat_http_options_t http_options)
Create a CoRIM store seeded with the NVIDIA RIM allowlist prefix.
- nvat_rc_t nvat_corim_store_enable_in_memory_cache(nvat_corim_store_t store, uint64_t max_size_bytes, time_t ttl_seconds)
Enable in-memory LRU+TTL caching on a CoRIM store.
- nvat_rc_t nvat_corim_store_enable_negative_cache(nvat_corim_store_t store, uint64_t max_size_bytes, time_t ttl_seconds)
Enable a separate cache for missing CoRIMs.
- void nvat_corim_store_free(nvat_corim_store_t *store)
Typedefs#
- nvat_corim_store_t
Opaque handle to a CoRIM store.
Functions#
- nvat_rc_t nvat_corim_store_add_allowed_url_prefix(
- nvat_corim_store_t store,
- const char *prefix,
Append an https:// prefix to the raw-URL allowlist checked before any rewrite.
- nvat_rc_t nvat_corim_store_add_url_rewrite(
- nvat_corim_store_t store,
- const char *pattern,
- const char *replacement,
Append a rim-locator URL rewrite rule (prefix substitution).
When a rim-locator URL starts with
pattern, the prefix is replaced withreplacementbefore fetching. Rules apply in insertion order; first match wins. The pre-rewrite URL must still pass the allowlist, so rules redirect the allowed endpoint to file:// mirrors or staging hosts without weakening the input gate.
- nvat_rc_t nvat_corim_store_create(
- nvat_corim_store_t *out_store,
- const char *service_key,
- const nvat_http_options_t http_options,
Create a CoRIM store seeded with the NVIDIA RIM allowlist prefix.
- Parameters:
out_store – On success, receives the store handle. Free with nvat_corim_store_free.
service_key – Service key for https RIM fetches. Pass NULL or “” for none.
http_options – HTTP options. NULL uses defaults.
- nvat_rc_t nvat_corim_store_enable_in_memory_cache(
- nvat_corim_store_t store,
- uint64_t max_size_bytes,
- time_t ttl_seconds,
Enable in-memory LRU+TTL caching on a CoRIM store.
Subsequent calls to the store’s internal fetch path check the cache before making any network or filesystem request. The cache key is the effective URL after rewrites. Must be called before nvat_local_corim_verifier_create transfers ownership of the store.
- Parameters:
store – The store to configure. Must not be NULL.
max_size_bytes – Maximum total byte capacity of the cache. Must be > 0.
ttl_seconds – Time-to-live for each cached entry in seconds. Must be >= 0.
- Returns:
NVAT_RC_OK on success, NVAT_RC_BAD_ARGUMENT if store is NULL, max_size_bytes is 0, or ttl_seconds is negative.
- nvat_rc_t nvat_corim_store_enable_negative_cache(
- nvat_corim_store_t store,
- uint64_t max_size_bytes,
- time_t ttl_seconds,
Enable a separate cache for missing CoRIMs.
Negative caching is disabled by default. Only completed HTTP 404 responses are cached, using the effective URL after authorization and rewrites as the key. Requests for a cached URL return NVAT_RC_RIM_NOT_FOUND without a network request. Transport failures, other HTTP errors and local file failures are not cached. A newly published CoRIM may remain unavailable until its cached 404 expires. Configure the cache before calling nvat_local_corim_verifier_create, which takes ownership of the store.
- Parameters:
store – Store to configure. Must not be NULL.
max_size_bytes – Capacity for one URL and a boolean marker per entry; excludes cache bookkeeping. Must be > 0, including when disabling the cache.
ttl_seconds – Lifetime in seconds; 0 disables and clears the cache. Must be >= 0. Hits do not extend the lifetime.
- Returns:
NVAT_RC_OK on success; NVAT_RC_BAD_ARGUMENT for a NULL store, zero capacity or negative TTL. Invalid settings leave caches intact.
-
void nvat_corim_store_free(nvat_corim_store_t *store)#
Typedefs#
-
typedef struct nvat_corim_store_st *nvat_corim_store_t#
Opaque handle to a CoRIM store.