Layer7-Community / graphman-client

This repository contains a Postman collection, a Node.js CLI application, sample queries for the CLI, and GraphQL schemas for the Graphman API.
Other
7 stars 5 forks source link

NORALLY: supporting multiple gateway profiles #23

Closed graju256 closed 6 months ago

graju256 commented 6 months ago

Existing graphman configuration allows the user to work with two gateway profiles named as sourceGateway and targetGateway. With this, user is allowed to work with multiple gateway profiles. Configured gateway profiles can be referenced as an option (--gateway name) while executing the export, import, renew, diff operations.

Examples:

In the above operations, if gateway option is not specified, it will be defaulted to "default" gateway profile.

In the above diff command, input can be a bundle or gateway. If gateway, make sure it is prefixed with '@' special char.

Default graphman configuration is as follows:

{
    "gateways": {
        "default": {
            "address": "https://localhost:8443/graphman",
            "username": "admin",
            "password": "7layer",
            "rejectUnauthorized": false,
            "passphrase": "7layer",
            "allowMutations": false
        }
    },

    "options": {
        "policyCodeFormat": "xml",
        "keyFormat": "p12"
    }
}

By default, gateways are protected from the accidental mutations, hence they will be ignored. In order to allow the mutations, set the "allowMutations" option to true.

Policy code can be seen in multiple formats (xml, json, yaml, code). By default, it will be exported in xml format. This can be changed to other supported formats by chanding the policyCodeFormat option.

Similarly, key format can be changed using keyFormat option. By default, keys will be seen in p12 format. Other supported variant is pem.