collab: Remove unused `api_token` field from `Config` (#56098)

Marshall Bowers created

This PR removes the `api_token` field from Collab's `Config`, as it is
no longer used.

Release Notes:

- N/A

Change summary

crates/collab/.env.toml                        | 1 -
crates/collab/k8s/collab.template.yml          | 5 -----
crates/collab/src/auth.rs                      | 3 +--
crates/collab/src/lib.rs                       | 2 --
crates/collab/tests/integration/test_server.rs | 1 -
5 files changed, 1 insertion(+), 11 deletions(-)

Detailed changes

crates/collab/.env.toml 🔗

@@ -2,7 +2,6 @@ DATABASE_URL = "postgres://postgres@localhost/zed"
 # DATABASE_URL = "sqlite:////root/0/zed/db.sqlite3?mode=rwc"
 DATABASE_MAX_CONNECTIONS = 5
 HTTP_PORT = 8080
-API_TOKEN = "secret"
 ZED_ENVIRONMENT = "development"
 LIVEKIT_SERVER = "http://localhost:7880"
 LIVEKIT_KEY = "devkey"

crates/collab/k8s/collab.template.yml 🔗

@@ -87,11 +87,6 @@ spec:
                   key: url
             - name: DATABASE_MAX_CONNECTIONS
               value: "${DATABASE_MAX_CONNECTIONS}"
-            - name: API_TOKEN
-              valueFrom:
-                secretKeyRef:
-                  name: api
-                  key: token
             - name: ZED_CLIENT_CHECKSUM_SEED
               valueFrom:
                 secretKeyRef:

crates/collab/src/auth.rs 🔗

@@ -11,8 +11,7 @@ use std::sync::Arc;
 
 /// Validates the authorization header and adds an Extension<Principal> to the request.
 /// Authorization: <user-id> <token>
-///   <token> can be an access_token attached to that user, or an access token of an admin
-///   or (in development) the string ADMIN:<config.api_token>.
+///   <token> is the access_token attached to that user.
 /// Authorization: "dev-server-token" <token>
 pub async fn validate_header<B>(mut req: Request<B>, next: Next<B>) -> impl IntoResponse {
     let mut auth_header = req

crates/collab/src/lib.rs 🔗

@@ -124,7 +124,6 @@ pub struct Config {
     pub database_url: String,
     pub seed_path: Option<PathBuf>,
     pub database_max_connections: u32,
-    pub api_token: String,
     pub livekit_server: Option<String>,
     pub livekit_key: Option<String>,
     pub livekit_secret: Option<String>,
@@ -171,7 +170,6 @@ impl Config {
             http_port: 0,
             database_url: "".into(),
             database_max_connections: 0,
-            api_token: "".into(),
             livekit_server: None,
             livekit_key: None,
             livekit_secret: None,