rockcarver / frodo-cli

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

Issue with Importing Configurations with Dependencies or Two-Step Process in frodo #430

Closed spirit69110s closed 3 months ago

spirit69110s commented 3 months ago

Frodo CLI Version

CLI: v2.0.1-0
Library: v2.0.1-1
Node: v20.11.1

Issue Description

I am encountering difficulties with importing configurations using frodo-cli when the configurations have dependencies or require a two-step process. The tool does not handle these cases correctly.

Example When exporting my email service configuration with the command:

bash

frodo service export -i email my-tenant

I receive the following export data:

json

{
  "meta": {
    "exportDate": "2024-08-03T02:03:10.608Z",
    "exportTool": "frodo",
    "exportToolVersion": "v2.0.1-1 [v20.11.1]",
    "exportedBy": "user@example.com",
    "origin": "https://openam-my-tenant.forgeblocks.com/am",
    "originAmVersion": "7.6.0"
  },
  "service": {
    "email": {
      "_id": "",
      "_type": {
        "_id": "email",
        "collection": false,
        "name": "Email Service"
      },
      "emailAddressAttribute": "mail",
      "emailImplClassName": "org.forgerock.openam.services.email.MailServerImpl",
      "emailRateLimitSeconds": 1,
      "from": "from@example.com",
      "location": "alpha",
      "message": "con",
      "nextDescendents": [
        {
          "_id": "smtp",
          "_type": {
            "_id": "smtpTransports",
            "collection": true,
            "name": "SMTP"
          },
          "emailImplClassName": "org.forgerock.openam.services.email.MailServerImpl",
          "hostname": "smtp.mail.com",
          "password": null,
          "port": 465,
          "sslState": "SSL",
          "username": "user@example.com"
        }
      ],
      "port": 465,
      "sslState": "SSL",
      "subject": "sub",
      "transportType": "smtp"
    }
  }
}

When attempting to import this configuration using: frodo service import -A my-tenant-profile

I encounter the following error:

Error importing services Error putting realm full service configs Error putting realm full service config email HTTP client error Code: ERR_BAD_REQUEST Status: 400 Reason: Bad Request Message: Data validation failed for the attribute, Transport Type

"If I delete the transportType attribute, the import will work."

The import process fails with a 400 Bad Request error, indicating a data validation issue related to the "Transport Type" attribute. This issue occurs with configurations that have dependencies or require a multi-step import process

hadimc commented 3 months ago

I was able to reproduce this.

vscheuber commented 3 months ago

@spirit69110s , I confirmed the issue and will be working on a remedy.

vscheuber commented 3 months ago

@spirit69110s this issue has been fixed in Frodo CLI 2.0.1. Please let me know if this still does not work for you.

spirit69110s commented 3 months ago

Thank you for your assistance. I appreciate it , it is working now