Commit Graph

6 Commits

Author SHA1 Message Date
Misaka_Company
acc4664409 refactor: remove close_session() function
- Remove close_session() wrapper function entirely
- Callers now directly manage browser/context lifecycle
- Reduces module to pure authentication functions only

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:45:04 +08:00
Misaka_Company
38aa122f9b fix: improve parameter validation to reject whitespace-only strings
- Add .strip() check to username, password, url validation
- Update error messages to clarify whitespace rejection
- Prevents bugs where whitespace-only strings pass validation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:44:17 +08:00
Misaka_Company
eb9ed0b606 refactor: remove environment variable reading from login()
- Remove all os.getenv() calls from login() function
- Remove URL construction logic (caller provides complete URL)
- Add parameter validation with clear error messages
- Function is now pure with no side effects

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:25:46 +08:00
Misaka_Company
9fe6cfe8e1 refactor: update login() signature to require all parameters
- Remove default values for username, password, url, headless, ignore_https_errors
- Update docstring to reflect required parameters
- Maintain backward compatibility with 4-tuple return value

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:24:57 +08:00
Misaka_Company
0af2c85abe refactor: remove environment variable imports from auth module
- Remove os, dotenv, and pathlib imports
- Remove module-level environment setup code
- Prepare for pure function implementation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:24:04 +08:00
Misaka_Company
90e38821a5 Add Yonyou BIP automation framework with authentication
Features:
- Add auth module (utils/auth.py) for Yonyou BIP login/logout
- Add environment configuration support with python-dotenv
- Add Playwright browser automation with customizable path
- Add comprehensive test suite (tests/) with login/logout tests
- Add dependency management (requirements.txt)
- Add environment variable template (.env.example)

Key capabilities:
- Login with username/password from environment variables
- Auto-handle force login popup
- Logout with confirmation dialog handling
- Configurable headless mode and HTTPS error handling
- Auto-close browser option

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 11:11:15 +08:00