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

SIT-3368: Use the new curator API in the plugin, which does not use Auth0 authentication #306

Closed
1 task done
jeffpaul opened this issue Jun 22, 2022 · 5 comments · Fixed by #310
Closed
1 task done
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@jeffpaul
Copy link
Contributor

jeffpaul commented Jun 22, 2022

Is your enhancement related to a problem? Please describe.

From Swati Matta:

The new API will shorten the response time, and remove dependency on Auth0 authentication. Document attached. This will need only the following fields to be configured in the plugin:

  • Tenant ID
  • Host ID
  • On a widget level - page name and widget name (This is as-is behaviour from today)

Please let me know if you have any questions after reviewing the documentation.

For historical context, see: https://voltron.atlassian.net/servicedesk/customer/portal/41/SIT-3368.

Designs

n/a

Describe alternatives you've considered

n/a

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jeffpaul jeffpaul added this to the 1.2.0 milestone Jun 22, 2022
@jeffpaul jeffpaul changed the title SIT-3368: updated Curator API SIT-3368: Use the new curator API in the plugin, which does not use Auth0 authentication Jul 12, 2022
@jeffpaul
Copy link
Contributor Author

jeffpaul commented Jul 12, 2022

Comment from @oscarssanchez:

Hi Swati Matta,
It is still not completely clear how the API works. These are the questions that I have so far:

  • Do we need to still request a token prior to request data from Sophi? If so, is the method to request one still the same? (same URLs, same parameters, etc)
  • Does “Host ID” need to be an input? It seems like it should be the site URL from what I see in the documentation
  • Do we need to keep the site automation url input? It seems like the new URLs are https://ssa-cdn.ml.sophi.works/ and https://ssa-cdn.ml.sophi.io/
  • Does something needs to change in the collector settings ?
  • What will happen to the previous API? Is it still going to be supported? If so, do we need to account for this?
    Thanks!

@jeffpaul
Copy link
Contributor Author

Comment from Swati Matta:

  • Token is not required, you can directly call the API without a token
  • The old API is currently supported, but we will discontinue support once the integration for new one is complete. So you can consider it “not supported” for the purpose of this integration
  • Host ID needs to be an input. Arijit Paul, pls provide hostID for the 10up VIP test site. This should be configured in the API settings and will vary per customer for each site. If a customer has two sites or hosts, they will each have a different host ID
  • Yes, pls use the new URLs
  • No change to collector settings

@jeffpaul
Copy link
Contributor Author

jeffpaul commented Jul 12, 2022

Comment from @oscarssanchez:

Authorization (to be deprecated)
As of now, we have a two step process in order to retrieve data from Sophi:
1.- We request a token to communicate with the API: https://github.com/globeandmail/sophi-for-wordpress/blob/develop/includes/classes/SiteAutomation/Auth.php
2.- We use that token plus some parameters in the GET request to authenticate and ask Sophi for our data:
If the API/conversation in the ticket is correct, https://github.com/globeandmail/sophi-for-wordpress/blob/develop/includes/classes/SiteAutomation/Auth.php should probably be ok to be deleted (and consequently places where file/contents were used. We should look for unused methods and remove them.

Settings page
As of now, our settings page look like this:
Screen Shot 2022-06-28 at 14 36 46
We would need to remove the deprecated site automation settings, as well as cleanup (transients and options) should be done were applicable.

Retrieving data from Sophi.
The bulk of it as of now happens here https://github.com/globeandmail/sophi-for-wordpress/blob/develop/includes/classes/SiteAutomation/Request.php#L77 and here https://github.com/globeandmail/sophi-for-wordpress/blob/8317f1d2d9968fef97e87e8a42c0823d054860f3/includes/classes/SiteAutomation/Request.php#L215
These two places are where we probably will need to accommodate for the new API. My suggestion is to test the API before starting to code.

Caching
I don’t expect previous cached responses to suffer from this change, as we just save whatever the response is from Sophi.

cc @jeffpaul

@jeffpaul
Copy link
Contributor Author

Comment from Arijit Paul:

FYI: The new endpoint doesn’t require any Auth0 calls.

@jeffpaul jeffpaul added enhancement New feature or request help wanted Extra attention is needed labels Jul 12, 2022
@Sidsector9 Sidsector9 self-assigned this Jul 14, 2022
@Sidsector9
Copy link
Contributor

@jeffpaul can you share the HOST and TENANT_ID from the 1Password vault?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants