Systems

A system is a very loosely defined term in Vibranium. It can refer to different landscapes, applications, accounts, tenants etc.

For example, If we have a dev landscape with three tenants, each having two users that are used for testing, then if we want to use them in Vibranium, it becomes six accounts, as follows:

  1. dev_tenant1_user1 : user1 credentials in dev tenant1
  2. dev_tenant1_user2 : user2 credentials in dev tenant1
  3. dev_tenant2_user1 : user1 credentials in dev tenant2
  4. dev_tenant2_user2 : user2 credentials in dev tenant2
  5. dev_tenant3_user1 : user1 credentials in dev tenant3
  6. dev_tenant3_user2 : user2 credentials in dev tenant3

A better way to visualize this is using the JSON structure in config.json

{
    "dev_tenant1_read_access_user": {
        "url": "https://dev.tenant1.domain.com/ui",
        "api_url": "https://dev.tenant1.domain.com/api/v1",
        "method": "basic",
        "credentials": {
            "username": "readAccessUserName",
            "password": "readAccessUserPassword"
        }
    },
    "dev_tenant1_write_access_user": {
        "url": "https://dev.tenant1.domain.com/ui",
        "api_url": "https://dev.tenant1.domain.com/api/v1",
        "method": "basic",
        "credentials": {
            "username": "writeAccessUserName",
            "password": "writeAccessUserPassword"
        }
    },
    "dev_tenant1_read_access_user": {
        "url": "https://dev.tenant2.domain.com/ui",
        "api_url": "https://dev.tenant2.domain.com/api/v1",
        "method": "basic",
        "credentials": {
            "username": "readAccessUserName",
            "password": "readAccessUserPassword"
        }
    },
    "dev_tenant1_write_access_user": {
        "url": "https://dev.tenant2.domain.com/ui",
        "api_url": "https://dev.tenant2.domain.com/api/v1",
        "method": "basic",
        "credentials": {
            "username": "writeAccessUserName",
            "password": "writeAccessUserPassword"
        }
    },
    "dev_tenant1_read_access_user": {
        "url": "https://dev.tenant3.domain.com/ui",
        "api_url": "https://dev.tenant3.domain.com/api/v1",
        "method": "basic",
        "credentials": {
            "username": "readAccessUserName",
            "password": "readAccessUserPassword"
        }
    },
    "dev_tenant1_write_access_user": {
        "url": "https://dev.tenant3.domain.com/ui",
        "api_url": "https://dev.tenant3.domain.com/api/v1",
        "method": "basic",
        "credentials": {
            "username": "writeAccessUserName",
            "password": "writeAccessUserPassword"
        }
    }
}

This configuration is maintained in the Config file To set one of these systems as the default, all you need to do is add the system name to the config json's default_account key.

Usage

Once the systems are defined in the config.json, to use the systems, you need to use the system keyword (If you need to use any system other than the system marked as default).

  • If the system is not specified anywhere in endpoint of in execution arguments, the default system is picked up.
  • If the system is specified in the execution level, using --system option [Refer here], then that system is picked up. You can override the default system to say dev_tenant1_write_access_user by specifying --system default=dev_tenant1_write_access_user
  • If the system is specified at the endpoint level, using the system key [Refer here], then this takes priority and this system is picked up for execution.

If in any case the system specified is not found in the config.json, then the default system specified in the config.json is automatically picked up.

Examples

{
    "some_system_with_no_auth": {
        "url": "https://reqres.in/",
        "api_url": "https://reqres.in",
        "method": "none"
    },
    "some_random_name_for_my_system_with_basic_auth": {
        "url": "SYSTEM_UI_URL",
        "api_url": "API_ENDPOINT",
        "method": "basic",
        "credentials": {
            "username": "MY_SUPER_SECRET_USERNAME",
            "password": "MY_SUPER_SECRET_PASSWORD"
        }
    },
    "another_system_that_uses_jwt_token_based_auth": {
        "url": "SYSTEM_UI_URL",
        "api_url": "API_ENDPOINT",
        "method": "oauth2",
        "oauth_url": "OAUTH_TOKEN_URL_FOR_THE_SYSTEM",
        "credentials": {
            "clientid": "MY_SUPER_SECRET_CLIENT_ID",
            "secret": "MY_SUPER_SECRET_CLIENT_SECRET"
        }
    },
    "github_api_v3_basic_auth": {
        "url": "",
        "api_url": "https://api.github.com/v3",
        "method": "basic",
        "credentials": {
            "username": "MY_SUPER_SECRET_USERNAME",
            "password": "MY_SUPER_SECRET_PASSWORD",
        }
    }
}