JSON:API Permission Access provides an additional permission on JSON:API based routes. Without this permission, users (other than administrators) will be unable to retrieve data from these endpoints. This can be useful when pairing with Consumers and Simple OAuth as you need to attach scope(s) to specific role(s), which can have very specific permissions...like this one 🙂
When you enable JSON:API there is no straightforward way to provide access controls on various routes. This can potentially lead to exposing some data that you do not want to expose, i.e. /jsonapi/user/user.
From the JSON:API module security considerations documentation, we can see that:
- Entity Access is respected.
- Field Access is respected.
- When modifying data, validation constraints are respected.
- The internal flag is respected (see documentation about how it can be set on an entity type definition, field definition or property definition).
Adjusting the permissions on entities/fields for specific roles can be cumbersome so this aims to provide a simple layer on top of all that for easy control.
Similar projects
Drupal REST & JSON API Authentication: This module provides Basic authentication (based on Drupal users) out of the box as well as API Key authentication, but places more advanced features such as OAuth behind a paywall. With JSON:API Permission Access + Simple Oauth + Consumers this can be accomplished at no cost.
Jsonapi Role Access: This module does a very similar implementation except it introduces added complexity with separate configuration when this can be achieved through the standard permission handling methods.
Comments
Comment #2
vishal.kadamComment #3
vishal.kadamComment #4
avpadernoThank you for applying!
Before giving links helpful to understand how the review process works, what to expect from a review, and what to do to avoid a review takes more time than needed, I would like to thank all the reviewers for the work they do.
These applications are volunters-driven, which also means it is not possible to predict when an application will be marked fixed and the applicant will get the permission to opt projects into security advisory policy. While we aim to make an application as quick as possible, it is also important for us that more people review the project used for an application. In this way, we make sure applications do not miss some important points that should be instead reported.
Applications are not meant to be complete debugging sessions that eliminate every existing bug, though. I apologize if sometimes applications seem to go into too-detailed reviews.
Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.
The important notes are the following.
Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
To the reviewers
Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.
The important notes are the following.
For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.
Comment #5
vishal.kadam1. FILE: README.md
The README file is missing the required sections - Project introduction, Requirements and Configuration.
2. FILE: jsonapi_permission_access.info.yml
core_version_requirement: ^9 || ^10 || ^11A new project should not declare itself compatible with a Drupal release that is no longer supported. No site should be using Drupal 8 nor Drupal 9, and people should not be encouraged to use those Drupal releases.
Comment #6
cmlaraThe last stable release was April 2024, this absolutely is not a new project @vishal.kadam.
I’m aware of no accepted community standard that prohibits retaining backwards compatibility, especially in light of the fact Core released a security patch yesterday for Druapl 8.9.
Comment #7
avpadernoThat is an exceptional case, and it does not change the fact we do not review projects that are compatible with unsupported Drupal releases, which includes also Drupal 8.x. Otherwise, we would still review projects for Drupal 6.x or Drupal 7.x.
It is not a new project, but what reported in that comment still holds true.
Except in rarely cases, and very simple projects, it is probable that a project cannot be compatible with Drupal 8.x and Drupal 11.x.
Comment #8
avpadernoThat comment could be rephrased to the following one, but its meaning would not change.
Comment #9
dan612 commentedI believe this may be the case here. All that is needed for this module to function is alterRoutes(), the permission system, and JSON:API - all of which were present in core for D9+ and the requirement is:
core_version_requirement: ^9 || ^10 || ^11So I do not believe D8 support is implied here. However, I do not mind dropping D9 support if that is the standard.
For what it's worth I plan on doing a new release of this module but wanted to see if I could opt-in first 🙂