dsoumis commented on code in PR #2: URL: https://github.com/apache/comdev/pull/2#discussion_r3139404521
########## mcp/ponymail-mcp/auth.js: ########## @@ -0,0 +1,262 @@ +/** + * auth.js — PonyMail session management + * + * PonyMail Foal handles OAuth entirely server-side — the auth code from ASF OAuth + * can only be exchanged by PonyMail's own backend (its redirect_uri is registered + * with ASF OAuth, not ours). So we can't replicate the OAuth exchange from a CLI. + * + * Instead, this module: + * 1. Opens the PonyMail login page in the user's browser + * 2. Runs a tiny local server that waits for the user to paste their cookie + * OR watches for the cookie file to appear (if using browser extension) + * 3. Caches the session cookie to ~/.ponymail-mcp/session.json + * + * The simplest reliable flow: + * - Open lists.apache.org/oauth.html in the browser + * - User logs in (ASF LDAP) + * - After login, PonyMail sets a session cookie in the browser + * - User copies the cookie value from DevTools (or we provide a bookmarklet) + * - We cache it and use it for API requests + * + * Alternatively, set PONYMAIL_SESSION_COOKIE env var directly. + */ + +import http from "node:http"; +import crypto from "node:crypto"; Review Comment: Unused import. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
