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 22, 2021 · 5 revisions

jans-cli provides options to perform CRUD (Create, Read, Update and Delete) operations on the custom scripts. To perform the custom script related operations, select option 13 from the main menu.

  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 the script input the script number (from the first column) in the selection choice.

  2. The 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. The update script option also works in a similar style. To update script jans-cli asks for inum and retrieves the script, and all the existing values will be displayed as default value on the prompt. The user has the option to update the values. Besides updating these values, the user also has options to add new simple and simple extended properties. The scriptError field and its sub-fields will be populated with error (if any) in the execution of the script.

  5. Delete script option uses inum to delete it. It will prompt the inum of the script to delete it and then get the user's confirmation to delete it.

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