[ 
https://issues.apache.org/jira/browse/JAMES-2564?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tellier Benoit updated JAMES-2564:
----------------------------------
    Description: 
In an effort to drop the CLI completly in Guice products, we need to support 
all features of the CLI in the webAdmin alternative.

Currently, one of the features missing are related to "mappings".

We would like to implement them on top of webadmin.

Create routes for:
 - Reading, adding and removing address mappings
 - Reading, adding and removing regex mappings
 - List all mappings

Here is a _suggestion_ of APIs:

 - Address mapping

```
GET /mappings/address/al...@apache.org

200
[
   { "toAddress": "b...@apache.org"},
   ...
]

PUT /mappings/address/al...@apache.org

With body { "toAddress": "b...@apache.org"}

Will add the mapping

DELETE /mappings/address/al...@apache.org

With body { "toAddress": "b...@apache.org"}

Will remove the mapping
```

Regarding regex mapping:

```
GET /mappings/regex/fromDomain.tld

200
[
   { "expression": "prefix_(.*)@test:admin@${1}"},
   ...
]

PUT /mappings/regex/fromDomain.tld

With body {"expression": "prefix_(.*)@test:admin@${1}"}

Will add the mapping

DELETE /mappings/regex/fromDomain.tld

With body {"expression": "prefix_(.*)@test:admin@${1}"}

Will remove the mapping
```

Regarding listing mappings:

```
GET /mappings

[
   {
      "type": "Domain",  // One of Domain, Address, Regex, Group, Forward, Error
       "source": {
            "fixedUser": "*",
            "fixedDomain": "domain.tld"
       },
       "mapping" : "newDomain.tld"
    }, ...
]
```

Open separate pull requests for each sets of routes.

We do stay at your full disposal on Gitter to answer related questions 
(https://gitter.im/apache/james-project)


  was:
In an effort to drop the CLI completly in Guice products, we need to support 
all features of the CLI in the webAdmin alternative.

Currently, the only features missing are related to "mappings".

We would like to implement them on top of webadmin.

Create routes for:
 - Reading, adding and removing address mappings
 - Reading, adding and removing regex mappings
 - List all mappings

Here is a _suggestion_ of APIs:

 - Address mapping

```
GET /mappings/address/al...@apache.org

200
[
   { "toAddress": "b...@apache.org"},
   ...
]

PUT /mappings/address/al...@apache.org

With body { "toAddress": "b...@apache.org"}

Will add the mapping

DELETE /mappings/address/al...@apache.org

With body { "toAddress": "b...@apache.org"}

Will remove the mapping
```

Regarding regex mapping:

```
GET /mappings/regex/fromDomain.tld

200
[
   { "expression": "prefix_(.*)@test:admin@${1}"},
   ...
]

PUT /mappings/regex/fromDomain.tld

With body {"expression": "prefix_(.*)@test:admin@${1}"}

Will add the mapping

DELETE /mappings/regex/fromDomain.tld

With body {"expression": "prefix_(.*)@test:admin@${1}"}

Will remove the mapping
```

Regarding listing mappings:

```
GET /mappings

[
   {
      "type": "Domain",  // One of Domain, Address, Regex, Group, Forward, Error
       "source": {
            "fixedUser": "*",
            "fixedDomain": "domain.tld"
       },
       "mapping" : "newDomain.tld"
    }, ...
]
```

Open separate pull requests for each sets of routes.

We do stay at your full disposal on Gitter to answer related questions 
(https://gitter.im/apache/james-project)



> WebAdmin: Mappings 'address + regex' support
> --------------------------------------------
>
>                 Key: JAMES-2564
>                 URL: https://issues.apache.org/jira/browse/JAMES-2564
>             Project: James Server
>          Issue Type: New Feature
>          Components: data, webadmin
>            Reporter: Tellier Benoit
>            Priority: Major
>              Labels: feature
>
> In an effort to drop the CLI completly in Guice products, we need to support 
> all features of the CLI in the webAdmin alternative.
> Currently, one of the features missing are related to "mappings".
> We would like to implement them on top of webadmin.
> Create routes for:
>  - Reading, adding and removing address mappings
>  - Reading, adding and removing regex mappings
>  - List all mappings
> Here is a _suggestion_ of APIs:
>  - Address mapping
> ```
> GET /mappings/address/al...@apache.org
> 200
> [
>    { "toAddress": "b...@apache.org"},
>    ...
> ]
> PUT /mappings/address/al...@apache.org
> With body { "toAddress": "b...@apache.org"}
> Will add the mapping
> DELETE /mappings/address/al...@apache.org
> With body { "toAddress": "b...@apache.org"}
> Will remove the mapping
> ```
> Regarding regex mapping:
> ```
> GET /mappings/regex/fromDomain.tld
> 200
> [
>    { "expression": "prefix_(.*)@test:admin@${1}"},
>    ...
> ]
> PUT /mappings/regex/fromDomain.tld
> With body {"expression": "prefix_(.*)@test:admin@${1}"}
> Will add the mapping
> DELETE /mappings/regex/fromDomain.tld
> With body {"expression": "prefix_(.*)@test:admin@${1}"}
> Will remove the mapping
> ```
> Regarding listing mappings:
> ```
> GET /mappings
> [
>    {
>       "type": "Domain",  // One of Domain, Address, Regex, Group, Forward, 
> Error
>        "source": {
>             "fixedUser": "*",
>             "fixedDomain": "domain.tld"
>        },
>        "mapping" : "newDomain.tld"
>     }, ...
> ]
> ```
> Open separate pull requests for each sets of routes.
> We do stay at your full disposal on Gitter to answer related questions 
> (https://gitter.im/apache/james-project)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to