Commit 6a420bb3 authored by YannGarcia's avatar YannGarcia
Browse files

Merge branch 'STF525' of https://forge.etsi.org/gitlab/LIBS/LibIts into STF525

parents 627c46dc 404635f4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -65,6 +65,8 @@ module LibItsHttp_Functions {
        p_headers[v_i] := { c_header_pragma, { "no-cache" } };
        v_i := v_i + 1;
        p_headers[v_i] := { c_header_cache_control, { "no-cache" } };
        v_i := v_i + 1;
        p_headers[v_i] := { c_header_authorization, { "Basic YWxhZGRpbjpvcGVuc2VzYW1l" } };
        //v_i := v_i + 1;
        //p_headers[v_i] := { c_header_accept, { "application/x-its-response" } };
      } // End of function f_init_default_headers_list
+53 −18
Original line number Diff line number Diff line
@@ -73,30 +73,49 @@ module LibItsHttp_Templates {
          body          := p_body
        } // End of template m_http_request_get
        
        template (omit) Request m_http_request_post(
                                                    in charstring p_uri, 
                                                    in template (value) HeaderLines p_headers,
                                                    in template (omit) HttpMessageBody p_body := omit
        template Request mw_http_request_get(
                                             template (present) charstring p_uri := ?, 
                                             template (present) HeaderLines p_headers := ?,
                                             template HttpMessageBody p_body := *
        ) := {
          method        := "POST",
          method        := "GET",
          uri           := p_uri,
          version_major := c_http_version_major,
          version_minor := c_http_version_minor,
          header        := p_headers,
          body          := p_body
        } // End of template mw_http_request_get
        
        template (omit) Request m_http_request_post(
                                                    in charstring p_uri, 
                                                    in template (value) HeaderLines p_headers,
                                                    in template (omit) HttpMessageBody p_body := omit
        ) modifies m_http_request_get := {
          method        := "POST"
        } // End of template m_http_request_post
        
        template Request mw_http_request_post(
                                              template (present) charstring p_uri := ?, 
                                              template (present) HeaderLines p_headers := ?,
                                              template HttpMessageBody p_body := *
        ) := {
          method        := "POST",
          uri           := p_uri,
          version_major := c_http_version_major,
          version_minor := c_http_version_minor,
          header        := p_headers,
          body          := p_body
        ) modifies mw_http_request_get := {
          method        := "POST"
        } // End of template mw_http_request_post
        
        template (omit) Request m_http_request_delete(
                                                      in charstring p_uri, 
                                                      in template (value) HeaderLines p_headers,
                                                      in template (omit) HttpMessageBody p_body := omit
        ) modifies m_http_request_get := {
          method        := "DELETE"
        } // End of template m_http_request_delete
        
        template Request mw_http_request_delete(
                                                template (present) charstring p_uri := ?, 
                                                template (present) HeaderLines p_headers := ?,
                                                template HttpMessageBody p_body := *
        ) modifies mw_http_request_get := {
          method        := "DELETE"
        } // End of template mw_http_request_post
        
    } // End of group http_requests
@@ -122,7 +141,7 @@ module LibItsHttp_Templates {
          version_major := 1,
          version_minor := 1,
          statuscode    := 200,
          statustext    := ?,//"OK",
          statustext    := "OK",
          header        := p_header,
          body          := p_body
      } // End of template mw_http_response_ok
@@ -132,7 +151,15 @@ module LibItsHttp_Templates {
                                                               template (present) HeaderLines p_header := ?
      ) modifies mw_http_response_ok := {
          statuscode    := 201,
          statustext    := ?//"Created",
          statustext    := "Created"
      } // End of template mw_http_response_ok
      
      template (present) Response mw_http_response_204_no_content(
                                                                   template (present) HttpMessageBody p_body := ?,
                                                                   template (present) HeaderLines p_header := ?
      ) modifies mw_http_response_ok := {
          statuscode    := 204,
          statustext    := "No Content"
      } // End of template mw_http_response_ok
      
      template (value) Response m_http_response_ko(
@@ -179,7 +206,7 @@ module LibItsHttp_Templates {
                                                         template (present) HeaderLines p_header := ?
      ) modifies mw_http_response_ko := {
          statuscode    := 400,
          statustext    := ? // TODO Add pattern for not found
          statustext    := "Bad Request"
      } // End of template mw_http_response_400_bad_request
      
      template Response mw_http_response_403_forbidden(
@@ -187,17 +214,25 @@ module LibItsHttp_Templates {
                                                       template (present) HeaderLines p_header := ?
      ) modifies mw_http_response_ko := {
          statuscode    := 403,
          statustext    := ? // TODO Add pattern for not found
      } // End of template mw_http_response_404_not_found
          statustext    := "Forbidden"
      } // End of template mw_http_response_403_forbidden
      
      template Response mw_http_response_404_not_found(
                                                       template HttpMessageBody p_body  := *,
                                                       template (present) HeaderLines p_header := ?
      ) modifies mw_http_response_ko := {
          statuscode    := 404,
          statustext    := ? // TODO Add pattern for not found
          statustext    := "Not Found"
      } // End of template mw_http_response_404_not_found
      
      template Response mw_http_response_412_precondition_failed(
                                                                 template HttpMessageBody p_body  := *,
                                                                 template (present) HeaderLines p_header := ?
      ) modifies mw_http_response_ko := {
          statuscode    := 412,
          statustext    := "Precondition Failed"
      } // End of template mw_http_response_412_not_found
      
    } // End of group http_responses
    
    group http_xml_body {
+17 −16
Original line number Diff line number Diff line
@@ -1574,7 +1574,8 @@ module LibItsPki_Functions {
                                                     m_publicKeys(
                                                                  m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point)
                                                                  ),
                                                     m_certificateSubjectAttributes(
                                                     m_certificateSubjectAttributes_id_name(
                                                                                            oct2char(PICS_ITS_S_CANONICAL_ID),
                                                                                            { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs
                                                                                              valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := '01C0'O }))
                                                                                              },
+23 −8
Original line number Diff line number Diff line
@@ -258,7 +258,7 @@ module LibItsPki_Templates {
  encryptionKey   := p_encryptionKey
  } // End of template mw_publicKeys
  
  template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes(
  template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_none(
                                                                                      in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                                      in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                                      in template (omit) GeographicRegion p_region := omit,
@@ -270,7 +270,22 @@ module LibItsPki_Templates {
  assuranceLevel       := p_assuranceLevel,
  appPermissions       := p_appPermissions,
  certIssuePermissions := omit
  } // End of template m_certificateSubjectAttributes
  } // End of template m_certificateSubjectAttributes_id_none
  
  template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_name(
                                                                                      in template (value) Hostname p_name,
                                                                                      in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                                      in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                                      in template (omit) GeographicRegion p_region := omit,
                                                                                      in template (omit) SubjectAssurance p_assuranceLevel := omit
                                                                                      ) := {
  id                   := { name := p_name },
  validityPeriod       := p_validityPeriod,
  region               := p_region,
  assuranceLevel       := p_assuranceLevel,
  appPermissions       := p_appPermissions,
  certIssuePermissions := omit
  } // End of template m_certificateSubjectAttributes_id_name
  
  template (value) InnerEcResponse m_innerEcResponse_ok(
                                                        in template (value) Oct16 p_requestHash,