-
Notifications
You must be signed in to change notification settings - Fork 52
feat(cookie): implement LinkedIn cookie extraction and usage #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add functionality to extract LinkedIn session cookies for Docker setup. Introduce a new command-line flag `--get-cookie` to facilitate cookie retrieval. Update configuration to support cookie management via environment variables and keyring. Enhance login process to prioritize cookie authentication, falling back to credentials if necessary. Update manifest and schema to reflect changes in cookie handling.
Introduce a structured approach to LinkedIn authentication with clear phase separation: Authentication Setup, Driver Management, and Server Runtime. Enhance error handling and logging during the authentication process. Update driver initialization to utilize session cookies effectively, improving overall user experience and reliability. Refactor existing code to streamline driver management and ensure proper cleanup of resources. Update error messages for clarity and consistency.
Claude finished @stickerdaniel's task —— View job Code Review Analysis ✅Reviewing PR #21: feat(cookie): implement LinkedIn cookie extraction and usage Review Checklist:
🔍 Code Quality AnalysisStrengths:
Code Organization:
🔒 Security AssessmentGood Security Practices:
Security Concerns & Recommendations:
🐛 Potential Issues & Bugs
🚀 Performance ConsiderationsGood Performance Practices:
Performance Improvements:
📋 Test Coverage AssessmentMissing Test Coverage:
Critical Testing Needs:
Recommendation: Add comprehensive test suite covering: # Example test structure needed
def test_cookie_validation():
# Test valid/invalid cookie formats
def test_keyring_integration():
# Test storage/retrieval from keyring
def test_authentication_flow():
# Test end-to-end authentication scenarios 🔧 Code Improvements
📚 Documentation & User ExperienceStrengths:
Areas for Improvement:
🎯 Final RecommendationsHigh Priority:
Medium Priority:
Low Priority:
✅ Overall AssessmentThis is a well-architected and thoughtfully implemented feature that significantly improves the authentication experience. The code demonstrates good security practices and clean architecture principles. The main areas for improvement are test coverage and some edge case handling. Recommendation: Approve with suggestions - This is high-quality code that adds significant value, but would benefit from the test coverage and minor fixes mentioned above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR overhauls authentication to use LinkedIn session cookies, adding extraction, storage, and CLI support while deprecating direct email/password usage.
- Introduce
--get-cookie
flag and related modes for cookie extraction - Update configuration schema, loaders, and keyring providers to manage a
linkedin_cookie
- Restructure
main.py
, driver logic, and error handling to prioritize cookie authentication
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
manifest.json | Swap out LINKEDIN_EMAIL /PASSWORD for LINKEDIN_COOKIE in Docker run |
main.py | Add cookie-extraction mode, phased auth/driver setup, and new CLI flags |
linkedin_mcp_server/setup.py | Implement interactive and non-interactive cookie/credential capture flows |
linkedin_mcp_server/logging_config.py | Change default log level to WARNING and tighten specific logger levels |
linkedin_mcp_server/error_handler.py | Rename credentials_not_found error to authentication_not_found |
linkedin_mcp_server/drivers/chrome.py | Refactor driver creation, separate cookie vs. credential login |
linkedin_mcp_server/config/secrets.py | Add cookie keyring support and prompt flows |
linkedin_mcp_server/config/schema.py | Extend LinkedInConfig and ServerConfig with cookie fields/flags |
linkedin_mcp_server/config/providers.py | Add get_/save_/clear_cookie_from_keyring providers |
linkedin_mcp_server/config/loaders.py | Load LINKEDIN_COOKIE and --get-cookie /--cookie CLI args |
linkedin_mcp_server/config/init.py | Reorder imports to expose new cookie APIs |
linkedin_mcp_server/authentication.py | New pure auth module for cookie validation and storage |
README.md | Expand Docker and local setup docs with cookie extraction instructions |
.vscode/tasks.json | Add VS Code task for bundling the DXT package |
Comments suppressed due to low confidence (6)
linkedin_mcp_server/error_handler.py:71
- Changing the error code from
credentials_not_found
toauthentication_not_found
may break existing clients. Consider documenting this breaking change or versioning the API.
"error": "authentication_not_found",
README.md:70
- [nitpick] The "Getting the LinkedIn Cookie" section is duplicated across Docker and Claude Desktop docs. Consider consolidating into one section to reduce redundancy.
<summary><b>🐳 Docker get-cookie method</b></summary>
README.md:264
- The code block fence should be
json
instead of**json**
to enable proper syntax highlighting.
```**json**
main.py:237
- The
try:
block under theInvalidCredentialsError
handler appears mis-indented, causing a syntax error. Please adjust indentation so thetry/except
is properly nested within theif
block.
try:
linkedin_mcp_server/config/secrets.py:97
- The file uses
inquirer.confirm
andinquirer.text
but does not importinquirer
. Please addimport inquirer
at the top of this module.
has_cookie = inquirer.confirm("Do you have a LinkedIn cookie?", default=False)
linkedin_mcp_server/logging_config.py:88
- [nitpick] Switching the default log level to WARNING will suppress INFO messages in production; confirm that you won’t lose visibility into important events.
log_level = logging.DEBUG if debug else logging.WARNING
Claude encountered an error —— View job I'll analyze this and get back to you. |
Add functionality to extract LinkedIn session cookies for Docker setup. Introduce a new command-line flag
--get-cookie
to facilitate cookie retrieval. Update configuration to support cookie management via environment variables and keyring. Enhance login process to prioritize cookie authentication, falling back to credentials if necessary. Update manifest and schema to reflect changes in cookie handling.