Skip to content

feat(auth): add REST API routes for login, refresh, and logout - #3026

Draft
saadman30 wants to merge 4 commits into
4.1.0from
fix/rest-idor-issues
Draft

saadman30 wants to merge 4 commits into
4.1.0from
fix/rest-idor-issues

Conversation

@saadman30

Copy link
Copy Markdown
Collaborator
  • Introduced new REST API routes for user authentication: /auth/login, /auth/refresh, and /auth/logout.
  • Updated permission callbacks for various existing routes to use more specific permission checks.
  • Enhanced author detail retrieval to include user metadata conditionally based on permissions.
  • Improved response handling in course and quiz endpoints to ensure proper data structure and access control.

- Introduced new REST API routes for user authentication: `/auth/login`, `/auth/refresh`, and `/auth/logout`.
- Updated permission callbacks for various existing routes to use more specific permission checks.
- Enhanced author detail retrieval to include user metadata conditionally based on permissions.
- Improved response handling in course and quiz endpoints to ensure proper data structure and access control.
- Introduced new methods for processing authenticated read, write, and delete requests, ensuring that API key permissions are validated alongside user authentication.
- Refactored the existing process_api_request method to delegate permission checks to the new methods, improving code clarity and maintainability.
- Updated documentation to reflect changes in permission handling and method responsibilities.
- Updated permission callbacks for login, refresh, and logout routes to use a default true return value, streamlining access control.
- Introduced new methods in RestAuth class to determine route types (login, refresh, logout) for better clarity and maintainability.
- Enhanced documentation to reflect the changes in permission handling and route identification.
- Changed permission checks in the RestAuth class from 'administrator' to 'manage_options' for generating and revoking API keys.
- This adjustment aligns permission handling with WordPress best practices, ensuring that only users with the appropriate capabilities can manage API keys.
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