collab: Make account age-related fields required in LlmTokenClaims
(#26959)
This PR makes the account age-related fields required in `LlmTokenClaims`. We've also removed the account age check from the LLM token issuance endpoint, instead having it solely be enforced in the `POST /completion` endpoint. This change will be safe to deploy at ~8:01PM EDT. Release Notes: - N/A
This commit is contained in:
parent
0851842d2c
commit
cd5d7e82d0
3 changed files with 4 additions and 26 deletions
|
@ -220,10 +220,8 @@ async fn perform_completion(
|
|||
|
||||
let bypass_account_age_check = claims.has_llm_subscription || claims.bypass_account_age_check;
|
||||
if !bypass_account_age_check {
|
||||
if let Some(account_created_at) = claims.account_created_at {
|
||||
if Utc::now().naive_utc() - account_created_at < MIN_ACCOUNT_AGE_FOR_LLM_USE {
|
||||
Err(anyhow!("account too young"))?
|
||||
}
|
||||
if Utc::now().naive_utc() - claims.account_created_at < MIN_ACCOUNT_AGE_FOR_LLM_USE {
|
||||
Err(anyhow!("account too young"))?
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue