feat: add Ims token for db commands - #36
Merged
pdohogne-magento merged 6 commits intoMar 9, 2026
Merged
Conversation
nofuss
reviewed
Feb 25, 2026
nofuss
left a comment
Collaborator
There was a problem hiding this comment.
Question about token expiration.
Comment on lines
+61
to
+71
| if (tokenResponse.payload?.access_token) { | ||
| return tokenResponse.payload.access_token | ||
| } | ||
|
|
||
| if (tokenResponse.access_token) { | ||
| return tokenResponse.access_token | ||
| } | ||
|
|
||
| if (typeof tokenResponse === 'string') { | ||
| return tokenResponse | ||
| } |
Collaborator
There was a problem hiding this comment.
Do we not know the format of the response?
Collaborator
Author
There was a problem hiding this comment.
checked response format and fixed
moritzraho
reviewed
Mar 1, 2026
| const runtimeNamespace = config.get(CONFIG_RUNTIME_NAMESPACE) | ||
|
|
||
| if (!runtimeNamespace) { | ||
| throw new Error('Runtime namespace is required. Please set CONFIG_RUNTIME_NAMESPACE.') |
Member
There was a problem hiding this comment.
this is env AIO_RUNTIME_NAMESPACE
(this happens when the local project is not synced with console)
moritzraho
reviewed
Mar 1, 2026
| @@ -0,0 +1,142 @@ | |||
| /* | |||
Member
There was a problem hiding this comment.
Most of this logic is already handled by aio-lib-ims
please rewrite accordingly to https://github.com/adobe/aio-cli-plugin-app-storage/pull/36/changes#r2869855342
moritzraho
requested changes
Mar 1, 2026
moritzraho
approved these changes
Mar 2, 2026
moritzraho
left a comment
Member
There was a problem hiding this comment.
lgtm, few nits, tested it works fine, thanks!
nofuss
approved these changes
Mar 3, 2026
nofuss
left a comment
Collaborator
There was a problem hiding this comment.
looks like we're ready to give it a test!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR changes DBBase Command to rely on IMS-lib to fetch or reuse IMS tokens for Ims authentication for db service
Changes done -
authHelper.getAccessToken()which internally uses Ims libauthHelper.getAccessToken()checksims.contexts.<runtime_namespace>for an existing tokenims.getAccessTokenByClientCredentials()ims.contexts.<namespace>.tokenRelated Issue
Motivation and Context
How Has This Been Tested?
On local
Screenshots (if appropriate):
Types of changes
Checklist: