Skip to content

Conversation

@MichaelGoberling
Copy link
Contributor

Description

Breaking change

Proposing to make it so ims credential env vars are easy to pass to actions.

Today, when we aio app use or app init, we get something like this in .env:

AIO_ims_contexts_aio-4566206088345584002_client__id=abcd1245...

This PR proposes standardizing these properties to something easier to predict, the solution is to prefix each field in the credential with IMS_:

IMS_CLIENT_ID=abcd12345...
IMS_ORG_ID=123@AdobeOrg
...

And then they can be passed to Runtime actions:

          inputs:
            IMS_CLIENT_ID: $IMS_CLIENT_ID

For projects with multiple credentials, the env vars are postfixed with _{index}:

IMS_CLIENT_ID_2=abcd12345...

Related Issue

N/A

Motivation and Context

Make it easier to use IMS credential env vars

How Has This Been Tested?

  • npm run test
  • Locally linked plugin, aio app use and aio app init

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@shazron
Copy link
Member

shazron commented Jan 7, 2026

Since this is a breaking change, an idea that will not break existing users:

# Legacy (deprecated)
AIO_ims_contexts_ProjectB_client__id=XUXUXUXUXUXUXUX
AIO_ims_contexts_ProjectB_client__secret=XPXPXPXPXPXPXPXPX
AIO_ims_contexts_ProjectB_technical__account__email=XTXTXTXTXTX@techacct.adobe.com
AIO_ims_contexts_ProjectB_technical__account__id=IDIDIDIDID@techacct.adobe.com
AIO_ims_contexts_ProjectB_meta__scopes=["ent_smartcontent_sdk","ent_adobeio_sdk"]
AIO_ims_contexts_ProjectB_ims__org__id=XOXOXOXOXOXOX@AdobeOrg
AIO_ims_contexts_NewTestIntegration8_client__id=XRXRXRXRXRXRXRXRXR
AIO_ims_contexts_NewTestIntegration8_client__secret=XRXRXRXRXRXRXRXRXRX
AIO_ims_contexts_NewTestIntegration8_redirect__uri=["https://abc123/foo"]
AIO_ims_contexts_NewTestIntegration8_defaultRedirectUri=https://abc123/foo
# Updated
IMS_CLIENT_ID=$AIO_ims_contexts_ProjectB_client__id
IMS_CLIENT_SECRET=$AIO_ims_contexts_ProjectB_client__secret
IMS_TECHNICAL_ACCOUNT_EMAIL=$AIO_ims_contexts_ProjectB_technical__account__email
IMS_TECHNICAL_ACCOUNT_ID=$AIO_ims_contexts_ProjectB_technical__account__id
IMS_META_SCOPES=$AIO_ims_contexts_ProjectB_meta__scopes
IMS_ORG_ID=$AIO_ims_contexts_ProjectB_ims__org__id
IMS_CLIENT_ID_2=$AIO_ims_contexts_NewTestIntegration8_client__id
IMS_CLIENT_SECRET_2=$AIO_ims_contexts_NewTestIntegration8_client__secret
IMS_REDIRECT_URI_2=$AIO_ims_contexts_NewTestIntegration8_redirect__uri
IMS_DEFAULTREDIRECTURI_2=$AIO_ims_contexts_NewTestIntegration8_defaultRedirectUri

The only caveat is, the dotenv package does not do variable expansion, you would have to use https://github.com/dotenvx/dotenvx (by the same author)

Tested using:

index.js

require('@dotenvx/dotenvx').config()

console.log('FOO', process.env.FOO)
console.log('BAR', process.env.BAR)

.env

FOO="the quick brown fox"
BAR="$FOO"

result:

❯ node index.js
[dotenvx@1.51.4] injecting env (2) from .env
FOO the quick brown fox
BAR the quick brown fox

We do special AIO_ var handling, in our aio-lib-core-config lib, so I'm not sure if this will work with that (haven't tested that scenario yet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants