Skip to content

Commit 1fedea7

Browse files
patrick.rissmann@l3montree.compatrick.rissmann@l3montree.com
authored andcommitted
stashing changes for now need to further discuss the problems
1 parent 647a0f4 commit 1fedea7

2 files changed

Lines changed: 72 additions & 3 deletions

File tree

internal/core/attestation/attestation_controller.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package attestation
22

33
import (
44
"fmt"
5-
"io/ioutil"
5+
"io"
66

77
"github.com/l3montree-dev/devguard/internal/core"
88
"github.com/l3montree-dev/devguard/internal/database/models"
@@ -34,12 +34,22 @@ func (a *attestationController) List(ctx core.Context) error {
3434
func (a *attestationController) Create(ctx core.Context) error {
3535
var attestation models.Attestation
3636

37-
content, err := ioutil.ReadAll(ctx.Request().Body)
37+
assetVersion := core.GetAssetVersion(ctx)
38+
39+
attestation.AssetID = core.GetAsset(ctx).ID
40+
41+
attestation.AssetVersionName = assetVersion.Name
42+
attestation.AssetVersion = assetVersion
43+
//How to get the name of the attestation ?
44+
45+
content, err := io.ReadAll(ctx.Request().Body)
3846

3947
if err != nil {
4048
return echo.NewHTTPError(400, "unable to bind data to attestation model").WithInternal(err)
4149
}
42-
fmt.Printf("This is the content as string: %s\n", content)
50+
//json := make(map[string]string)
51+
//err = json.Unmarshal(content, &json)
52+
fmt.Printf("content: %s \n", content)
4353

4454
err = core.V.Struct(attestation)
4555
if err != nil {

mocks/mock_core_AttestationRepository.go

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)