auth0 / ruby-auth0

Ruby toolkit for Auth0 API
https://auth0.com/
MIT License
201 stars 136 forks source link

Add Management API calls for session API endpoints #613

Open l15n opened 1 month ago

l15n commented 1 month ago

Changes

Add support for the Session resource endpoints in the Management API.

References

These endpoints are described in:

Description Request Grants Documentation
Introspect a specific session by ID GET /api/v2/sessions/{sessionId} read:sessions Get session
Delete a specific session by ID DELETE /api/v2/sessions/{sessionId} delete:sessions Delete Session
Revokes a session by ID and all associated refresh tokens. POST /api/v2/sessions/{id}/revoke delete:sessions, delete:refresh_tokens Revokes a session

The user session endpoints were previously added in #588

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

Checklist

l15n commented 1 month ago

Rubocop passes on all added/modified files

To clarify, Metrics/BlockLength is triggered on spec/lib/auth0/api/v2/sessions_spec.rb because the describe block is longer than 25 lines. This rule is unrealistic for rspec, and (almost?) all other spec files trigger the offense as well.