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

With m10n module enabled, non monetized API products do not follow RBAC #394

Merged
merged 1 commit into from
Mar 31, 2020
Merged

With m10n module enabled, non monetized API products do not follow RBAC #394

merged 1 commit into from
Mar 31, 2020

Conversation

cnovak
Copy link
Collaborator

@cnovak cnovak commented Mar 31, 2020

The Apigee M10n module’s hook_ENTITY_TYPE_access uses the Apigee Monetization API to determine an API Product ‘assign’ access by calling /developers/{developer}/eligible-products, which returns AccessResult::allowed for all API products.

This API returns all API Products

  1. That are able to be assigned to an App because the developer purchased a Rate plan that contains the API product
  2. All API products that are not monetized.

Due to #2, the Apigee Edge module hook_ENTITY_TYPE_access needs to return AccessResult::forbidden when the operation is ‘assign’ and the user does not have the correct role to assign an API product to an app.

The Apigee M10n module’s hook_ENTITY_TYPE_access uses the Apigee Monetization API to determine an API Product ‘assign’ access by calling `/developers/{developer}/eligible-products`, which returns AccessResult::allowed for all API products.

This API returns all API Products
1. That are able to be assigned to an App because the developer purchased a Rate plan that contains the API product
2. All API products that are not monetized.

Due to #2, the Apigee Edge module hook_ENTITY_TYPE_access needs to return AccessResult::forbidden when the operation is ‘assign’ and the user does not have the correct role to assign an API product to an app.
@googlebot googlebot added the cla: yes Indicates CLA has been signed label Mar 31, 2020
@cnovak cnovak added this to the 8.x-1.8 milestone Mar 31, 2020
@cnovak cnovak changed the title Fixes #392 With m10n module enabled, non monetized API products do not follow RBAC Mar 31, 2020
@cnovak cnovak marked this pull request as ready for review March 31, 2020 17:19
@cnovak
Copy link
Collaborator Author

cnovak commented Mar 31, 2020

Validated that API Product access tests pass

Copy link
Contributor

@arlina-espinoza arlina-espinoza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and LGTM. Thanks @cnovak :)

@arlina-espinoza arlina-espinoza merged commit 5e2da7f into apigee:8.x-1.x Mar 31, 2020
@cnovak cnovak deleted the 392-apiproduct-access branch April 6, 2020 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates CLA has been signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Visibility by Access" - Visibility attribute for API product not enforced correctly
3 participants