rockcarver / frodo-cli

A CLI to manage ForgeRock platform deployments supporting Identity Cloud tenants, ForgeOps deployments, and classic deployments.
MIT License
17 stars 14 forks source link

Frodo script imports show up as garbage chars within AM #288

Closed vscheuber closed 11 months ago

vscheuber commented 11 months ago

Frodo CLI version

v1.1.0

Describe the issue

This issue was reported via the ForgeRock Community channel: https://community.forgerock.com/t/frodo-script-imports-show-up-as-garbage-chars-within-am/4038

Hi,

We are trying to do the frodo import export as observed in this video https://www.youtube.com/watch?v=yGPnk7gR1dY 1

  1. frodo script export -A -x
    • this breaks down the script json and js files with a file based reference to the js files from within json
{
    "meta": {
        "origin": "http://am.example.com:8080/openam",
        "originAmVersion": "7.1.2",
        "exportedBy": "amadmin",
        "exportDate": "2023 -09 - 27T02: 54: 13.201Z",
        "exportTool": "frodo",
        "exportToolVersion": "v1.1.0[v18.5.0]"
    },
    "script": {
        "6b3cfd48 - 62d3 - 48ff - a96f - fe8f3a22ab30": {
            "_id": "6b3cfd48 - 62d3 - 48ff - a96f - fe8f3a22ab30",
            "name": "Amazon Profile Normalization",
            "description": "Normalizes raw profile data from Amazon",
            "script": "file://Amazon-Profile-Normalization.script.groovy",
            "default": true,
            "language": "GROOVY",
            "context": "SOCIAL_IDP_PROFILE_TRANSFORMATION",
            "createdBy": "id = dsameuser, ou = user, dc = openam, dc = forgerock, dc = org",
            "creationDate": 1433147666269,
            "lastModifiedBy": "id = dsameuser, ou = user, dc = openam, dc = forgerock, dc = org",
            "lastModifiedDate": 1433147666269
        }
    }
}
  1. perform changes on the scripts as exported
  2. Import the script back to AM using the command: frodo script import -f script.json -n scriptname

The script imported this way shows up as garbage chars in AM scripts.

See screenshot: https://backstage-community-prod.storage.googleapis.com/original/2X/d/d9cd4c6d0671a9bc3bd1faf0ba199bf3b50b8d31.png

Is there a limitation on the tool with such import export?

I am on version 7.1.2 of AM which still does base64 encode the scripts inside the json files. Would that be the reason for this?

Please advice.