mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-07-31 03:05:21 +00:00
Scrub tracked API key material
This commit is contained in:
parent
a99e839bab
commit
d440fa3f47
8 changed files with 37 additions and 34 deletions
|
|
@ -131,7 +131,7 @@ cd rust
|
|||
|
||||
```bash
|
||||
export ANTHROPIC_BASE_URL="http://127.0.0.1:8080"
|
||||
export ANTHROPIC_AUTH_TOKEN="local-dev-token"
|
||||
export ANTHROPIC_AUTH_TOKEN="YOUR_ANTHROPIC_AUTH_TOKEN"
|
||||
|
||||
cd rust
|
||||
./target/debug/claw --model "claude-sonnet-4-6" prompt "reply with the word ready"
|
||||
|
|
@ -141,7 +141,7 @@ cd rust
|
|||
|
||||
```bash
|
||||
export OPENAI_BASE_URL="http://127.0.0.1:8000/v1"
|
||||
export OPENAI_API_KEY="local-dev-token"
|
||||
export OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
|
||||
|
||||
cd rust
|
||||
./target/debug/claw --model "qwen2.5-coder" prompt "reply with the word ready"
|
||||
|
|
@ -161,7 +161,7 @@ cd rust
|
|||
|
||||
```bash
|
||||
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
|
||||
export OPENAI_API_KEY="sk-or-v1-..."
|
||||
export OPENAI_API_KEY="YOUR_OPENROUTER_API_KEY"
|
||||
|
||||
cd rust
|
||||
./target/debug/claw --model "openai/gpt-4.1-mini" prompt "summarize this repository in one sentence"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
sk-kimi-DtgIkChtw8kvJztv2vnNGtKhkntDb1OUTLQv5TvnsEM5PM7Gf0ULJRmF0zjROBdx
|
||||
# API Information
|
||||
|
||||
API ID Name Create time Key Status Action
|
||||
19d7e43e-c192-838e-8000-0000922956d4 Research Stack 04/11/2026, 03:37:53 PM sk-ki...ROBdx Enabled
|
||||
Do not store provider API keys, API inventory exports, or credential table dumps in this file.
|
||||
|
||||
Use environment variables or a local ignored secret store instead.
|
||||
|
|
|
|||
|
|
@ -1158,7 +1158,7 @@ mod tests {
|
|||
#[test]
|
||||
fn oauth_token_maps_to_bearer_auth_source() {
|
||||
let auth = AuthSource::from(OAuthTokenSet {
|
||||
access_token: "access-token".to_string(),
|
||||
access_token: "dummy-access-token".to_string(),
|
||||
refresh_token: Some("refresh".to_string()),
|
||||
expires_at: Some(123),
|
||||
scopes: vec!["scope:a".to_string()],
|
||||
|
|
@ -1187,7 +1187,7 @@ mod tests {
|
|||
std::env::remove_var("ANTHROPIC_AUTH_TOKEN");
|
||||
std::env::remove_var("ANTHROPIC_API_KEY");
|
||||
save_oauth_credentials(&runtime::OAuthTokenSet {
|
||||
access_token: "saved-access-token".to_string(),
|
||||
access_token: "dummy-access-token".to_string(),
|
||||
refresh_token: Some("refresh".to_string()),
|
||||
expires_at: Some(now_unix_timestamp() + 300),
|
||||
scopes: vec!["scope:a".to_string()],
|
||||
|
|
@ -1205,13 +1205,13 @@ mod tests {
|
|||
#[test]
|
||||
fn oauth_token_expiry_uses_expires_at_timestamp() {
|
||||
assert!(oauth_token_is_expired(&OAuthTokenSet {
|
||||
access_token: "access-token".to_string(),
|
||||
access_token: "dummy-access-token".to_string(),
|
||||
refresh_token: None,
|
||||
expires_at: Some(1),
|
||||
scopes: Vec::new(),
|
||||
}));
|
||||
assert!(!oauth_token_is_expired(&OAuthTokenSet {
|
||||
access_token: "access-token".to_string(),
|
||||
access_token: "dummy-access-token".to_string(),
|
||||
refresh_token: None,
|
||||
expires_at: Some(now_unix_timestamp() + 60),
|
||||
scopes: Vec::new(),
|
||||
|
|
@ -1226,7 +1226,7 @@ mod tests {
|
|||
std::env::remove_var("ANTHROPIC_AUTH_TOKEN");
|
||||
std::env::remove_var("ANTHROPIC_API_KEY");
|
||||
save_oauth_credentials(&runtime::OAuthTokenSet {
|
||||
access_token: "expired-access-token".to_string(),
|
||||
access_token: "dummy-access-token".to_string(),
|
||||
refresh_token: Some("refresh-token".to_string()),
|
||||
expires_at: Some(1),
|
||||
scopes: vec!["scope:a".to_string()],
|
||||
|
|
@ -1258,7 +1258,7 @@ mod tests {
|
|||
std::env::remove_var("ANTHROPIC_AUTH_TOKEN");
|
||||
std::env::remove_var("ANTHROPIC_API_KEY");
|
||||
save_oauth_credentials(&runtime::OAuthTokenSet {
|
||||
access_token: "saved-access-token".to_string(),
|
||||
access_token: "dummy-access-token".to_string(),
|
||||
refresh_token: Some("refresh".to_string()),
|
||||
expires_at: Some(now_unix_timestamp() + 300),
|
||||
scopes: vec!["scope:a".to_string()],
|
||||
|
|
@ -1282,7 +1282,7 @@ mod tests {
|
|||
std::env::remove_var("ANTHROPIC_AUTH_TOKEN");
|
||||
std::env::remove_var("ANTHROPIC_API_KEY");
|
||||
save_oauth_credentials(&runtime::OAuthTokenSet {
|
||||
access_token: "expired-access-token".to_string(),
|
||||
access_token: "dummy-access-token".to_string(),
|
||||
refresh_token: Some("refresh-token".to_string()),
|
||||
expires_at: Some(1),
|
||||
scopes: vec!["scope:a".to_string()],
|
||||
|
|
@ -1314,7 +1314,7 @@ mod tests {
|
|||
std::env::remove_var("ANTHROPIC_AUTH_TOKEN");
|
||||
std::env::remove_var("ANTHROPIC_API_KEY");
|
||||
save_oauth_credentials(&runtime::OAuthTokenSet {
|
||||
access_token: "expired-access-token".to_string(),
|
||||
access_token: "dummy-access-token".to_string(),
|
||||
refresh_token: Some("refresh-token".to_string()),
|
||||
expires_at: Some(1),
|
||||
scopes: vec!["scope:a".to_string()],
|
||||
|
|
@ -1475,8 +1475,8 @@ mod tests {
|
|||
#[test]
|
||||
fn auth_source_applies_headers() {
|
||||
let auth = AuthSource::ApiKeyAndBearer {
|
||||
api_key: "test-key".to_string(),
|
||||
bearer_token: "proxy-token".to_string(),
|
||||
api_key: "dummy-api-key".to_string(),
|
||||
bearer_token: "dummy-bearer-token".to_string(),
|
||||
};
|
||||
let request = auth
|
||||
.apply(reqwest::Client::new().post("https://example.test"))
|
||||
|
|
@ -1705,8 +1705,8 @@ mod tests {
|
|||
fn enrich_bearer_auth_error_skips_hint_when_api_key_header_is_also_present() {
|
||||
// given
|
||||
let auth = AuthSource::ApiKeyAndBearer {
|
||||
api_key: "sk-ant-api03-legitimate".to_string(),
|
||||
bearer_token: "sk-ant-api03-deadbeef".to_string(),
|
||||
api_key: "dummy-api-key".to_string(),
|
||||
bearer_token: "dummy-bearer-token".to_string(),
|
||||
};
|
||||
let error = crate::error::ApiError::Api {
|
||||
status: reqwest::StatusCode::UNAUTHORIZED,
|
||||
|
|
@ -1731,7 +1731,7 @@ mod tests {
|
|||
#[test]
|
||||
fn enrich_bearer_auth_error_ignores_401_when_auth_source_has_no_bearer() {
|
||||
// given
|
||||
let auth = AuthSource::ApiKey("sk-ant-api03-legitimate".to_string());
|
||||
let auth = AuthSource::ApiKey("dummy-api-key".to_string());
|
||||
let error = crate::error::ApiError::Api {
|
||||
status: reqwest::StatusCode::UNAUTHORIZED,
|
||||
error_type: Some("authentication_error".to_string()),
|
||||
|
|
|
|||
|
|
@ -688,7 +688,7 @@ mod tests {
|
|||
|
||||
ANTHROPIC_API_KEY=plain-value
|
||||
XAI_API_KEY=\"quoted-value\"
|
||||
OPENAI_API_KEY='single-quoted'
|
||||
OPENAI_API_KEY='quoted-openai-value'
|
||||
export GROK_API_KEY=exported-value
|
||||
PADDED_KEY = padded-value
|
||||
EMPTY_VALUE=
|
||||
|
|
@ -709,7 +709,7 @@ NO_EQUALS_LINE
|
|||
);
|
||||
assert_eq!(
|
||||
values.get("OPENAI_API_KEY").map(String::as_str),
|
||||
Some("single-quoted")
|
||||
Some("quoted-openai-value")
|
||||
);
|
||||
assert_eq!(
|
||||
values.get("GROK_API_KEY").map(String::as_str),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ from infra.deepseek_adapter import DeepSeekV4
|
|||
|
||||
def solve_famm_sorry():
|
||||
# Use DeepSeek API for better reliability
|
||||
api_key = "***REMOVED***"
|
||||
api_key = os.environ.get("DEEPSEEK_API_KEY", "")
|
||||
if not api_key:
|
||||
raise RuntimeError("DEEPSEEK_API_KEY is required")
|
||||
client = DeepSeekV4(api_key=api_key, use_local=False)
|
||||
model = "deepseek-v4-pro"
|
||||
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@ Forbidden exposure:
|
|||
## Environment
|
||||
|
||||
```bash
|
||||
export TOPOLOGICAL_ENGINE_TOKEN="long-random-private-token-at-least-32-chars"
|
||||
export TOPOLOGICAL_ENGINE_TOKEN="YOUR_TOPOLOGICAL_ENGINE_TOKEN"
|
||||
export OBSIDIAN_VAULT_PATH="/absolute/path/to/private/obsidian-vault"
|
||||
export NEO4J_URI="bolt://127.0.0.1:7687"
|
||||
export NEO4J_USER="neo4j"
|
||||
export NEO4J_PASSWORD="use-a-local-secret-manager"
|
||||
export NEO4J_PASSWORD="YOUR_NEO4J_PASSWORD"
|
||||
```
|
||||
|
||||
Never store secrets in GitHub, Notion, Google Drive, or Obsidian notes.
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ Forbidden exposure:
|
|||
## Environment
|
||||
|
||||
```bash
|
||||
export WOLFRAM_CONNECTOR_TOKEN="long-random-private-token-at-least-32-chars"
|
||||
export WOLFRAM_CONNECTOR_TOKEN="YOUR_WOLFRAM_CONNECTOR_TOKEN"
|
||||
export WOLFRAM_APP_ID="your-private-wolfram-alpha-app-id"
|
||||
export WOLFRAM_MAX_QUERY_CHARS=1600
|
||||
export WOLFRAM_TIMEOUT_MS=15000
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@ Forbidden exposure:
|
|||
## Environment
|
||||
|
||||
```bash
|
||||
export TOPOLOGICAL_ENGINE_TOKEN="long-random-private-token-at-least-32-chars"
|
||||
export TOPOLOGICAL_ENGINE_TOKEN="YOUR_TOPOLOGICAL_ENGINE_TOKEN"
|
||||
export OBSIDIAN_VAULT_PATH="/absolute/path/to/private/obsidian-vault"
|
||||
export NEO4J_URI="bolt://127.0.0.1:7687"
|
||||
export NEO4J_USER="neo4j"
|
||||
export NEO4J_PASSWORD="use-a-local-secret-manager"
|
||||
export NEO4J_PASSWORD="YOUR_NEO4J_PASSWORD"
|
||||
```
|
||||
|
||||
Never store secrets in GitHub, Notion, Google Drive, or Obsidian notes.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue