Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-9703

Remove deprecated ssoadm policies commands

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 13.0.0, 13.5.0
    • Fix Version/s: 13.5.1, 14.0.0
    • Component/s: None
    • Labels:
    • Sprint:
      AM Sustaining Sprint 29
    • Support Ticket IDs:

      Description

      The ssoadm command classes have been removed but the commands are still there. it results of a class not found exception.

      CommandManager.<init> 
      com.sun.identity.cli.CLIException: com.sun.identity.cli.realm.RealmCreatePolicy 
      

      How to reproduce

      Just try to use those ssoadm commands

       ./ssoadm list-policies -u amadmin -f /tmp/pwd.txt -e "/" -d 
      

      Expected result

      You should have a "Command not found"

      Current result

      CommandManager.<init>
      com.sun.identity.cli.CLIException: com.sun.identity.cli.realm.RealmGetPolicy
      	at com.sun.identity.cli.SubCommand.execute(SubCommand.java:298)
      	at com.sun.identity.cli.CLIRequest.process(CLIRequest.java:217)
      	at com.sun.identity.cli.CLIRequest.process(CLIRequest.java:139)
      	at com.sun.identity.cli.CommandManager.serviceRequestQueue(CommandManager.java:576)
      	at com.sun.identity.cli.CommandManager.<init>(CommandManager.java:173)
      	at com.sun.identity.cli.CommandManager.main(CommandManager.java:150)
      
      

      Workaround

      Those two ssoadm commands have been deprecated. You can find the new functionalities replacing those commands here:

      https://backstage.forgerock.com/#!/docs/openam/13.5/dev-guide/chap-client-dev#rest-api-filter-sort-page

      It's now using the REST API instead.

       curl \
      --header "iPlanetDirectoryPro: AQIC5..." \
      --get \
      --data-urlencode '_queryFilter=true' \
      --data-urlencode '_fields=name,creationDate' \
      https://openam.example.com:8443/openam/json/policies
      

      How to resolve that for us in FR?

      In AccessManager.java, remove the commands references:

        @SubCommandInfo(
                implClassName="com.sun.identity.cli.realm.RealmCreatePolicy",
                description="Create policies in a realm.",
                webSupport="true",
                mandatoryOptions={
                        "realm|e|s|Name of realm.",
                        "xmlfile|X|s|Name of file that contains policy XML definition."},
                optionAliases={},
                macro="authentication",
                optionalOptions={},
                resourceStrings={
                        "subcmd-create-policies-__web__-xmlfile=Policy XML",
                        "create-policy-in-realm-succeed=Policies were created under realm, {0}."})
        private String create_policies;
      
        @SubCommandInfo(
                implClassName="com.sun.identity.cli.realm.RealmGetPolicy",
                description="List policy definitions in a realm.",
                webSupport="true",
                mandatoryOptions={
                        "realm|e|s|Name of realm."},
                optionAliases={},
                macro="authentication",
                optionalOptions={
                        "policynames|p|m|Names of policy. This can be an wildcard. All policy definition in the realm will be returned if this option is not provided.",
                        "outfile|o|s|Filename where policy definition will be printed to. Definition will be printed in standard output if this option is not provided.",
                        "namesonly|n|u|Returns only names of matching policies. Policies are not returned." },
                resourceStrings={
                        "get-policy-names-in-realm-succeed=Policy names were returned under realm, {0}.",
                        "get-policy-names-in-realm-no-policies=There were not matching policy names under realm, {0}.",
                        "get-policy-in-realm-succeed=Policy definitions were returned under realm, {0}.",
                        "get-policy-in-realm-no-policies=There were not matching policies under realm, {0}."})
        private String list_policies;
      

      Note for engineering: If you remove a CLI class, please remove every reference of it, which usually result of removing the ssoadm command.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                quentin.castel Quentin CASTEL [X] (Inactive)
                Reporter:
                quentin.castel Quentin CASTEL [X] (Inactive)
                QA Assignee:
                Nemanja Lukic
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: