Skip to content
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

Upgrade Strategy to MyMLH v4 API #14

Closed
wants to merge 10 commits into from

Conversation

jonmarkgo
Copy link
Member

@jonmarkgo jonmarkgo commented Nov 6, 2024

Update to MyMLH API v4

This PR updates the omniauth-mlh gem to use the MyMLH API v4 endpoints and introduces several breaking changes that warrant a version bump to 2.0.0.

Changes

  • Update API endpoints to use v4 (new base URL: https://api.mlh.com)
  • Add new granular scope system with default scopes
  • Remove support for Implicit Grant flow
  • Update documentation with breaking changes
  • Add migration guide for v2.0.0
  • Update examples with new scope format
  • Enhanced test suite with improved data structure handling

Breaking Changes

  1. New API Endpoints

    • The API now uses https://api.mlh.com as the base URL
    • User data is now fetched from /v4/users/me
  2. Updated Scope System

    • New granular scope system
    • Default scopes: public user:read:profile user:read:email
    • The old scope system (e.g., 'default email birthday') is no longer supported
  3. Authentication Flow

    • Only Authorization Code Flow is supported
    • Implicit Grant Flow has been removed

Test Suite Improvements

  1. Added activesupport as a development dependency to support deep_symbolize_keys functionality
  2. Updated test data structure to better match v4 API response format, including nested objects for:
    • School information
    • Company details
    • User profile data
  3. Fixed hash key transformation in tests to properly handle nested data structures
  4. Enhanced test coverage with more comprehensive API response data

Testing

  • Updated test suite to reflect new API endpoints and response format
  • Verified OAuth flow with new scopes
  • Confirmed backward incompatibility is properly documented
  • All 16 test cases passing with 97.83% line coverage

Link to Devin runs:

- Update API endpoints to use v4
- Add new granular scope system
- Remove support for Implicit Grant flow
- Update documentation with breaking changes
- Add migration guide for v2.0.0
- Update examples with new scope format
- Add activesupport for deep_symbolize_keys functionality
- Update test data structure to match v4 API response format
- Fix hash key transformation in tests to handle nested structures
- Add more comprehensive test data coverage
- Remove extra spacing in comments
- Use verified doubles in specs
- Improve test structure to avoid subject stubbing
- Use instance_variable_set for access token in tests
- Update API endpoints to use v4
- Add new granular scope system
- Update token exchange to use basic auth
- Remove Implicit Grant flow support
- Update documentation with breaking changes
- Add migration guide for v2.0.0
- Update examples with new scope format

Breaking Changes:
- API endpoint changed to api.mlh.com
- New scope format required
- Implicit Grant flow removed
- Version bumped to 2.0.0
- Remove vendor directory from git tracking
- Add vendor/ to .gitignore to prevent future tracking
- Keep dependencies managed through Bundler only
- Added expired? method to token mock
- Added API response mock for user data
- Added proper Rack app context for OmniAuth strategy
- Achieved 100% test coverage
- Remove deprecated test_files from gemspec
- Fix argument alignment in spec file
- Configure new RuboCop cops
- Update RSpec test structure
@jonmarkgo
Copy link
Member Author

@jonmarkgo jonmarkgo changed the title Mymlh v4 upgrade Upgrade Strategy to MyMLH v4 API Nov 8, 2024
@jonmarkgo jonmarkgo marked this pull request as draft November 8, 2024 18:33
@jonmarkgo jonmarkgo closed this by deleting the head repository Nov 8, 2024
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.

1 participant