|
Download sys/sys-0039.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 2.01 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/1c6bb525d6b4b9cdb15d2a75d54734eb29bbb8cb/sys/sys-0039.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm@1c6bb525d6b4b9cdb15d2a75d54734eb29bbb8cb/sys/sys-0039.jsonl
-
curl -L -o sys-0039.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/1c6bb525d6b4b9cdb15d2a75d54734eb29bbb8cb/sys/sys-0039.jsonl
2.01 kB
| {"type": "session", "harness": "deepseek-harness", "id": "sys-0039", "name": "OAuth2 and JWT authentication"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies."}} | |
| {"type": "message", "message": {"role": "user", "content": "How do I implement OAuth2 and JWT?"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "```javascript\n// JWT generation\nconst jwt = require('jsonwebtoken');\n\nconst token = jwt.sign(\n { userId: 123, role: 'admin' },\n process.env.JWT_SECRET,\n { expiresIn: '1h', issuer: 'myapp' }\n);\n\n// JWT verification\nconst decoded = jwt.verify(token, process.env.JWT_SECRET);\n\n// Refresh token pattern\nconst accessToken = jwt.sign({ userId: 123 }, secret, { expiresIn: '15m' });\nconst refreshToken = jwt.sign({ userId: 123 }, refreshSecret, { expiresIn: '7d' });\n\n// OAuth2 Authorization Code flow\n// 1. Redirect to /authorize\nconst authUrl = `https://auth.example.com/authorize?\n response_type=code&\n client_id=${CLIENT_ID}&\n redirect_uri=${REDIRECT_URI}&\n scope=openid profile email&\n state=${randomState}`;\n\n// 2. Exchange code for token\nconst tokenResponse = await fetch('https://auth.example.com/token', {\n method: 'POST',\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n body: new URLSearchParams({\n grant_type: 'authorization_code',\n code: authorizationCode,\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET,\n redirect_uri: REDIRECT_URI\n })\n});\n\n// 3. Use access token\nconst userResponse = await fetch('https://api.example.com/user', {\n headers: { 'Authorization': `Bearer ${accessToken}` }\n});\n```"}} | |