# OpenSRS

OpenSRS (Tucows) XCP API with signed requests.

| Field | Value |
|---|---|
| Addon id | `registrar-opensrs` |
| Kind | `registrar` |
| Provides | `opensrs` |
| Engine | `wasm` |
| ABI | `0.2.0` |
| Version | 0.1.0 |
| Author | MythicalSystems |
| Source | `extensions/addons/reg-opensrs` |
| Permissions (shown at install) | `domains.manage`, `network.outbound` |

## Capabilities

| Capability | Value |
|---|---|
| [`http`](capabilities.md) | `horizon.opensrs.net`, `rr-n1-tor.opensrs.net`, `$setting:api_base` |
| [`secrets`](capabilities.md) | none |

## Events and hooks

| What | Value |
|---|---|
| Listens to (`events`) | none |
| Hooks | none |
| Emits | none |
| Mixins | none |
| Scheduled jobs | none |

## Settings and secrets

| Setting | Type | Required |
|---|---|---|
| `username` | `text` | yes |
| `api_key` | `secret` | yes |
| `reg_username` | `text` | no |
| `reg_password` | `secret` | no |
| `test_mode` | `bool` | no |
| `api_base` | `text` | no |

Secrets (stored encrypted, never returned by the API): none.

Outbound HTTP allowed to: `horizon.opensrs.net`, `rr-n1-tor.opensrs.net`, `$setting:api_base`. `$server` is the hostname of the server configured for the product, `$setting:<key>` the host of that setting.

## addon.json

_extensions/addons/reg-opensrs/addon.json_

```json
{
  "abi": "0.2.0",
  "author": "MythicalSystems",
  "capabilities": {
    "http": [
      "horizon.opensrs.net",
      "rr-n1-tor.opensrs.net",
      "$setting:api_base"
    ],
    "secrets": []
  },
  "description": "addons.desc.registrar.opensrs",
  "engine": "wasm",
  "id": "registrar-opensrs",
  "kind": "registrar",
  "name": "OpenSRS",
  "permissions": [
    "domains.manage",
    "network.outbound"
  ],
  "provides": "opensrs",
  "settings": [
    {
      "key": "username",
      "kind": "text",
      "label": "addons.registrar.setting.username",
      "required": true
    },
    {
      "key": "api_key",
      "kind": "secret",
      "label": "addons.registrar.setting.api_key",
      "required": true
    },
    {
      "key": "reg_username",
      "kind": "text",
      "label": "addons.registrar.setting.reg_username",
      "required": false
    },
    {
      "key": "reg_password",
      "kind": "secret",
      "label": "addons.registrar.setting.reg_password",
      "required": false
    },
    {
      "default": false,
      "key": "test_mode",
      "kind": "bool",
      "label": "addons.registrar.setting.test_mode",
      "required": false
    },
    {
      "key": "api_base",
      "kind": "text",
      "label": "addons.registrar.setting.api_base",
      "required": false
    }
  ],
  "version": "0.1.0",
  "wasm": "addon.wasm"
}
```

