Warn before the client secret expires (SP_SECRET_EXPIRES)

Azure client secrets lapse silently into opaque 401s (AADSTS7000222). Add a self-reported expiry date (SP_SECRET_EXPIRES=YYYY-MM-DD) and a shared secretExpiryStatus() helper in graph.mjs; surface warnings <30 days out via the CLI (stderr on every command + test output), MCP server startup log, /health, and the sharepoint_test tool. Documented in both .env.examples, setup.md, and READMEs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
ang3l12
2026-07-08 15:13:48 -06:00
parent 6704122599
commit 7d41c1ca15
8 changed files with 89 additions and 5 deletions

View File

@@ -26,6 +26,9 @@ On the app's **Overview** page, copy:
1. App → **Certificates & secrets****Client secrets****New client secret**.
2. Set an expiry (e.g. 612 months — note when it expires; you'll have to rotate).
3. Copy the secret **Value** immediately (it's only shown once) → `SP_CLIENT_SECRET`.
4. Record the expiry date in `.env` as `SP_SECRET_EXPIRES=YYYY-MM-DD` — the CLI
and MCP server use it to warn you 30 days ahead instead of failing cold with
a 401 (AADSTS7000222) when the secret lapses.
> Certificates are more secure than secrets for production. This skill uses a
> secret for simplicity; swapping to a certificate is a future enhancement.