Compare commits

..

1 Commits

Author SHA1 Message Date
root
4658ee283e docs: add cookies example to KworkClient.__init__ 2026-03-29 08:30:02 +00:00
2 changed files with 29 additions and 10 deletions

View File

@ -8,6 +8,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
@ -88,15 +92,24 @@ jobs:
env:
UV_NO_PROGRESS: "1"
run: |
uv pip compile pyproject.toml --no-dev -o requirements-prod.txt && uv run pip-audit --format json --output audit-results.json -r requirements-prod.txt && test ! -s audit-results.json || test "$(cat audit-results.json)" = "[]"
- name: Upload audit log
uses: actions/upload-artifact@v3
if: failure()
with:
name: security-audit
path: audit-results.json
retention-days: 7
echo "Running pip-audit on production dependencies..."
# Audit only production dependencies (exclude dev)
uv pip compile pyproject.toml --no-dev -o requirements-prod.txt
uv run pip-audit --format json --output audit-results.json -r requirements-prod.txt || true
# Parse and display results
if [ -s audit-results.json ] && [ "$(cat audit-results.json)" != "[]" ]; then
echo "❌ Found vulnerabilities in production dependencies:"
uv run python -c "
import json
data = json.load(open('audit-results.json'))
for vuln in data:
print(f\" - {vuln.get('name', 'unknown')} {vuln.get('version', '')}: {vuln.get('id', '')}\")
"
exit 1
else
echo "✅ No vulnerabilities in production dependencies"
fi
- name: Check for secrets
run: |

View File

@ -114,9 +114,15 @@ class KworkClient:
# Новый клиент без аутентификации
client = KworkClient()
# Восстановление сессии
# Восстановление сессии по токену
client = KworkClient(token="eyJ0eXAiOiJKV1QiLCJhbGc...")
# Восстановление с полным набором cookies
client = KworkClient(
token="eyJ0eXAiOiJKV1QiLCJhbGc...",
cookies={"userId": "12345", "slrememberme": "abc"}
)
# Клиент с кастомным таймаутом
client = KworkClient(timeout=60.0)