Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduction to SdI #26

Merged
merged 12 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Pull Request Summary

<!-- Briefly describe the problem you are solving. -->

## Feedback

<!-- You can describe your doubts, thoughts and questions. -->
Binary file added docs/sdi/SDICoop_ricezione_v3.0_EN.pdf
Binary file not shown.
Binary file added docs/sdi/SDICoop_trasmissione_v3.0_EN.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions sdi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SdI (Sistema di Interscambio)

## SDICoop Web Service

### Test

- [Test URI](https://testservizi.fatturapa.it/)

### Production

- [Production URI](https://fatturapa.it/)

## Links

- [Manage the channel](https://sdi.fatturapa.gov.it/SdI2FatturaPAWebSpa/GestireCanaleAction.do)
32 changes: 32 additions & 0 deletions sdi/cert/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Certificates

[Source link](https://www.fatturapa.gov.it/it/norme-e-regole/DocumentazioneSDI/)

## Test Certificates

Contents of the `test` folder:

- `testservizi.fatturapa.it.cer`: SERVER certificate exposed by
the test services of SdI (Sistema di Interscambio)
- `SistemaInterscambioFatturaPATest.cer`: Public part of the CLIENT certificate
used by SdI (Sistema di Interscambio) to invoke the test services exposed by you

## Production Certificates

Contents of the `production` folder:

- `servizi.fatturapa.it.cer`: SERVER certificate exposed by
the services of SdI (Sistema di Interscambio)
- `Sistema_Interscambio_Fattura_PA.cer`: Public part of the CLIENT certificate
used by SdI (Sistema di Interscambio) to invoke the services exposed by you

## CA Certificates

Contents of the `ca` folder:

- `caentrate.cer`: CA certificate for the production environment
- `CAEntratetest.cer`: CA certificate to validate the test SdI certificate
- `Sectigo RSA.cer`: CA certificate for servizi.fatturapa.it.cer
for the production environment
- `UserTrustCA.cer`: CA certificate for servizi.fatturapa.it.cer
for the production environment
28 changes: 28 additions & 0 deletions sdi/cert/ca/CAEntratetest.cer
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN CERTIFICATE-----
MIIFjzCCA3egAwIBAgIIFfaA/TILEDQwDQYJKoZIhvcNAQELBQAwVTELMAkGA1UEBhMCSVQxHjAc
BgNVBAoMFUFnZW56aWEgZGVsbGUgRW50cmF0ZTEmMCQGA1UEAwwdQ0EgQWdlbnppYSBkZWxsZSBF
bnRyYXRlIFRlc3QwHhcNMTgwNjIyMTY0MjUyWhcNMzgwNjE3MTY0MjUyWjBVMQswCQYDVQQGEwJJ
VDEeMBwGA1UECgwVQWdlbnppYSBkZWxsZSBFbnRyYXRlMSYwJAYDVQQDDB1DQSBBZ2VuemlhIGRl
bGxlIEVudHJhdGUgVGVzdDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAO4aQWAatVDc
eUIys5AX0+nlY9wUz87E18hhH29/DfCZmgS4q1hnq61MfG4S4V0CJk3yhy5ojP7JLahQWckfiOaR
XEYu8DbQ+gZQGgGJ1AoU8pHmevGnqHgBCqolPo/t482IfbBK0M6K6KrSHECTpCpVT550OAe9uH1a
zj+bOLDRm91Ud0wr1IHEHFZVIAAA9a+R+MIF2ptJ3WKnZsXoLUqhL8V17v4H4cSQSwZrB6DyPraK
km26jLu51kfSwHRhhrGfjWwhJ0flHVE+iu0xMM78xLwUw/qmRG9oSdrWctwHNn+eF6TuLZtZbSsQ
HhiU5lhZIM8IH47+GGCt9uz/WhYxwWJBK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lGuIewKarSXhh07qhqKGb45xo5CNrd2+VlA8g9+OOtWma+oLOiI1aF0oUr0QLT
WbOm55AU9pR821EQH3zQjujgZVOAnqYQj/Z77c1xXezWwKYNrcuFAP1KQhB8y6wgPSAvZYJ/pDuW
R+Y=
-----END CERTIFICATE-----
33 changes: 33 additions & 0 deletions sdi/cert/ca/Sectigo RSA.cer
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
MIIGGTCCBAGgAwIBAgIQE31TnKp8MamkM3AZaIR6jTANBgkqhkiG9w0BAQwFADCB
iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV
BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTgx
MTAyMDAwMDAwWhcNMzAxMjMxMjM1OTU5WjCBlTELMAkGA1UEBhMCR0IxGzAZBgNV
BAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEYMBYGA1UE
ChMPU2VjdGlnbyBMaW1pdGVkMT0wOwYDVQQDEzRTZWN0aWdvIFJTQSBPcmdhbml6
YXRpb24gVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENBMIIBIjANBgkqhkiG9w0B
AQEFAAOCAQ8AMIIBCgKCAQEAnJMCRkVKUkiS/FeN+S3qU76zLNXYqKXsW2kDwB0Q
9lkz3v4HSKjojHpnSvH1jcM3ZtAykffEnQRgxLVK4oOLp64m1F06XvjRFnG7ir1x
on3IzqJgJLBSoDpFUd54k2xiYPHkVpy3O/c8Vdjf1XoxfDV/ElFw4Sy+BKzL+k/h
fGVqwECn2XylY4QZ4ffK76q06Fha2ZnjJt+OErK43DOyNtoUHZZYQkBuCyKFHFEi
rsTIBkVtkuZntxkj5Ng2a4XQf8dS48+wdQHgibSov4o2TqP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AhblhHrrhFYBZlAyuBbuMf1a+HNJav5fyakywxnB2sJCNwQs2uRHY1ihc
6k/+JLcYCpsM0MF8XPtpvcyiTcaQvKZN8rG61ppnW5YCUtCC+cQKXA0o4D/I+pWV
idWkvklsQLI+qGu41SWyxP7x09fn1txDAXYw+zuLXfdKiXyaNb78yvBXAfCNP6CH
MntHWpdLgtJmwsQt6j8k9Kf5qLnjatkYYaA7jBU=
30 changes: 30 additions & 0 deletions sdi/cert/ca/UserTrustCA.cer
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
MIIFgTCCBGmgAwIBAgIQOXJEOvkit1HX02wQ3TE1lTANBgkqhkiG9w0BAQwFADB7
MQswCQYDVQQGEwJHQjEbMBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYD
VQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UE
AwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTE5MDMxMjAwMDAwMFoXDTI4
MTIzMTIzNTk1OVowgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5
MRQwEgYDVQQHEwtKZXJzZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBO
ZXR3b3JrMS4wLAYDVQQDEyVVU0VSVHJ1c3QgUlNBIENlcnRpZmljYXRpb24gQXV0
aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAgBJlFzYOw9sI
s9CsVw127c0n00ytUINh4qogTQktZAnczomfzD2p7PbPwdzx07HWezcoEStH2jnG
vDoZtF+mvX2do2NCtnbyqTsrkfjib9DsFiCQCT7i6HTJGLSR1GJk23+jBvGIGGqQ
Ijy8/hPwhxR79uQfjtTkUcYRZ0YIUcuGFFQ/vDP+fmyc/xadGL1RjjWmp2bIcmfb
IWax1Jt4A8BQOujM8Ny8nkz+rwWWNR9XWrf/zvk9tyy29lTdyO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WTz9RvdVFGD/tSo7oBmF0Ixa1DVBzJ0RHfxBdiSprhTEUxOipakyA
vGp4z7h/jnZymQyd/teRCBaho1+V
32 changes: 32 additions & 0 deletions sdi/cert/ca/caentrate.cer
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-----BEGIN CERTIFICATE-----
MIIFhTCCA22gAwIBAgIIIPo5CUs8HzowDQYJKoZIhvcNAQELBQAwUDELMAkGA1UE
BhMCSVQxHjAcBgNVBAoMFUFnZW56aWEgZGVsbGUgRW50cmF0ZTEhMB8GA1UEAwwY
Q0EgQWdlbnppYSBkZWxsZSBFbnRyYXRlMB4XDTE4MTIwNjEzNTM0M1oXDTM4MTIw
MTEzNTM0M1owUDELMAkGA1UEBhMCSVQxHjAcBgNVBAoMFUFnZW56aWEgZGVsbGUg
RW50cmF0ZTEhMB8GA1UEAwwYQ0EgQWdlbnppYSBkZWxsZSBFbnRyYXRlMIICIjAN
BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxWfiiM6ZUR2tQgYNe7pPUwmC5Llf
qBi+KAu35Ib6tFeQyZOrYJjZ5JWg2ocBXhh1pNZv40BDVi6rcbYYIp5ZDU4yggBn
YiWnHxUJJXE5slW6nr57AWUxd9w9Jqne/chOGCIiMI2T9nN/y5wrmpniWaV4Gy9A
K5Ws1RcsTh4Y4pO/xGRky6Mq0M8Ad/gTPyYPQ/HIadocfM0ut2M5sxnV/9LElW6e
xlud/5VULSht2svuYMq9J1Ql2N0dK/exgrsI/TJftzBifBdpfFcmmPUbMqEztEun
cCe27j9SWstMy1YVSzRHMMaaRHsPIzC8X0Jrw9K56YKqJpR2TT/sSoCJ3thOLQFJ
5zDyogMXnuMu3Vd+5Vo8OMwhnU/I24V7SYIS1Q6K0SMrUTpAG91oVSJbygxAAY1e
c7u55D4xdQg2sX6Rfl3ak/gr2RaAkXv7DWVJ6mZGuhIWRsTqJF4UYlNqTIIKWrOc
MuGQKduG/htp6sleUXImn+xCeWexKqnD4qtRX3e4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sdi/cert/production/Sistema_Interscambio_Fattura_PA.cer
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-----BEGIN CERTIFICATE-----
MIIFQTCCAymgAwIBAgIIWcqHMpBoOC4wDQYJKoZIhvcNAQELBQAwUDELMAkGA1UE
BhMCSVQxHjAcBgNVBAoMFUFnZW56aWEgZGVsbGUgRW50cmF0ZTEhMB8GA1UEAwwY
Q0EgQWdlbnppYSBkZWxsZSBFbnRyYXRlMB4XDTI0MDQyOTEyNTYxMVoXDTI3MDQy
OTEyNTYxMFowdDELMAkGA1UEBhMCSVQxHjAcBgNVBAoMFUFnZW56aWEgZGVsbGUg
RW50cmF0ZTEbMBkGA1UECwwSU2Vydml6aSBUZWxlbWF0aWNpMSgwJgYDVQQDDB9T
aXN0ZW1hIEludGVyc2NhbWJpbyBGYXR0dXJhIFBBMIIBIjANBgkqhkiG9w0BAQEF
AAOCAQ8AMIIBCgKCAQEAvm1gYBOaRGij6ganqKVdZsu0GqmTbMyHOV6LtJAjf0eU
ck5ekLHnKl8o/LKI7Kmv2j8L7TzkjWlPaNzRkIh2gVL55cOSxlPEp3tQypXNficW
hMzvEu7y2oPsjfHBxPQ+WYnXd2nNrh/uyGqG20/RIgn3MSas7XipEnmOjJKiG06K
8OJXWiLB6J45pRwOSMuGCQtkH2R7ysbmz7D+tquLdmBQP/Ek4ZFyfUKCEnrVxyeP
AR05dBdbfeV5Qbv8ydlM70IfiMpVl4PnnjbWo9PqmXkxI6c6wriICE9sCOQhJkXK
oL3lVtIdmWebuJP7S9V5RqcleisjiQhs7JWQ7ibdawIDAQABo4H6MIH3MB8GA1Ud
IwQYMBaAFK7FXVSI2gAMJTydaoKU1+wiW3e9MBMGA1UdJQQMMAoGCCsGAQUFBwMC
MIGPBgNVHR8EgYcwgYQwgYGgf6B9hntsZGFwOi8vY2Fkcy5lbnRyYXRlLmZpbmFu
emUuaXQvQ049Q0ElMjBBZ2VuemlhJTIwZGVsbGUlMjBFbnRyYXRlLE89QWdlbnpp
YSUyMGRlbGxlJTIwRW50cmF0ZSxDPUlUP2NlcnRpZmljYXRlUmV2b2NhdGlvbkxp
c3QwHQYDVR0OBBYEFGwy7ulmVmE2cM0I6T/rzk5G0QxPMA4GA1UdDwEB/wQEAwIF
oDANBgkqhkiG9w0BAQsFAAOCAgEAc/ujZ5LAXRnLFRioua6BpVkGPQMWMqSTvqC9
GquJ5YAWSeG0VDatbu4yRV7FGlendiF/cWG7w3+6f2HlgAlwqEZ9i47fIChzQQLq
baVsbaCFtbfrAbj3pufHUg9Klvx/TCRQUhz1Tm8YOXj8FIs7Ilb7Hio0y+R+dc1m
RY49smduJKTtpTY9i3l8v9OS1aK1e5Xz43ZNbUtWcbSoyfQnfDuqWscjfWxzaFoq
L9f432u4JlUzxrY0J5ejK0v8SKvXglmZ9Hus7zlIG2JddmiESD/E1CB7PLKkr5Uw
n8Eyyh5DSHkRMlzfgg3WvRpd+mycMhLFPpsQzmo0e8ij9tvscnyfr9R47aJ2MS1e
e4vCJuCXLxb5Q9SUY5GMQGVKdnXNsC4EN64CGjSQE0iud8zGBbE2nBf/06s864nK
UPHQOUeB+XN51YkrB+xYm69cpXPq1aO23foOMomuv23WDVa+4+UU+uB59/9OBlNR
s4DHo1W22XirMpmwS6108dr08KMoKqtt9EUqBxzPhvZQ2AbdB0/jQsDulPALjmYf
IqKbj/8+LvczEwmwVlbB+m5FdMhhK/55rBl46N0oJOOoiAdG37EPn1lMpg0dzCOd
Jnles755gFodRCYm2ovVHS7N3F0ABt4fIjpijQLTFKQmu/umfUWo0s3mCoqaFZf4
CVKxUfU=
-----END CERTIFICATE-----
37 changes: 37 additions & 0 deletions sdi/cert/production/servizi.fatturapa.it.cer
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
MIIG4TCCBcmgAwIBAgIRAPnjzjeZPhxE4lwvY+vN1EYwDQYJKoZIhvcNAQELBQAw
gZUxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0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zkEjmszvNZd1qimejJ9bz3fYFzNTyVvGLUparYJJzHbb2xnupdm
+NRNik9Nan/Kx9O6Zc8MgXwIVlrB5whwmIuWvk0wfQmDMdXI2N7aT6WjI37aZAvB
sE45Ai/eN7eZcsn4PG/h6Qya7/0N//9uHHMz/en2jtlnXfDU4Q==
29 changes: 29 additions & 0 deletions sdi/cert/test/SistemaInterscambioFatturaPATest.cer
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
MIIFRTCCAy2gAwIBAgIIC6f8Wwpuvr4wDQYJKoZIhvcNAQELBQAwVTELMAkGA1UE
BhMCSVQxHjAcBgNVBAoMFUFnZW56aWEgZGVsbGUgRW50cmF0ZTEmMCQGA1UEAwwd
Q0EgQWdlbnppYSBkZWxsZSBFbnRyYXRlIFRlc3QwHhcNMjMxMjA2MTAyNDAzWhcN
MjYxMjA1MTAyNDAyWjB0MQswCQYDVQQGEwJJVDEeMBwGA1UECgwVQWdlbnppYSBk
ZWxsZSBFbnRyYXRlMRswGQYDVQQLDBJTZXJ2aXppIFRlbGVtYXRpY2kxKDAmBgNV
BAMMH1Npc3RlbWEgSW50ZXJzY2FtYmlvIEZhdHR1cmEgUEEwggEiMA0GCSqGSIb3
DQEBAQUAA4IBDwAwggEKAoIBAQDCTkSauZHqG+TsDUtCSYfNAaiub5VvOJnxf4p8
TcB0NBFUsnlWqMvrcESG0zVkBEnZOe8k5yQ0UMTpaHAO4GfOv4lXEqC/awy4lUgg
Ekwnpzhod6/29iZc4fqoSxQJdyW9ylktKEFFvEt81Z3tv71nYNQO7k91Gmp5dxmk
a1LUiG4uZPo95f7MbNwvWKOb25wsSckpKPUYvvAUrmwkuN1Cg/ELOjC0fvtjJXHl
9EXex7gdNIZa2HdW0eRzPcPTew7EFccPRoj1DCK1tACAmKHhd266WbqTmLafd/nM
DDfWCH14oYRH/+pty/T72OU5HuFZHG+5d75lLjdumCopOL2/AgMBAAGjgfkwgfYw
HwYDVR0jBBgwFoAUcDVCjm5uQ9+S+bP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
44 changes: 44 additions & 0 deletions sdi/cert_pool.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package sdi

import (
"crypto/x509"
"log"
"os"
"path/filepath"
)

func loadCACertFromFile(certPath string) (*x509.Certificate, error) {
caCert, err := os.ReadFile(certPath)
if err != nil {
return nil, err
}

cert, err := x509.ParseCertificate(caCert)
if err != nil {
return nil, err
}

return cert, nil
}

// PrepareCertPoolFromDir returns caCertPool from selected folder
func PrepareCertPoolFromDir(dir string) (*x509.CertPool, error) {
caCertPool := x509.NewCertPool()

// Find files matching the "*.pem" pattern in the directory
matches, err := filepath.Glob(filepath.Join(dir, "*.cer"))
if err != nil {
return nil, err
}

for _, match := range matches {
cert, err := loadCACertFromFile(match)
if err != nil {
log.Printf("Error reading certificate %s: %v", match, err)
continue
}
caCertPool.AddCert(cert)
}

return caCertPool, nil
}
22 changes: 22 additions & 0 deletions sdi/cert_pool_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package sdi_test

import (
"crypto/x509"
"testing"

sdi "github.com/invopop/gobl.fatturapa/sdi"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestPrepareCertPoolFromDir(t *testing.T) {
t.Run("should return empty Cert Pool when folder has no cert files", func(t *testing.T) {
expectedCertPool := x509.NewCertPool()
caCertPool, err := sdi.PrepareCertPoolFromDir(".")

require.NoError(t, err)
assert.Equal(t, expectedCertPool, caCertPool)
assert.Equal(t, 0, len(caCertPool.Subjects())) // nolint:staticcheck //
})
}
21 changes: 21 additions & 0 deletions sdi/http_client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package sdi

import (
"crypto/tls"
"crypto/x509"
"net/http"
"time"
)

// HTTPClient returns HTTP client with Cert Pool
func HTTPClient(caCertPool *x509.CertPool) *http.Client {
httpClient := &http.Client{
Timeout: 2500 * time.Millisecond,
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
RootCAs: caCertPool,
},
},
}
return httpClient
}
Loading
Loading