{
  "openapi": "3.0.4",
  "info": {
    "title": "Servizio gateway PDND",
    "description": "Servizio di supporto alle chiamate e-service PDND",
    "termsOfService": "https://www.starch.it/terms/",
    "contact": {
      "name": "Starch s.r.l.",
      "email": "info@starch.it"
    },
    "version": "1.0.0",
    "x-summary": "Servizio gateway PDND",
    "x-api-id": null
  },
  "servers": [
    {
      "url": "https://pdndgateway.services.starch.it:443",
      "description": "Server 1"
    },
    {
      "url": "https://starchpdndgateway-csdua7eadjasajf3.westeurope-01.azurewebsites.net:443",
      "description": "Server 2"
    }
  ],
  "paths": {
    "/gateway/service-headers/{CodInstitution}/{Environment}/{ServiceName}/{EntryPointName}": {
      "get": {
        "tags": [
          "Gateway"
        ],
        "summary": "Restituisce gli headers HTTP da fornire ad una richiesta ad un entry-point e-service Pdnd.",
        "description": "Headers HTTP per una richiesta entry-point e-service Pdnd",
        "operationId": "GetPdndHeaders-CodInstitution-ServiceName-EntryPointName-Environment",
        "parameters": [
          {
            "name": "CodInstitution",
            "in": "path",
            "description": "Codice ente (codice catastale o codice IPA), come presente nel database configurazione",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ServiceName",
            "in": "path",
            "description": "Nome dell'e-service Pdnd",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "EntryPointName",
            "in": "path",
            "description": "Nome dell'entry-point e-service Pdnd",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Environment",
            "in": "path",
            "description": "Ambiente Pdnd: produzione o collaudo\n\n1 = Testing\n\n2 = Production",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/EEnvironment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati con headers entry-point e-service Pdnd",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdndRequestData"
                }
              }
            }
          },
          "404": {
            "description": "e-service o entry-point non presente nella configurazione"
          },
          "400": {
            "description": "Il security pattern dell-entry point richiede i dati della richiesta Pdnd: eseguire il metodo POST"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "apikey-auth": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Gateway"
        ],
        "summary": "Restituisce gli headers HTTP da fornire ad una richiesta ad un entry-point e-service Pdnd.\r\nDa utilizzare in caso il security pattern Modi richieda dati di sicurezza aggiuntivi, come il body della richiesta.",
        "description": "Restituisce gli headers HTTP per una richiesta entry-point e-service Pdnd",
        "operationId": "GetPdndSecurityHeaders-CodInstitution-ServiceName-EntryPointName-Environment",
        "parameters": [
          {
            "name": "CodInstitution",
            "in": "path",
            "description": "Codice ente (codice catastale o codice IPA), come presente nel database configurazione",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ServiceName",
            "in": "path",
            "description": "Nome dell'e-service Pdnd",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "EntryPointName",
            "in": "path",
            "description": "Nome dell'entry-point e-service Pdnd",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Environment",
            "in": "path",
            "description": "Ambiente Pdnd: produzione o collaudo\n\n1 = Testing\n\n2 = Production",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/EEnvironment"
            }
          }
        ],
        "requestBody": {
          "description": "Dati richiesti per l'accesso ad un entry-point di un e-service Pdnd.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdndRequestPatternData"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PdndRequestPatternData"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdndRequestPatternData"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dati con headers entry-point e-service Pdnd",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdndRequestData"
                }
              }
            }
          },
          "404": {
            "description": "e-service o entry-point non presente nella configurazione"
          },
          "400": {
            "description": "Non sono stati specificati i dati della richiesta, necessari per soddisfare il security pattern Modi"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "apikey-auth": [ ]
          }
        ]
      }
    },
    "/gateway/service-response-headers/{CodInstitution}/{Environment}/{ServiceName}/{EntryPointName}": {
      "get": {
        "tags": [
          "Gateway"
        ],
        "summary": "Restituisce gli headers HTTP per una risposta e-service Pdnd",
        "description": "Restituisce gli headers HTTP per una risposta e-service Pdnd",
        "operationId": "GetPdndResponseSecurityHeaders-CodInstitution-ServiceName-EntryPointName-Environment",
        "parameters": [
          {
            "name": "CodInstitution",
            "in": "path",
            "description": "Codice ente (codice catastale o codice IPA), come presente nel database configurazione",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ServiceName",
            "in": "path",
            "description": "Nome dell'e-service Pdnd",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "EntryPointName",
            "in": "path",
            "description": "Nome dell'entry-point e-service Pdnd",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Environment",
            "in": "path",
            "description": "Ambiente Pdnd: produzione o collaudo\n\n1 = Testing\n\n2 = Production",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/EEnvironment"
            }
          },
          {
            "name": "X-PdndGateway-SHA256",
            "in": "header",
            "description": "Hash SHA-256 della risposta codificato base64",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati con headers risposta e-service Pdnd",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdndResponseData"
                }
              }
            }
          },
          "404": {
            "description": "e-service o entry-point non presente nella configurazione"
          },
          "400": {
            "description": "Non sono stati specificati alcuni dati necessari per soddisfare il security pattern"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "apikey-auth": [ ]
          }
        ]
      }
    },
    "/gateway/validate-service-request/{CodInstitution}/{Environment}/{ServiceName}/{EntryPointName}": {
      "post": {
        "tags": [
          "Gateway"
        ],
        "summary": "Effettua la validazione dei pattern di sicurezza Pdnd per entry-point di un e-service Pdnd!!",
        "description": "Restituisce i dati dell'entry-point e-service chiamato e i risultati della validazione dei pattern di sicurezza Pdnd<br/><b>Devono essere inclusi tutti gli header della richiesta originale oggetto di validazione</b>",
        "operationId": "ValidatePdndRequest-CodInstitution-ServiceName-EntryPointName-Environment",
        "parameters": [
          {
            "name": "CodInstitution",
            "in": "path",
            "description": "Codice ente (codice catastale o codice IPA), come presente nel database configurazione",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ServiceName",
            "in": "path",
            "description": "Nome dell'e-service Pdnd",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "EntryPointName",
            "in": "path",
            "description": "Nome dell'entry-point e-service Pdnd",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Environment",
            "in": "path",
            "description": "Ambiente Pdnd: produzione o collaudo\n\n1 = Testing\n\n2 = Production",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/EEnvironment"
            }
          },
          {
            "name": "X-PdndGateway-SHA256",
            "in": "header",
            "description": "Hash body della richiesta",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati con informazioni entry-point e-service e risultato validazione Pdnd.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdndValidationData"
                }
              }
            }
          },
          "404": {
            "description": "e-service o entry-point non presente nella configurazione"
          },
          "400": {
            "description": "Dati errati o non completi nella configurazione o nella richiesta che non consentono di effettuare la validazione"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "apikey-auth": [ ]
          }
        ]
      }
    },
    "/status": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Restituisce lo stato di salute dell'API",
        "description": "Fornisce un'indicazione sullo stato di salute dell'API",
        "operationId": "Health_Get",
        "responses": {
          "200": {
            "description": "API funzionante",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "API non funzionante o in stato degradato",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EEnvironment": {
        "enum": [
          1,
          2
        ],
        "type": "integer",
        "description": "Anmbiente PDND Interoperabilità\n\n1 = Testing\n\n2 = Production",
        "format": "int32",
        "x-enumNames": [
          "Testing",
          "Production"
        ]
      },
      "PdndEServiceIdentifiers": {
        "type": "object",
        "properties": {
          "EserviceId": {
            "type": "string",
            "description": "Identificativo unico dell'e-service",
            "nullable": true
          },
          "DescriptorId": {
            "type": "string",
            "description": "Identificativo della versione dell’e-service",
            "nullable": true
          },
          "ProducerId": {
            "type": "string",
            "description": "Identificativo unico dell’amministrazione erogatrice per ciascun ambiente",
            "nullable": true
          },
          "ConsumerId": {
            "type": "string",
            "description": "Identificativo unico dell’amministrazione fruitrice per ciascun ambiente",
            "nullable": true
          },
          "PurposeId": {
            "type": "string",
            "description": "Identificativo unico della finalità per la quale è rilasciato il voucher",
            "nullable": true
          },
          "ClientId": {
            "type": "string",
            "description": "Identificativo unico del client utilizzato dal fruitore",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Dati identificativi di una richiesta e-service Pdnd"
      },
      "PdndRequestData": {
        "type": "object",
        "properties": {
          "EServiceName": {
            "type": "string",
            "description": "Nome e-service",
            "nullable": true
          },
          "EntryPointName": {
            "type": "string",
            "description": "Nome entry-point",
            "nullable": true
          },
          "SecurityPatterns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Lista dei pattern di sicurezza Modi richiesti dall'entry-point",
            "nullable": true
          },
          "Url": {
            "type": "string",
            "description": "Url compleno per la richiesta HTTP",
            "nullable": true
          },
          "Headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Dizionario headers da includere nella richiesta HTTP",
            "nullable": true
          },
          "ExpirationUtc": {
            "type": "string",
            "description": "Data scadenza headers (UTC)",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Dati dell'entry-point e-service Pdnd, comprensivi degli header da includere nella richiesta."
      },
      "PdndRequestPatternData": {
        "type": "object",
        "properties": {
          "RequestBody": {
            "type": "string",
            "description": "Body della richiesta",
            "nullable": true
          },
          "IsSHA256": {
            "type": "boolean",
            "description": "Indica il significato del contenuto della proprietà StarchPdndGateway.Models.Bindings.PdndRequestPatternData.RequestBody<list><dl><item><term><dt>true</dt></term><description><dd>RequestBody contiene l'hash SHA256 codificato base64 del body della richiesta</dd></description></item><item><term><dt>false</dt></term><description><dd>RequestBody contiene la stringa body della richiesta</dd></description></item></dl></list>"
          },
          "ProtectedHeaders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestHeader"
            },
            "description": "Lista opzionale di header da proteggere,",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Dati richiesti per l'accesso ad un entry-point di un e-service Pdnd."
      },
      "PdndResponseData": {
        "type": "object",
        "properties": {
          "EServiceName": {
            "type": "string",
            "description": "Nome e-service",
            "nullable": true
          },
          "EntryPointName": {
            "type": "string",
            "description": "Nome entry-point",
            "nullable": true
          },
          "ResponseSecurityPatterns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Lista dei pattern di sicurezza risposta richiesti dall'entry-point",
            "nullable": true
          },
          "Headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Dizionario headers da includere nella risposta HTTP",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Dati dell'entry-point e-service Pdnd, comprensivi degli header da includere nella risposta."
      },
      "PdndValidationData": {
        "type": "object",
        "properties": {
          "EServiceName": {
            "type": "string",
            "description": "Nome dell'e-service",
            "nullable": true
          },
          "EntryPointName": {
            "type": "string",
            "description": "Nome dell'entry-point",
            "nullable": true
          },
          "SecurityPatterns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Pattern di sicurezza dell'entry-point",
            "nullable": true
          },
          "ResponseSecurityPatterns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Pattern di sicurezza della risposta dell'entry-point",
            "nullable": true
          },
          "IsValid": {
            "type": "boolean",
            "description": "Indica se la richiesta è valida"
          },
          "ValidationErrors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PdndValidationErrorTypeStringKeyValuePair"
            },
            "description": "Eventuali errori di validazione in caso di richiesta non valida",
            "nullable": true
          },
          "EServiceIdentifiers": {
            "$ref": "#/components/schemas/PdndEServiceIdentifiers"
          }
        },
        "additionalProperties": false,
        "description": "Dati del risultato validazione di un entry-point e-service Pdnd"
      },
      "PdndValidationErrorType": {
        "type": "object",
        "properties": {
          "Code": {
            "type": "integer",
            "description": "Codice tipo errore",
            "format": "int32"
          },
          "Type": {
            "type": "string",
            "description": "Tipo errore",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Tipo errore di validazione Pdnd"
      },
      "PdndValidationErrorTypeStringKeyValuePair": {
        "type": "object",
        "properties": {
          "Key": {
            "$ref": "#/components/schemas/PdndValidationErrorType"
          },
          "Value": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "RequestHeader": {
        "type": "object",
        "properties": {
          "Name": {
            "type": "string",
            "description": "Nome dell'header Http",
            "nullable": true
          },
          "Value": {
            "type": "string",
            "description": "Valore dell'header Http",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Headers Http richiesti dal pattern di sicurezza dell'entry-point."
      }
    },
    "securitySchemes": {
      "apikey-auth": {
        "type": "apiKey",
        "description": "Chiave API nell'header HTTP",
        "name": "X-Api-Key",
        "in": "header"
      }
    }
  },
  "tags": [
    {
      "name": "Status",
      "description": "Stato API"
    }
  ]
}