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

Fix tests to reduce the number of sensitive credentials used #348

Merged
merged 3 commits into from
Jul 12, 2019

Conversation

joshcanhelp
Copy link
Contributor

@joshcanhelp joshcanhelp commented Jul 1, 2019

Changes

  • Generate Management API token from client credentials grant
  • Switch testing app to a single application
  • Remove impersonation test
  • Remove need for global tenant client information

Testing

  • This change modifies test coverage
  • This change has been tested on PHP 7.1.29

@joshcanhelp joshcanhelp changed the title Remove global client info; use single test application; generate toke… Fix tests to reduce the number of sensitive credentials used Jul 1, 2019
@joshcanhelp joshcanhelp marked this pull request as ready for review July 1, 2019 20:43
@joshcanhelp joshcanhelp requested a review from a team July 1, 2019 20:43
@joshcanhelp joshcanhelp added this to the v5-Next milestone Jul 1, 2019
Copy link
Contributor

@lbalmaceda lbalmaceda left a comment

Choose a reason for hiding this comment

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

Please DM me to update the CI credentials. Also, is there any strong reason why this is tagged for the changelog? I tend to ignore doc and tests updates.

// Make sure we only have the 4 fields we requested.
$this->assertEquals(count($fields), count($paged_results[0]));
// Make sure we only have the 4 fields we requested plus "tenant".
$this->assertEquals(count($fields) + 1, count($paged_results[0]));
Copy link
Contributor

Choose a reason for hiding this comment

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

why did this change? Can you point out the change that triggered this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure it switched when the token changed from an SDK-generated one using the global client secret to one obtained with a client credentials grant.

Copy link
Contributor

Choose a reason for hiding this comment

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

Tests shouldn't have changed only because a token value changed, unless the new scope is different from the previous one. Lets check that first and ensure that is the expected behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Confirmed. Here is the GET call with a "regular" API token (CC grant or manually created in the dashboard):

Screenshot 2019-07-12 12 19 44

Here is the same exact call with a generated token (what we used before this change):

Screenshot 2019-07-12 12 18 36

@joshcanhelp joshcanhelp force-pushed the remove-client-secret-from-tests branch from 1bade4e to 2d85a82 Compare July 12, 2019 19:47
@joshcanhelp joshcanhelp force-pushed the remove-client-secret-from-tests branch from 2d85a82 to ff51292 Compare July 12, 2019 19:50
@joshcanhelp joshcanhelp merged commit 12784d1 into master Jul 12, 2019
@joshcanhelp joshcanhelp deleted the remove-client-secret-from-tests branch July 12, 2019 19:52
@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants