Petals BC REST

Rework how HTTP headers are configured

Details

  • Type: Improvement Request Improvement Request
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.1-BC
  • Fix Version/s: 1.1.0-BC
  • Component/s: Provider mode
  • Security Level: Public
  • Description:
    Hide

    In the current version and previous, HTTP headers put in the HTTP request sent to the REST server are extracted from properties of the incoming JBI message. This has no sens, all technical information required to invoke a resource should be defined in SU.

    So, we propose to rework how HTTP headers are configured. They should be configured at SU level as:

    <jbi:jbi ...>
       <jbi:services ...>
          <jbi:provides ...>
             ...
             <rest:mapping>
                ...
                <rest:operation name="ged:consulter">
                   ...
                   <rest:headers>
                      <rest:header name="Accept">
                         <rest:constant>application/xml</rest:constant>
                      <rest:header>
                      <rest:header name="X-lol">
                         <rest:xpath>/metadatas/metadata</rest:xpath>
                      <rest:header>
                      <!-- Following value extractor will be implemented later if such use-case exists -->
                      <!-- <rest:header name="dummy">
                              <rest:jbi-header>machin</rest:jbi-header>
                           <header> -->
                   <rest:headers>
                   ...
                </rest:operation>
                ...
             </rest:mapping>
          </jbi:consumes>
       </jbi:services>
    </jbi:jbi>

    Two different value extractors will be implemented in a first time:

    • <rest:constant />: The given value is the value to use, as a constant,
    • <rest:xpath />: The value is extracted using the given XPath expression applied on the incoming XML payload.
    Show
    In the current version and previous, HTTP headers put in the HTTP request sent to the REST server are extracted from properties of the incoming JBI message. This has no sens, all technical information required to invoke a resource should be defined in SU. So, we propose to rework how HTTP headers are configured. They should be configured at SU level as:
    <jbi:jbi ...>
       <jbi:services ...>
          <jbi:provides ...>
             ...
             <rest:mapping>
                ...
                <rest:operation name="ged:consulter">
                   ...
                   <rest:headers>
                      <rest:header name="Accept">
                         <rest:constant>application/xml</rest:constant>
                      <rest:header>
                      <rest:header name="X-lol">
                         <rest:xpath>/metadatas/metadata</rest:xpath>
                      <rest:header>
                      <!-- Following value extractor will be implemented later if such use-case exists -->
                      <!-- <rest:header name="dummy">
                              <rest:jbi-header>machin</rest:jbi-header>
                           <header> -->
                   <rest:headers>
                   ...
                </rest:operation>
                ...
             </rest:mapping>
          </jbi:consumes>
       </jbi:services>
    </jbi:jbi>
    Two different value extractors will be implemented in a first time:
    • <rest:constant />: The given value is the value to use, as a constant,
    • <rest:xpath />: The value is extracted using the given XPath expression applied on the incoming XML payload.
  • Environment:
    -

Activity




Transition Status Change Time Execution Times Last Executer Last Execution Date
New New Open Open
3h 20m
1
Christophe DENEUX
Thu, 19 Jan 2017 - 18:29:30 +0100
Open Open In Progress In Progress
3s
1
Christophe DENEUX
Thu, 19 Jan 2017 - 18:29:33 +0100
In Progress In Progress Resolved Resolved
11s
1
Christophe DENEUX
Thu, 19 Jan 2017 - 18:29:44 +0100
Christophe DENEUX made changes - Tue, 24 Jan 2017 - 11:53:42 +0100
Description In the current version and previous, HTTP headers put in the HTTP request sent to the REST server are extracted from properties of the incoming JBI message. This has no sens, all technical information required to invoke a resource should be defined in SU.

