Skip to content

Conversation

@aaronjae22
Copy link
Collaborator

This PR makes a complete overview and update of the RFC8414 OAuth Authorization Server Metadata endpoint with LOLA extensions for ActivityPub account portability discovery Implementation.

Closes #228

  • Created a new file (testbed/core/tests/test_lola_compliance.py) that handles the RFC8414 compliance tests
    • Delete the tests that were on testbed/core/tests/test_api.py for better separation of concerns
  • Simplified the oauth_authorization_server_metadata view
  • Added SECURE_PROXY_SSL_HEADER for HTTPS detection in Production (Staging inherits from it)

Features that were revised/updated

  1. RFC8414-compliant metadata endpoint at /.well-known/oauth-authorization-server
  2. LOLA extension - activitypub_account_portability parameter for discovery
  3. HTTPS enforcement - Proper detection behind Google Cloud Run load balancer
  4. CORS enabled - Cross-origin federation support
  5. Comprehensive tests - 6 RFC8414 compliance tests

Production Deployment Notes

⚠️ IMPORTANT: This PR includes the fix for HTTPS URLs in production/staging.

Current behaviour: Returns http:// URLs (incorrect)

curl -sS \
  -H "Accept: application/json" \
  https://ap-testbed.dtinit.org/.well-known/oauth-authorization-server
{
   "issuer":"http://ap-testbed.dtinit.org",
   "authorization_endpoint":"http://ap-testbed.dtinit.org/oauth/authorize/",
   "token_endpoint":"http://ap-testbed.dtinit.org/oauth/token/",
   "scopes_supported":[
      "activitypub_account_portability"
   ],
   "response_types_supported":[
      "code"
   ],
   "grant_types_supported":[
      "authorization_code"
   ],
   "activitypub_account_portability":"http://ap-testbed.dtinit.org/oauth/authorize/"
}"%"

After deployment: All URLs should use https:// protocol. (correct)

The SECURE_PROXY_SSL_HEADER setting enables proper HTTPS detection behind Google Cloud Run's load balancer.

Standards Compliance

  • RFC8414 (OAuth Authorization Server Metadata)
  • RFC8615 (Well-Known URIs)
  • LOLA v0.2 (Account Portability Specification)
  • OAuth 2.0 Security Best Practices

Testing

# New LOLA compliance tests
pytest testbed/core/tests/test_lola_compliance.py -v
# Result: 6 passed 

# Existing API tests (unchanged)
pytest testbed/core/tests/test_api.py -v  
# Result: 26 passed 

Total: 32 tests passing

@aaronjae22 aaronjae22 self-assigned this Nov 19, 2025
@aaronjae22 aaronjae22 requested a review from lisad November 20, 2025 19:04
@aaronjae22 aaronjae22 merged commit eeec4e2 into main Nov 21, 2025
3 checks passed
@aaronjae22 aaronjae22 deleted the feature/overview-lola-rfc8414-discovery-endpoint branch November 21, 2025 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Overview/Update] Implement RFC8414 OAuth Authorization Server Metadata Discovery Endpoint

3 participants