Types of Objects

Region Object

{
    "active": true,
    "id": "LGNHGCQIPTSLFMZNNXLE1698054937652",
    "alias": "nyc1",
    "created": 1698054937651,
    "updated": 1698054937651,
    "exp": 2707206937652
}
  • active [bool]: Used to toggle wether or not a region and it's capabilities can be used in authentication requests / routing.
  • id [string]: The randomly generated ID of your region.
  • alias [string]: The alias of your region.
  • created [int]: The Unix Epoch in milliseconds to represent when this record was added to the registry.
  • updated [int]: The Unix Epoch in milliseconds to represent when this record was last updated in the registry.
  • exp [int]: A Unix Epoch, in milliseconds, in the future, to represent when this record can no longer be used.

Capability Object

{
    "active": true,
    "capability": "clubs-vod",
    "created": 1698054937655,
    "updated": 1698054937655,
    "exp": 2707206937655,
    "publickey": "-----BEGIN PUBLIC KEY-----\nMIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQADMVXVsB5zDBXezp4ocDxDLzqe/lK\nwZuwqfvyceIqMArTscT9tQ0LXXErg7YMxVo0Aj6POdfkw3MlWsE5ZV8rZxMBqbJv\n27+Vdro8WuPqTBk1cEJkfW6BxQQV/NxZkEwFSwYGj3CcLUBO/KVO8r+U/vgDObuc\nIjotLyoNSd16HJB5JzE=\n-----END PUBLIC KEY-----\n",
    "region_id": "LGNHGCQIPTSLFMZNNXLE1698054937652",
}
  • active [bool]: Used to toggle wether or not a capability can be used in authentication requests / routing.
  • alias [string]: The name of your capability, you should treat this like an id, no other capability within this region should use this name. It needs to be usable in a domain, such as [capability].capability.[region_id].[registry-hostname] (e.g clubs-vod.capability.LGNHGCQIPTSLFMZNNXLE1698054937652.registry.example.com)
  • created [int]: The Unix Epoch in milliseconds to represent when this capability was added to the registry.
  • updated [int]: The Unix Epoch in milliseconds to represent when this capability was last updated in the registry.
  • exp [int]: A Unix Epoch, in milliseconds, in the future, to represent when this capability can no longer be used.
  • publickey [string]: An Elliptic Curve P-512 public-key. The code authenticating as this capability will have the private-key, when an authentication needs to be verified, the data will be verified against this public-key.
  • region_id [string]: The ID of the region this capability is tied to.

Signed Object

{
    regionmeta: {
        id: creds.whoami.id,
        capability: creds.whoami.capability,
        registry: creds.whoami.registry,
        expires: new Date().getTime()+60000
    },
    data: data
}

regionmeta

  • .id [bool]: The region ID of the capability you are authenticating as.
  • .capability [string]: The name of the capability you are authenticating as.
  • .registry [string]: The registry of your capability and region.
  • .expires [int]: The Unix Epoch in milliseconds to represent when this authentication packet expires.

other

  • data [string/object]: The data you want to pass, this can be a string or an object.

Credentials Object

let creds: Creds = Creds {
    whoami: {
        id: "LGNHGCQIPTSLFMZNNXLE1698054937652",
        capability: "clubs-vod",
        registry: "dns://registry.example.com",
        privatekey: "-----BEGIN EC PRIVATE KEY-----\nMIHcAgEBBEIAEUKP9xGL5tCnUclphhWVvIGr12pY7H5H51V4QlTkLvn1iUVJ4Qyj\ntedwxIOtuQ7dk9LVhMBLX+e4GuKqwm7IrNigBwYFK4EEACOhgYkDgYYABAAMxVdW\nwHnMMFd7OnihwPEMvOp7+UrBm7Cp+/Jx4iowCtOxxP21DQtdcSuDtgzFWjQCPo85\n1+TDcyVawTllXytnEwGpsm/bv5V2ujxa4+pMGTVwQmR9boHFBBX83FmQTAVLBgaP\ncJwtQE78pU7yv5T++AM5u5wiOi0vKg1J3XockHknMQ==\n-----END EC PRIVATE KEY-----\n"
    },
    acceptable_registries: [ { url: "dns://registry.example.com", cache: 20, publickey: "-----BEGIN PUBLIC KEY-----\nMIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQB0T3y9dbBmBDe+DrMDR8WdklgXH//\nT2jMwF1jrHJPxTo2ElaGTIs00aSXgRKtfJeJ5nIHR/aJjLQbL66UOYrrSUYBZ3DQ\nAOy7PFR48drHHeNTya/2ysPE+EpDrDca+eFlLuWvxEZfUaxKloWLlrAvB2ZPwc50\ngrZuEMXY2c+71z3cGAo=\n-----END PUBLIC KEY-----\n" } ]
};

whoami

  • .id [bool]: The region ID of the capability you are authenticating as.
  • .capability [string]: The name of the capability you are authenticating as.
  • .registry [string]: The registry of your capability and region.
  • .privatekey [string]: The Elliptic Curve P-512 private-key for your capability, this should be the private-key that matches the public-key in your capability registry record.

other

Acceptable Registry Object

{
    url: "dns://registry.example.com",
    cache: 20,
    publickey: "-----BEGIN PUBLIC KEY-----\nMIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQB0T3y9dbBmBDe+DrMDR8WdklgXH//\nT2jMwF1jrHJPxTo2ElaGTIs00aSXgRKtfJeJ5nIHR/aJjLQbL66UOYrrSUYBZ3DQ\nAOy7PFR48drHHeNTya/2ysPE+EpDrDca+eFlLuWvxEZfUaxKloWLlrAvB2ZPwc50\ngrZuEMXY2c+71z3cGAo=\n-----END PUBLIC KEY-----\n"
}
  • url [string]: The URL of the registry, starting with the registry type. It should be formatted "[registry_type (lowercase)]://[registry_address]" (e.g https://registry.example.com, dns://registry.example.com)
  • cache [int]: In milliseconds, how long to cache responses from this registry.
  • publickey [string]: An Elliptic Curve P-512 public-key to verify registry responses with.

A project from OracularHades

Github