Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Custom Scripts using jans cli

HemantKMehta edited this page Jan 21, 2021 · 5 revisions

To perform the custom script related operations select option 13 from the main menu of jans-cli. The custom script sub menu has options to retrieve, add, update and delete the custom scripts.

  1. There is an option to get the tabular list of all the custom scripts. This table displays a selection number, scriptType, Name, enabled (true/ false) and inum of all scripts. To display all the details of script input the script number (from first column) in the selection choice.

  2. Next option is to add a new script. On selection of this option the cli will sequentially prompt (one at a time) for around 17 mandatory and optional data related to the script. inum is the extensible resource identifier (XRI) i-number, which is the identifier to uniquely identify a script.

    1. dn
    2. Inum
    3. aliases (optional)
    4. Description
    5. script Code: input _file </script/file/path/filename.py>
    6. scriptType: Input a valid script type in upper case
    7. programmingLanguage: input PYTHON/ JAVASCRIPT
    8. Add SimpleCustomProperty? : Choices are y/n. It will further prompt for following three sub fields on pressing y.
      • value1: location_type
      • value2: ldap
      • description: (optional)
    9. Add another SimpleCustomProperty? (y/n)
    10. Add SimpleExtendedCustomProperty? (y/n). On pressing y, it will prompt for following four sub fields.
      • value1: path
      • value2: /opt/jans/config.txt
      • description: path of config file
      • hide [false]:
    11. Add another SimpleExtendedCustomProperty? (y/n)
    12. script level: (1 to 100)
    13. revision number:
    14. enabled (true is script enabled) [false]:
    15. Data for object scriptError. Possible errors associated with the script. It has following two sub fields:
      • raisedAt:
      • stackTrace:
    16. modified [false]:
    17. internal [false]:
  3. After getting all the details jans-cli displays the input data and asks for user confirmation to continue with these data. On pressing y it will save the script and display all saved details.

  4. Update script option also works in a similar style. Using inum it retrieves the script first then all existing values will be displayed as default value on the prompt. User has the option to update the values. Besides updating these values the update script choice also gives users to add new simple and simple extended properties. Since it is an update option there will not be any default value of revision. The scriptError field and its sub-fields will be populated with error (if any) in the execution of the script.

  5. Click here for further details on using jans-cli.