Skip to end of metadata
Go to start of metadata

Ninja is new command line tool bundled with midPoint. Implemented and planned functionality is based on "repo-ninja", but code was rewritten from the ground up. This tool comes in handy when one need to export or import objects from/to midPoint. Operations can be done on top of repository (DB) layer or through REST API. Access through DB layer can be very powerful, especially in cases when UI fails. For example when midPoint fails to start because of configuration issue or objects data corruption. Another great example is "administrator" user lockout. User of this tool needs to be aware that using repository layer, access is not validated using authorisations, model component is not used during processing and changes are not audited. It allows you to obtain or modify data in an otherwise unusable midPoint. Ninja also plan to support some other operations like listing keys from keystore, enforcing objects reencryption with new key, DB schema validation, password reset or user unlock.

Connecting to midPoint

Connection options:

  • using midpoint.home
  • using REST service (not yet implemented)

midpoint.home connection

This type of connection initialises repository layer of midpoint and operates on top of DB as new midPoint node. Mostly only one option is needed and that's specification of midpoint.home directory using -m option. This is not sufficient if config.xml uses datasource definition. Ninja then doesn't know how to connect to DB. For this case one have to use options to specify url ( -U ), username ( -u ) and password ( -p or -P ). These options can also be used to override JDBC url, username and password specified in config.xml.

REST connection

Not yet implemented.

Supported operations

Currently supports three operations:

  • import
  • export
  • keys

Import

todo

Example

Export

Known issues:

  • When exporting objects to SYSOUT, two lines are printed at the beginning of stream which doesn't belong to exported XML. It's from midPoint repository initialisation. One can get rid of these lines using tail, as in following example.

    Exporting to file using -O option is not affected.

Example

Keys

todo

 

Full help

Full help
  • No labels