Skip to content

Commit

Permalink
rename $<config> to <config> (#265)
Browse files Browse the repository at this point in the history
* rename $ims to ims, needs bump in lib

* rename $cli to cli

* fix env ims_ to ims_contexts_

* fix comments
  • Loading branch information
moritzraho authored Jul 6, 2020
1 parent dbd4330 commit ba4a08e
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 48 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"bugs": "https://github.com/adobe/aio-cli-plugin-app/issues",
"dependencies": {
"@adobe/aio-app-scripts": "^2.0.0",
"@adobe/aio-lib-core-config": ">=1.2.8",
"@adobe/aio-lib-core-config": "^2.0.0",
"@adobe/aio-lib-core-logging": "^1.1.0",
"@adobe/aio-lib-ims": "^3.0.0",
"@adobe/aio-lib-ims": "^4.0.0",
"@adobe/generator-aio-app": "^1.3.1",
"@adobe/generator-aio-console": "^1.1.1",
"@oclif/command": "^1.5.11",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/app-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function wrapError (err) {
/** @private */
async function getCliInfo () {
const { env = 'prod' } = await context.getCli() || {}
await context.setCli({ '$cli.bare-output': true }, false) // set this globally
await context.setCli({ 'cli.bare-output': true }, false) // set this globally

aioLogger.debug('Retrieving CLI Token')
const accessToken = await getToken(CLI)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ async function importConfigJson (configFileLocation, destinationFolder = process

await writeEnv({
runtime: transformRuntime(runtime),
$ims: transformCredentials(credentials, config.project.org.ims_org_id)
ims: { contexts: transformCredentials(credentials, config.project.org.ims_org_id) }
}, destinationFolder, flags, extraEnvVars)

// remove the credentials
Expand Down
20 changes: 10 additions & 10 deletions test/__fixtures__/config.orgid.env
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
AIO_$ims_ProjectB_client__id=XUXUXUXUXUXUXUX
AIO_$ims_ProjectB_client__secret=XPXPXPXPXPXPXPXPX
AIO_$ims_ProjectB_technical__account__email=XTXTXTXTXTX@techacct.adobe.com
AIO_$ims_ProjectB_technical__account__id=IDIDIDIDID@techacct.adobe.com
AIO_$ims_ProjectB_meta__scopes=["ent_smartcontent_sdk","ent_adobeio_sdk"]
AIO_$ims_ProjectB_ims__org__id=XOXOXOXOXOXOX@AdobeOrg
AIO_$ims_NewTestIntegration8_client__id=XRXRXRXRXRXRXRXRXR
AIO_$ims_NewTestIntegration8_client__secret=XRXRXRXRXRXRXRXRXRX
AIO_$ims_NewTestIntegration8_redirect__uri=["https://abc123/foo"]
AIO_$ims_NewTestIntegration8_defaultRedirectUri=https://abc123/foo
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
8 changes: 4 additions & 4 deletions test/__fixtures__/config.orgid.no.jwt.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AIO_$ims_NewTestIntegration8_client__id=XRXRXRXRXRXRXRXRXR
AIO_$ims_NewTestIntegration8_client__secret=XRXRXRXRXRXRXRXRXRX
AIO_$ims_NewTestIntegration8_redirect__uri=["https://abc123/foo"]
AIO_$ims_NewTestIntegration8_defaultRedirectUri=https://abc123/foo
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
28 changes: 14 additions & 14 deletions test/__fixtures__/existing.merged.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ AIO_foo_bar=baz
AIO_boo=faz
AIO_runtime_auth=Auth
AIO_runtime_namespace=Name
AIO_$ims_Projéct__A_client__id=XYXYXYXYXYXYXYXYX
AIO_$ims_Projéct__A_client__secret=XYXYXYXYZZZZZZ
AIO_$ims_Projéct__A_redirect__uri=["https://test123"]
AIO_$ims_Projéct__A_defaultRedirectUri=https://test123
AIO_$ims_PröjectB_client__id=XUXUXUXUXUXUXUX
AIO_$ims_PröjectB_client__secret=XPXPXPXPXPXPXPXPX
AIO_$ims_PröjectB_technical__account__email=XTXTXTXTXTX@techacct.adobe.com
AIO_$ims_PröjectB_technical__account__id=IDIDIDIDID@techacct.adobe.com
AIO_$ims_PröjectB_meta__scopes=["ent_smartcontent_sdk","ent_adobeio_sdk"]
AIO_$ims_PröjectB_ims__org__id=XOXOXOXOXOXOX@AdobeOrg
AIO_$ims_New__Test__Intégration__8_client__id=XRXRXRXRXRXRXRXRXR
AIO_$ims_New__Test__Intégration__8_client__secret=XRXRXRXRXRXRXRXRXRX
AIO_$ims_New__Test__Intégration__8_redirect__uri=["https://abc123/foo"]
AIO_$ims_New__Test__Intégration__8_defaultRedirectUri=https://abc123/foo
AIO_ims_contexts_Projéct__A_client__id=XYXYXYXYXYXYXYXYX
AIO_ims_contexts_Projéct__A_client__secret=XYXYXYXYZZZZZZ
AIO_ims_contexts_Projéct__A_redirect__uri=["https://test123"]
AIO_ims_contexts_Projéct__A_defaultRedirectUri=https://test123
AIO_ims_contexts_PröjectB_client__id=XUXUXUXUXUXUXUX
AIO_ims_contexts_PröjectB_client__secret=XPXPXPXPXPXPXPXPX
AIO_ims_contexts_PröjectB_technical__account__email=XTXTXTXTXTX@techacct.adobe.com
AIO_ims_contexts_PröjectB_technical__account__id=IDIDIDIDID@techacct.adobe.com
AIO_ims_contexts_PröjectB_meta__scopes=["ent_smartcontent_sdk","ent_adobeio_sdk"]
AIO_ims_contexts_PröjectB_ims__org__id=XOXOXOXOXOXOX@AdobeOrg
AIO_ims_contexts_New__Test__Intégration__8_client__id=XRXRXRXRXRXRXRXRXR
AIO_ims_contexts_New__Test__Intégration__8_client__secret=XRXRXRXRXRXRXRXRXRX
AIO_ims_contexts_New__Test__Intégration__8_redirect__uri=["https://abc123/foo"]
AIO_ims_contexts_New__Test__Intégration__8_defaultRedirectUri=https://abc123/foo
28 changes: 14 additions & 14 deletions test/__fixtures__/valid.config.env
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
AIO_runtime_auth=Auth
AIO_runtime_namespace=Name
AIO_$ims_Projéct__A_client__id=XYXYXYXYXYXYXYXYX
AIO_$ims_Projéct__A_client__secret=XYXYXYXYZZZZZZ
AIO_$ims_Projéct__A_redirect__uri=["https://test123"]
AIO_$ims_Projéct__A_defaultRedirectUri=https://test123
AIO_$ims_PröjectB_client__id=XUXUXUXUXUXUXUX
AIO_$ims_PröjectB_client__secret=XPXPXPXPXPXPXPXPX
AIO_$ims_PröjectB_technical__account__email=XTXTXTXTXTX@techacct.adobe.com
AIO_$ims_PröjectB_technical__account__id=IDIDIDIDID@techacct.adobe.com
AIO_$ims_PröjectB_meta__scopes=["ent_smartcontent_sdk","ent_adobeio_sdk"]
AIO_$ims_PröjectB_ims__org__id=XOXOXOXOXOXOX@AdobeOrg
AIO_$ims_New__Test__Intégration__8_client__id=XRXRXRXRXRXRXRXRXR
AIO_$ims_New__Test__Intégration__8_client__secret=XRXRXRXRXRXRXRXRXRX
AIO_$ims_New__Test__Intégration__8_redirect__uri=["https://abc123/foo"]
AIO_$ims_New__Test__Intégration__8_defaultRedirectUri=https://abc123/foo
AIO_ims_contexts_Projéct__A_client__id=XYXYXYXYXYXYXYXYX
AIO_ims_contexts_Projéct__A_client__secret=XYXYXYXYZZZZZZ
AIO_ims_contexts_Projéct__A_redirect__uri=["https://test123"]
AIO_ims_contexts_Projéct__A_defaultRedirectUri=https://test123
AIO_ims_contexts_PröjectB_client__id=XUXUXUXUXUXUXUX
AIO_ims_contexts_PröjectB_client__secret=XPXPXPXPXPXPXPXPX
AIO_ims_contexts_PröjectB_technical__account__email=XTXTXTXTXTX@techacct.adobe.com
AIO_ims_contexts_PröjectB_technical__account__id=IDIDIDIDID@techacct.adobe.com
AIO_ims_contexts_PröjectB_meta__scopes=["ent_smartcontent_sdk","ent_adobeio_sdk"]
AIO_ims_contexts_PröjectB_ims__org__id=XOXOXOXOXOXOX@AdobeOrg
AIO_ims_contexts_New__Test__Intégration__8_client__id=XRXRXRXRXRXRXRXRXR
AIO_ims_contexts_New__Test__Intégration__8_client__secret=XRXRXRXRXRXRXRXRXRX
AIO_ims_contexts_New__Test__Intégration__8_redirect__uri=["https://abc123/foo"]
AIO_ims_contexts_New__Test__Intégration__8_defaultRedirectUri=https://abc123/foo
4 changes: 2 additions & 2 deletions test/commands/lib/import.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ test('importConfigJson - interactive', async () => {
await expect(fs.writeFile).toHaveBeenCalledTimes(8)
})

test('enrich $ims jwt credential with project.org.ims_org_id', async () => {
test('enrich ims jwt credential with project.org.ims_org_id', async () => {
const workingFolder = 'my-working-folder'
const aioPath = path.join(workingFolder, '.aio')
const envPath = path.join(workingFolder, '.env')
Expand All @@ -277,7 +277,7 @@ test('enrich $ims jwt credential with project.org.ims_org_id', async () => {
expect(fs.writeFile).toHaveBeenCalledTimes(2)
})

test('do not enrich $ims.jwt with ims_org_id if no jwt credentials defined ', async () => {
test('do not enrich ims.contexts.jwt with ims_org_id if no jwt credentials defined ', async () => {
const workingFolder = 'my-working-folder'
const aioPath = path.join(workingFolder, '.aio')
const envPath = path.join(workingFolder, '.env')
Expand Down

0 comments on commit ba4a08e

Please sign in to comment.