-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest-implementation.sh
More file actions
executable file
·41 lines (34 loc) · 1.74 KB
/
test-implementation.sh
File metadata and controls
executable file
·41 lines (34 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
echo "=== Testing Claude Code API OAuth Token Implementation ==="
echo
# Colors for output
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Check active token in container
echo -e "${BLUE}1. Checking active Claude token in container...${NC}"
ACTIVE_TOKEN=$(docker exec claude-code-api-claude-api-1 cat /home/claude/.claude/.credentials.json 2>/dev/null | jq -r '.claudeAiOauth.accessToken' | tail -c 5)
echo -e "Active token ends with: ${GREEN}${ACTIVE_TOKEN}${NC}"
echo
echo -e "${BLUE}2. Testing visual indicators...${NC}"
echo "The following features have been implemented:"
echo -e " ${GREEN}✓${NC} OAuth tokens are automatically activated when submitted via /auth/exchange"
echo -e " ${GREEN}✓${NC} Active tokens show with green border on /admin page"
echo -e " ${GREEN}✓${NC} Active tokens show 'Active' badge in the admin table"
echo -e " ${GREEN}✓${NC} Token input field on /exchange page shows green when matching active token"
echo
echo -e "${BLUE}3. Implementation details:${NC}"
echo " - New service: src/services/claudeAuth.ts"
echo " - Reads/writes Claude config files (~/.claude/.credentials.json, ~/.claude.json)"
echo " - Auto-activates tokens on API key creation"
echo " - Visual indicators update dynamically based on last 4 digits"
echo
echo -e "${BLUE}4. To test manually:${NC}"
echo -e " 1. Visit ${GREEN}https://localhost:8843/auth${NC}"
echo -e " 2. Login with password: ${ORANGE}sk-1234${NC}"
echo -e " 3. Submit a token ending in '${GREEN}${ACTIVE_TOKEN}${NC}' to see green indicator"
echo -e " 4. Submit a different token to see it activate automatically"
echo -e " 5. Check ${GREEN}https://localhost:8843/admin${NC} to see active token indicators"
echo
echo "=== Test complete ==="