So, we propose to rework how HTTP headers are configured. They should be configured at SU level as:
{code:xml}
<jbi:jbi ...>
   <jbi:services ...>
      <jbi:provides ...>
         ...
         <rest:mapping>
            ...
            <rest:operation name="ged:consulter">
               ...
               <rest:headers>
                  <rest:header name="Accept"><rest:constant>application/xml</rest:constant><rest:header>
                  <rest:header name="X-lol"><rest:xpath>/metadatas/metadata</rest:xpath><rest:header>
                  <!-- Following value extractor will be implemented later if such use-case exists -->
                  <!-- <rest:header name="dummy"><rest:jbi-header>machin</rest:jbi-header><header> -->
               <rest:headers>
               ...
            </rest:operation>
            ...
         </rest:mapping>
      </jbi:consumes>
   </jbi:services>
</jbi:jbi>
{code}

Two different value extractors will be implemented in a first time:
* {{<rest:constant />}}: The given value is the value to use, as a constant,
* {{<rest:xpath />}}: The value is extracted using the given XPath expression applied on the incoming XML payload.

In the current version and previous, HTTP headers put in the HTTP request sent to the REST server are extracted from properties of the incoming JBI message. This has no sens, all technical information required to invoke a resource should be defined in SU.

So, we propose to rework how HTTP headers are configured. They should be configured at SU level as:
{code:xml}
<jbi:jbi ...>
   <jbi:services ...>
      <jbi:provides ...>
         ...
         <rest:mapping>
            ...
            <rest:operation name="ged:consulter">
               ...
               <rest:headers>
                  <rest:header name="Accept">
                     <rest:constant>application/xml</rest:constant>
                  <rest:header>
                  <rest:header name="X-lol">
                     <rest:xpath>/metadatas/metadata</rest:xpath>
                  <rest:header>
                  <!-- Following value extractor will be implemented later if such use-case exists -->
                  <!-- <rest:header name="dummy">
                          <rest:jbi-header>machin</rest:jbi-header>
                       <header> -->
               <rest:headers>
               ...
            </rest:operation>
            ...
         </rest:mapping>
      </jbi:consumes>
   </jbi:services>
</jbi:jbi>
{code}

Two different value extractors will be implemented in a first time:
* {{<rest:constant />}}: The given value is the value to use, as a constant,
* {{<rest:xpath />}}: The value is extracted using the given XPath expression applied on the incoming XML payload.

Christophe DENEUX made changes - Thu, 19 Jan 2017 - 18:29:44 +0100
Status In Progress [ 10003 ] Resolved [ 10004 ]
Resolution Fixed [ 1 ]
Hide
Christophe DENEUX added a comment - Thu, 19 Jan 2017 - 18:29:44 +0100

Reworked in trunk

Show
Christophe DENEUX added a comment - Thu, 19 Jan 2017 - 18:29:44 +0100 Reworked in trunk
Christophe DENEUX made changes - Thu, 19 Jan 2017 - 18:29:33 +0100
Status Open [ 10002 ] In Progress [ 10003 ]
Christophe DENEUX made changes - Thu, 19 Jan 2017 - 18:29:30 +0100
Status New [ 10000 ] Open [ 10002 ]
Christophe DENEUX made changes - Thu, 19 Jan 2017 - 15:13:46 +0100
Description In the current version and previous, HTTP headers put in the HTTP request sent to the REST server are extracted from properties of the incoming JBI message. This has no sens, all technical information required to invoke a resource should be defined in SU.

So, we propose to rework how HTTP headers are configured. They should be configured at SU level as:
{code:xml}
<jbi:jbi ...>
   <jbi:services ...>
      <jbi:provides ...>
         ...
         <rest:mapping>
            ...
            <rest:operation name="ged:consulter">
               ...
               <rest:headers>
                  <rest:header name="Accept"><rest:constant>application/xml</rest:constant><rest:header>
                  <!-- Following value extractor will be implemented later if such use-case exists -->
                  <!-- <rest:header name="X-lol"><rest:xpath>/metadatas/metadata</rest:xpath><rest:header> -->
                  <!-- <rest:header name="dummy"><rest:jbi-header>machin</rest:jbi-header><header> -->
               <rest:headers>
               ...
            </rest:operation>
            ...
         </rest:mapping>
      </jbi:consumes>
   </jbi:services>
</jbi:jbi>
{code}

