cerman updated

This commit is contained in:
Олег Бородин
2024-08-07 11:31:18 +02:00
parent 07b32e881e
commit a21b4e2db9
20 changed files with 638 additions and 377 deletions

View File

@@ -9,6 +9,7 @@ import (
"certmanager/internal/config"
"certmanager/internal/database"
"certmanager/internal/descriptor"
"certmanager/pkg/auxid"
"github.com/stretchr/testify/require"
yaml "gopkg.in/yaml.v3"
@@ -29,13 +30,15 @@ func XXTestDatabaseIssuer(t *testing.T) {
ctx, _ := context.WithTimeout(context.Background(), 1*time.Second)
issuerID := auxid.GenID()
issuer := &descriptor.Issuer{
ID: issuerID,
Name: "foo.bar",
Cert: "ASDFF",
Key: "QWERT",
Revoked: true,
}
issuerID, err := db.InsertIssuer(ctx, issuer)
err = db.InsertIssuer(ctx, issuer)
require.NoError(t, err)
fmt.Printf("issuerId: %d\n", issuerID)
@@ -80,14 +83,16 @@ func XXXTestDatabaseService(t *testing.T) {
ctx, _ := context.WithTimeout(context.Background(), 1*time.Second)
serviceID := auxid.GenID()
service := &descriptor.Service{
ID: serviceID,
Name: "foo.bar",
IssuerID: 123456,
Cert: "ASDFF",
Key: "QWERT",
Revoked: true,
}
serviceID, err := db.InsertService(ctx, service)
err = db.InsertService(ctx, service)
require.NoError(t, err)
fmt.Printf("serviceId: %d\n", serviceID)