Skip to content

Commit 801210c

Browse files
authored
collab: Make github_user_login required in LlmTokenClaims (#18882)
This PR makes the `github_user_login` field required in the `LlmTokenClaims`. We previously added this in #16316 and made it optional for backwards-compatibility. It's been more than long enough for all of the previous LLM tokens to have expired, so we can now make the field required. Release Notes: - N/A
1 parent f861479 commit 801210c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

crates/collab/src/llm/token.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,8 @@ pub struct LlmTokenClaims {
1313
pub exp: u64,
1414
pub jti: String,
1515
pub user_id: u64,
16-
// This field is temporarily optional so it can be added
17-
// in a backwards-compatible way. We can make it required
18-
// once all of the LLM tokens have cycled (~1 hour after
19-
// this change has been deployed).
20-
#[serde(default)]
21-
pub github_user_login: Option<String>,
16+
pub github_user_login: String,
2217
pub is_staff: bool,
23-
#[serde(default)]
2418
pub has_llm_closed_beta_feature_flag: bool,
2519
// This field is temporarily optional so it can be added
2620
// in a backwards-compatible way. We can make it required
@@ -54,7 +48,7 @@ impl LlmTokenClaims {
5448
exp: (now + LLM_TOKEN_LIFETIME).timestamp() as u64,
5549
jti: uuid::Uuid::new_v4().to_string(),
5650
user_id: user_id.to_proto(),
57-
github_user_login: Some(github_user_login),
51+
github_user_login,
5852
is_staff,
5953
has_llm_closed_beta_feature_flag,
6054
has_llm_subscription: Some(has_llm_subscription),

0 commit comments

Comments
 (0)