René's URL Explorer Experiment


Title: Local auth short-circuit makes sign-in, sign-out and multi-user paths untestable · Issue #208 · vpython/glowscript · GitHub

Open Graph Title: Local auth short-circuit makes sign-in, sign-out and multi-user paths untestable · Issue #208 · vpython/glowscript

X Title: Local auth short-circuit makes sign-in, sign-out and multi-user paths untestable · Issue #208 · vpython/glowscript

Description: Summary Local runs cannot exercise authentication at all, and that removes a large slice of the app from testing. ide/auth.py short-circuits identity whenever the server runs locally: def is_logged_in(): return ('user' in session) or (ro...

Open Graph Description: Summary Local runs cannot exercise authentication at all, and that removes a large slice of the app from testing. ide/auth.py short-circuits identity whenever the server runs locally: def is_logged...

X Description: Summary Local runs cannot exercise authentication at all, and that removes a large slice of the app from testing. ide/auth.py short-circuits identity whenever the server runs locally: def is_logged...

Opengraph URL: https://github.com/vpython/glowscript/issues/208

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Local auth short-circuit makes sign-in, sign-out and multi-user paths untestable","articleBody":"## Summary\n\nLocal runs cannot exercise authentication at all, and that removes a large slice of the app from testing. `ide/auth.py` short-circuits identity whenever the server runs locally:\n\n```python\ndef is_logged_in():\n    return ('user' in session) or (routes.is_running_locally())\n\ndef get_user_info():\n    if routes.is_running_locally():\n        return {'email': 'localuser@local.host'}\n    return session.get('user') or {}\n```\n\nRunning locally you are **always** signed in as `localuser@local.host`. You cannot be anonymous, and you cannot be a *second* user.\n\n## What that costs, concretely\n\n* **Anonymous state does not exist locally.** The sign-in link, the `not_logged_in` API state, and any \"must be signed in\" guard cannot be tested. Three e2e tests had to be skipped for precisely this (#207) — they now skip locally and only run against a deployed server.\n* **Only one identity exists.** Anything involving two users — sharing a program, another user's folder, permission boundaries — is untestable locally.\n* **Local diverges from production at the auth layer**, which is the layer where divergence is most expensive to discover late.\n\nThe three skipped tests are just the visible symptom; the untested surface is much larger.\n\n## The fix is configuration, not a special case\n\nAuth is **raw Google OIDC through Authlib**, driven by discovery:\n\n```python\nCONF_URL = 'https://accounts.google.com/.well-known/openid-configuration'\noauth.register(..., server_metadata_url=CONF_URL, client_kwargs={'scope': 'openid email profile'})\n```\n\nBecause it is standard OIDC discovery, a local **mock OIDC provider** (mock-oauth2-server, Dex, oauth2-mock-server — all run happily in Docker beside the datastore emulator) can serve that role. Point `CONF_URL` plus client id/secret at it for local runs and the *real* OAuth code path executes locally, with real sessions, sign-out, and as many identities as the tests need.\n\nAt that point the special case can simply be **deleted**: `is_logged_in()` and `get_user_info()` become session-only, with no environment branch at all.\n\n⚠️ Worth stating because it is an easy wrong turn: the **Firebase Auth emulator is not the right tool here.** It emulates Firebase Auth, not generic OIDC. `CONF_URL` is currently a module constant, so the first concrete step is making it (and the client id/secret) configurable.\n\n## The same hack is in webvpython\n\n`webvpython/flaskHost/src/auth.py` carries it at three sites:\n\n| line | what |\n|---|---|\n| 70 | `is_logged_in()` returns true whenever local |\n| 73-74 | `get_user_info()` returns `localuser@local.host` |\n| 88 | `login()` sets `session['user'] = {'email':'local@user'}` and redirects |\n\nLine 88 is notable: it is *already* the right shape — a local login that populates the session — but the other two override it unconditionally, so it never takes effect. Whatever lands here should land there.\n\n## Done when\n\n- [ ] `CONF_URL` / client id / secret configurable per environment\n- [ ] a mock OIDC provider in the local compose setup\n- [ ] the local-mode branches removed from `is_logged_in()` and `get_user_info()`\n- [ ] the three tests skipped in #207 **run and pass locally**\n- [ ] same treatment applied to `webvpython/flaskHost/src/auth.py`\n\nDesign notes on branch `feat/local-auth-emulator` (`docs/LOCAL-AUTH-DESIGN.md`).\n","author":{"url":"https://github.com/sspickle","@type":"Person","name":"sspickle"},"datePublished":"2026-08-24T00:35:02Z","url":"https://github.com/vpython/glowscript/issues/208"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:fd8d1f42-8047-5f75-5af8-1270cac52275
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB80E:20C949:6ACD2C:9199A6:6B0077C7
html-safe-noncea02e2a04600968d2db8e6ce76b431fa8aedeb005ef3d1f563c9abdea8b575e32
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODBFOjIwQzk0OTo2QUNEMkM6OTE5OUE2OjZCMDA3N0M3IiwidmlzaXRvcl9pZCI6IjI1OTk4NjA2MTA3Nzg4MjI1OTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac0c207f63fc7cb0545ac1d7e9373dfdd35bf47160c936392432de5cafc281b914
hovercard-subject-tagissue:5229937660
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/vpython/glowscript/208/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ebbfc4ae93583f2855909a63dfe8666302422255db5abbfe1a170c5bed689b24/vpython/glowscript/issues/208
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ebbfc4ae93583f2855909a63dfe8666302422255db5abbfe1a170c5bed689b24/vpython/glowscript/issues/208
og:image:altSummary Local runs cannot exercise authentication at all, and that removes a large slice of the app from testing. ide/auth.py short-circuits identity whenever the server runs locally: def is_logged...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesspickle
hostnamegithub.com
expected-hostnamegithub.com
None75c2b65dd205f26961d0c29afed1a8d0bb7cca9f05780571dfd1ef93eb539d16
turbo-cache-controlno-preview
go-importgithub.com/vpython/glowscript git https://github.com/vpython/glowscript.git
octolytics-dimension-user_id1280757
octolytics-dimension-user_loginvpython
octolytics-dimension-repository_id187905631
octolytics-dimension-repository_nwovpython/glowscript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id187905631
octolytics-dimension-repository_network_root_nwovpython/glowscript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release84e563eb4b55f8fa102f325f117533cee9e3df4a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/vpython/glowscript/issues/208#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvpython%2Fglowscript%2Fissues%2F208
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvpython%2Fglowscript%2Fissues%2F208
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=vpython%2Fglowscript
Reloadhttps://github.com/vpython/glowscript/issues/208
Reloadhttps://github.com/vpython/glowscript/issues/208
Reloadhttps://github.com/vpython/glowscript/issues/208
vpythonhttps://github.com/vpython
glowscripthttps://github.com/vpython/glowscript
Codehttps://github.com/vpython/glowscript
Issues9 (9)https://github.com/vpython/glowscript/issues
Pull requests2 (2)https://github.com/vpython/glowscript/pulls
Actionshttps://github.com/vpython/glowscript/actions
Projectshttps://github.com/vpython/glowscript/projects
Security and qualityhttps://github.com/vpython/glowscript/security
Insightshttps://github.com/vpython/glowscript/insights
https://github.com/vpython/glowscript
New issuehttps://github.com/login?return_to=https://github.com/vpython/glowscript/issues/208
New issuehttps://github.com/login?return_to=https://github.com/vpython/glowscript/issues/208
Local auth short-circuit makes sign-in, sign-out and multi-user paths untestablehttps://github.com/vpython/glowscript/issues/208#top
https://github.com/sspickle
sspicklehttps://github.com/sspickle
on Aug 24, 2026https://github.com/vpython/glowscript/issues/208#issue-5229937660
test(e2e): skip anonymous-state tests when the server runs locally #207https://github.com/vpython/glowscript/pull/207
test(e2e): skip anonymous-state tests when the server runs locally #207https://github.com/vpython/glowscript/pull/207
https://github.com/sspickle
sspicklehttps://github.com/sspickle
on Aug 24, 2026https://github.com/vpython/glowscript/issues/208#issuecomment-5389434277
Sign up for freehttps://github.com/signup?return_to=https://github.com/vpython/glowscript/issues/208
Sign in to commenthttps://github.com/login?return_to=https://github.com/vpython/glowscript/issues/208
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.