Only the value extractor '<constant />' will be implemented in a first time.

In the current version and previous, HTTP headers put in the HTTP request sent to the REST server are extracted from properties of the incoming JBI message. This has no sens, all technical information required to invoke a resource should be defined in SU.

So, we propose to rework how HTTP headers are configured. They should be configured at SU level as:
{code:xml}
<jbi:jbi ...>
   <jbi:services ...>
      <jbi:provides ...>
         ...
         <rest:mapping>
            ...
            <rest:operation name="ged:consulter">
               ...
               <rest:headers>
                  <rest:header name="Accept"><rest:constant>application/xml</rest:constant><rest:header>
                  <rest:header name="X-lol"><rest:xpath>/metadatas/metadata</rest:xpath><rest:header>
                  <!-- Following value extractor will be implemented later if such use-case exists -->
                  <!-- <rest:header name="dummy"><rest:jbi-header>machin</rest:jbi-header><header> -->
               <rest:headers>
               ...
            </rest:operation>
            ...
         </rest:mapping>
      </jbi:consumes>
   </jbi:services>
</jbi:jbi>
{code}

Two different value extractors will be implemented in a first time:
* {{<rest:constant />}}: The given value is the value to use, as a constant,
* {{<rest:xpath />}}: The value is extracted using the given XPath expression applied on the incoming XML payload.

Christophe DENEUX made changes - Thu, 19 Jan 2017 - 15:10:24 +0100
Field Original Value New Value
Fix Version/s 1.1.0 [ 10696 ]
Priority Major [ 3 ]
Description In the current version and previous, HTTP headers put in the HTTP request sent to the REST server are extracted from properties of the incoming JBI message. This has no sens, all technical information required to invoke a resource should be defined in SU.

So, we propose to rework how HTTP headers are configured. They should be configured at SU level as:
{code:xml}
<jbi:jbi ...>
   <jbi:services ...>
      <jbi:provides ...>
         ...
         <rest:mapping>
            ...
            <rest:operation name="ged:consulter">
               ...
               <rest:headers>
                  <rest:header name="Accept"><rest:constant>application/xml</rest:constant><rest:header>
                  <!--
                     Following value extractor will be implemented later
                  <rest:header name="X-lol"><rest:xpath>/metadatas/metadata</rest:xpath><rest:header>
                  <rest:header name="dummy"><rest:jbi-header>machin</rest:jbi-header><header>
                  -->
               <rest:headers>
               ...
            </rest:operation>
            ...
         </rest:mapping>
      </jbi:consumes>
   </jbi:services>
</jbi:jbi>
{code}

Only the value extractor '<constant />' will be implemented in a first time.

In the current version and previous, HTTP headers put in the HTTP request sent to the REST server are extracted from properties of the incoming JBI message. This has no sens, all technical information required to invoke a resource should be defined in SU.

So, we propose to rework how HTTP headers are configured. They should be configured at SU level as:
{code:xml}
<jbi:jbi ...>
   <jbi:services ...>
      <jbi:provides ...>
         ...
         <rest:mapping>
            ...
            <rest:operation name="ged:consulter">
               ...
               <rest:headers>
                  <rest:header name="Accept"><rest:constant>application/xml</rest:constant><rest:header>
                  <!-- Following value extractor will be implemented later if such use-case exists -->
                  <!-- <rest:header name="X-lol"><rest:xpath>/metadatas/metadata</rest:xpath><rest:header> -->
                  <!-- <rest:header name="dummy"><rest:jbi-header>machin</rest:jbi-header><header> -->
               <rest:headers>
               ...
            </rest:operation>
            ...
         </rest:mapping>
      </jbi:consumes>
   </jbi:services>
</jbi:jbi>
{code}

Only the value extractor '<constant />' will be implemented in a first time.

People

Dates

  • Created:
    Thu, 19 Jan 2017 - 15:09:19 +0100
    Updated:
    Tue, 24 Jan 2017 - 11:53:42 +0100
    Resolved:
    Thu, 19 Jan 2017 - 18:29:44 +0100