Coder Social home page Coder Social logo

nordic-institute / misp2 Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 3.0 20.67 MB

MISP2 is a web application that provides an easy way to query data over X-Road.

License: MIT License

Shell 4.12% HTML 4.58% XProc 0.69% XSLT 6.81% JavaScript 12.78% CSS 2.06% Dockerfile 0.02% Makefile 0.08% Java 68.42% FreeMarker 0.45%

misp2's People

Contributors

petkivim avatar raigolinna avatar raits avatar teemukin65 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

misp2's Issues

Error during 'xtee-misp2-postgresql' upgrade 2.6.3 -> 2.6.4

Upgrade of the package xtee-misp2-postgresql from 2.6.3 to 2.6.4 ends with an error:

Setting up xtee-misp2-postgresql (2.6.4) ...
You have package shema version  2.6.4
PostgreSQL service is running.
Using DB connection parameters from configuration file /var/lib/tomcat8/webapps/misp2/WEB-INF/classes/config.cfg.
Allowing 'postgres' user locally trusted access.
true
Creating database 'misp2db'
createdb: database creation failed: ERROR:  database "misp2db" already exists
Cannot create database 'misp2db'
You can try to create "misp2db" by yourself: 
/usr/lib/postgresql/10/bin/createdb  -p 5432 misp2db -U postgres -E UNICODE
dpkg: error processing package xtee-misp2-postgresql (--configure):
 installed xtee-misp2-postgresql package post-installation script subprocess returned error exit status 1

OS: Ubuntu 18.04.6 LTS

Misp2 looses all query parameters of a REST service while proxying requests

I have a REST service and I try to call it using the latest MISP2 (I'm using the Docker version found in docker-dev).
My OpenAPI based service has defined some optional query paramters like this:

        - in: query
          name: myParam
          description: myParam
          required: false
          schema:
            type: string

I have generated a form in Misp2 and I can fill in the value of "myParam"
However when I submit the form all the values (that had in:query in the yaml) are lost by MISP2.

It seems this code lacks copying over the query params:
https://github.com/nordic-institute/misp2/blob/develop/web-app/src/main/java/ee/aktors/misp2/action/RestMediatorAction.java#L235-L289

How to test:

  1. import this OpenAPI yaml into Misp2 and generate forms
    https://x-tee.ee/catalogue-data/ee-dev/ee-dev/COM/11333578/rest-service-01/petstore_1.yaml
  2. Open the service "Get pets from store"

As you can see from the yaml it has a query parameter "name":

paths:
  /pets:
    get:
      tags:
        - pet
      summary: Get pets from store
      description: Search pets
      operationId: getPets
      parameters:
        - name: name
          in: query
          description: Pet name search
          required: false
          schema:
            type: string
  1. When you fill in the form and set name to value "doggy" and submit you will notice that MISP2 hits URL "/pets" (without any query parameters) but it should try to open "/pets?name=doggy"

REST service with optional parameter -> misp2 doesn't generate an additional empty option tag for select-box

I have a REST search service with optional header parameter of type enum:

        - in: header
          name: personType
          description: Filter by person type
          required: false
          schema:
            type: string
            enum: [INDIVIDUAL, LEGAL_ENTITY]

MISP2 generates the following SELECTbox out of this:

 <div class="field">
   <label>Filter by person type</label>
   <select name="personType" data-rf-param-location="header">
      <option value="INDIVIDUAL">INDIVIDUAL</option>
      <option value="LEGAL_ENTITY">LEGAL_ENTITY</option>
   </select>
 </div>

But Misp2 doesn't add empty option to the front (for the case if I don't want to specify anything).

The required behaviour would be that since the element is declared as required=false there should be an additional option tag in the front:

<div class="field">
    <label>Filter by person type</label>
    <select name="personType" data-rf-param-location="header">
      <option value="">--</option>
      <option value="INDIVIDUAL">INDIVIDUAL</option>
      <option value="LEGAL_ENTITY">LEGAL_ENTITY</option>
   </select>
 </div>

REST service date-time parameters don't work (time is not sent out and date is in wrong format)

I have a REST web service with date-time header parameter:

        - in: header
          name: If-Modified-Since
          schema:
            type: string
            format: date-time
            example: 2022-10-18T17:32:28+02:00
          required: false

MISP2 UI renders a nice datepicker and a checkbox to enter time:
misp2-date-time-rendered

I set date to "14.11.2022" and time to "16:52" submit the form this what is show in the logs:

This is what is logged and sent out to the service:

Headers :
if-modified-since: 11/14/2022

Expected behaviour would be that date would be in correct format (yyyy-mm-dd) and time would be appended to it like this:

Headers :
if-modified-since: 2022-11-14T16:52:00+02:00

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.