Skip to content

Instantly share code, notes, and snippets.

@andrebires
Created October 11, 2018 12:25
Show Gist options
  • Save andrebires/b05b23dc9b0ce16aa13c0f9fd8258280 to your computer and use it in GitHub Desktop.
Save andrebires/b05b23dc9b0ce16aa13c0f9fd8258280 to your computer and use it in GitHub Desktop.

Iris presence routing rules

Considering the node name@domain.com/instance, for each routing rule below, it should resolve to the following nodes:

Instance

Resolve only to the exact node address.

Expression:

^(?<name>name)(?<domain>@domain\.com)(?<instance>\/instance)$

Valid nodes:

  • name@domain.com/instance

Identity

Resolve to the exact node address or the address without the instance.

Expression:

^(?<name>name)(?<domain>@domain\.com)(?<instance>\/instance|)?$

Valid nodes:

  • name@domain.com/instance
  • name@domain.com

Domain

Resolve to addresses with the same domain without the instance or with the same instance.

Expression:

^(?<name>[^@\/]+)(?<domain>@domain\.com)(?<instance>\/instance|)?$

Valid nodes:

  • name@domain.com/instance
  • name@domain.com
  • other-name@domain.com/instance
  • other-name@domain.com

Root domain

Resolve to addresses with the same domain and subdomains without the instance or with the same instance.

Expression:

^(?<name>[^@\/]+)(?<domain>@([^@\/]+\.)?domain\.com)(?<instance>\/instance|)?$

Valid nodes:

  • name@domain.com/instance
  • name@domain.com
  • other-name@domain.com/instance
  • name@sub.domain.com/instance
  • name@sub.domain.com
  • other-name@sub.domain.com/instance

Promiscuous instance

Resolve to addresses with any instance value.

Expression:

^(?<name>name)(?<domain>@domain\.com)(?<instance>\/[^@\/]+)$

Valid nodes:

  • name@domain.com/instance
  • name@domain.com/other-instance

Promiscuous identity

Resolve to the address without the instance or with any instance value.

Expression:

^(?<name>name)(?<domain>@domain\.com)(?<instance>\/[^@\/]+)?$

Valid nodes:

  • name@domain.com/instance
  • name@domain.com
  • name@domain.com/other-instance

Promiscuous domain

Resolve to addresses with the same domain without the instance or with any instance.

Expression:

^(?<name>[^@\/]+)(?<domain>@domain\.com)(?<instance>\/[^@\/]+)?$

Valid nodes:

  • name@domain.com/instance
  • name@domain.com
  • other-name@domain.com/instance
  • name@domain.com/other-instance

Promiscuous root domain

Resolve to addresses with the same domain and subdomains without the instance or with any instance.

Expression:

^(?<name>[^@\/]+)(?<domain>@([^@\/]+\.)?domain\.com)(?<instance>\/[^@\/]+)?$

Valid nodes:

  • name@domain.com/instance
  • name@domain.com/other-instance
  • name@domain.com
  • other-name@domain.com/instance
  • other-name@domain.com/other-instance
  • name@sub.domain.com/instance
  • name@sub.domain.com/other-instance
  • name@sub.domain.com
  • other-name@sub.domain.com/instance
  • other-name@sub.domain.com/other-instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment