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

[#71] API Doc conversion to a node type #84

Merged
merged 25 commits into from
May 13, 2020

Conversation

arlina-espinoza
Copy link
Contributor

@arlina-espinoza arlina-espinoza commented May 6, 2020

Fixes #71. This PR provides the same functionality as 8.x-1.x, but it uses node type instead of a custom entity, making it possible to integrate seamlessly with views, as well as use the wide array of Drupal Contrib modules for node access control. It will also reduce the amount of code we maintain, as the base functionality is provided by core.

For now, it does not provide an upgrade path from the 1.x branch, only a fail-safe to throw an error if users try to update from 1.x - see #80 .

I've written some condensed instructions on setting up the Permissions by term module in the README, but I think they should be expanded on the drupal.org docs.

@googlebot googlebot added the cla: yes Indicates CLA has been signed label May 6, 2020
@arlina-espinoza arlina-espinoza linked an issue May 6, 2020 that may be closed by this pull request
@cnovak cnovak mentioned this pull request May 6, 2020
@kiranjyoth
Copy link

@arlina-espinoza @cnovak I have tested this on an existing install, and it works as expected.
Here are the steps I did.

  1. Deleted all API Docs from portal
  2. Uninstalled the API Catalog Module
  3. Updated API Catalog module with 2.x version
  4. Upload API Spec ( Conditional selection was not active but its fixed with latest 35b1cf6
  5. Spec loads with API doc display and works as expected.

Here are some anticipated changes on Kickstart profile

  1. /apis view display template update required image
  2. Facets for API filters templating
  3. Config files updates on /config/install/ for kickstart profile
  4. Default content and configuration updates

Copy link
Collaborator

@cnovak cnovak left a comment

Choose a reason for hiding this comment

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

Added various comments.

README.md Outdated Show resolved Hide resolved
README.md Outdated
with views. To set up an RBAC, we recommend ["Permissions by term"](https://www.drupal.org/project/permissions_by_term),
which can cover the following scenarios:

- Restrict access on reading docs or creating apps:
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should minimize the details put here and instead link out to the Drupal.org docs we have for the module to make things easier to edit. We could put all of this on a page and then move the content. We also may want to put these overall concepts under Kickstart since they have to do with API Product lockdown and API Doc lockdown?

README.md Outdated
API product, but want to only allow certain developers to be able to use that API product so that we can add manual or
automatic steps before approving access.
To implement using "Permissions by term":
1. Create a role for each teams of developers, and assign users accordingly. (The important step here is that the
Copy link
Collaborator

Choose a reason for hiding this comment

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

These steps seem to be the same as the "Restrict access on reading docs or creating apps". For this situation I think we need to explain in more detail that you can skip step 2 and 3 if you want anyone to see the docs and that the API Product should be locked down using "API Product RBAC", or they can let anyone try to create an app but then use manual approval to let the developer use the API.

README.md Outdated
3. On the API Doc node, tag it with the above term.

- Set access defaults for new API Products
As an API provider, I want to set the access control of a new API Product to be hidden for all users except
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seem to also be the same steps as the two use cases above, shouldn't it instead talk about how you can set a new taxonomy term as default in the API Doc content type so that when a new API Doc is created it would be automatically locked down to a certain role?

README.md Outdated Show resolved Hide resolved
config/optional/views.view.api_catalog_admin.yml Outdated Show resolved Hide resolved
apigee_api_catalog.module Show resolved Hide resolved
tests/src/Functional/ApiDocsJsonApi.php Outdated Show resolved Hide resolved
tests/src/Functional/ApiDocsJsonApi.php Show resolved Hide resolved
tests/src/Kernel/SmartdocRoutingTest.php Outdated Show resolved Hide resolved
Copy link
Collaborator

@cnovak cnovak left a comment

Choose a reason for hiding this comment

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

LGTM, @arlina-espinoza to move docs about this to Drupal.org before merging.

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.

API product RBAC
4 participants