-
Notifications
You must be signed in to change notification settings - Fork 9
Adds conditional logic for the retrieval of credentials #72
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #72 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 530 536 +6
Branches 90 92 +2
=========================================
+ Hits 530 536 +6
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
…eck it is a function
Nice, this would be a good addition to the lib, making it easier for template implementers to get credentials. Couple things to think about:
cc: @shazron |
…pinner message twice and getCredentials to be called twice
Thanks for the feedback, Michael! Just added the suggested changes. Please let me know what you think. |
@MichaelGoberling can we squash everything next time? this will be hard to revert if there was an issue in production. Not that there is right now... but investigating an issue in this whole lib currently. |
The proposed changes will allow for the successful retrieval of either OAuth or JWT credentials through composition, so that App Builder template developers don't have the need to hardcode in the template which credential to retrieve.
Description
The new changes add conditional logic to look for OAuth credentials, and if such credentials are undefined, it will look for the JWT ones. This change will also make room for future auth providers to be added into the conditional.
Related Issue
adobe/commerce-events-ext-tpl#6
Motivation and Context
This update will benefit App Builder template developers by removing the requirement to hard code credentials in each template, whether existing or new. This change significantly reduces the need for hardcoded information in templates that support multiple authentication protocols, as well as the possibility of new auth providers to be added in the future.
How Has This Been Tested?
These changes were tested specifically with
_commerce-events-ext-tpl_
commerce template for App Builder. With the proposed additional code, apps were successfully initialized and deployed for projects using both JWT and OAuth credentials, including half-way the migration process from JWT to OAuth.Screenshots (if appropriate):
Types of changes
Checklist: