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

Masv pre paris demo #122

Merged
merged 4 commits into from
Dec 3, 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
3 changes: 3 additions & 0 deletions internal/apigw/apiv1/handlers_issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,18 @@ func (c *Client) Credential(ctx context.Context, req *CredentialRequest) (*apiv1
Identity: req.Identity,
})
if err != nil {
c.log.Debug("failed to get document", "error", err)
return nil, err
}

if document == nil || document.DocumentData == nil {
c.log.Debug("document_data not found")
return nil, helpers.ErrNoDocumentFound
}

documentData, err := json.Marshal(document.DocumentData)
if err != nil {
c.log.Debug("failed to marshal document data", "error", err)
return nil, err
}

Expand Down
8 changes: 4 additions & 4 deletions internal/issuer/apiv1/echic_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ func (c *ehicClient) MetadataClaim(vct string) ([]string, error) {
Rendering: Rendering{
Simple: SimpleRendering{
Logo: Logo{
URI: "https://github.com/dc4eu/vc/blob/9832bb494ecd982c3aa56ed1b504e3a884d46d23/images/ehiccard.png",
URIIntegrity: "sha256-0b276d01a45c41286220e8fb6e906b3475fa2d4f084e2d21eb502023ca51cacf",
URI: "https://raw.githubusercontent.com/dc4eu/vc/9832bb494ecd982c3aa56ed1b504e3a884d46d23/images/ehiccard.png",
URIIntegrity: "sha256-124c5fea148d56527baa77259942b6ee5050e635cc86c268fd42587d022a69c7",
AltText: "EHIC Card",
},
BackgroundColor: "#12107c",
TextColor: "#FFFFFF",
},
SVGTemplates: []SVGTemplates{
{
URI: "https://github.com/dc4eu/vc/blob/9832bb494ecd982c3aa56ed1b504e3a884d46d23/images/ehicTemplate.svg",
URLIntegrity: "sha256-dc538e648b863d6445327897318caee0ce65f219011f7b02995bd07b6abea9af",
URI: "https://raw.githubusercontent.com/dc4eu/vc/9832bb494ecd982c3aa56ed1b504e3a884d46d23/images/ehicTemplate.svg",
URLIntegrity: "sha256-c9089cb2c8b845a69978cc9adc2d53c88207ed5a586399b9aede8e1a93cd305a",
Properties: SVGTemplateProperties{},
},
},
Expand Down
3 changes: 1 addition & 2 deletions internal/issuer/apiv1/ehic.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package apiv1
import (
"context"
"crypto/sha256"
"fmt"
"time"
"vc/internal/gen/issuer/apiv1_issuer"
"vc/pkg/ehic"
Expand Down Expand Up @@ -43,7 +42,7 @@ func (c *ehicClient) sdjwt(ctx context.Context, doc *ehic.Document, jwk *apiv1_i
return "", err
}

vct := fmt.Sprintf("%s/credential/ehic/1.0", c.client.cfg.Issuer.JWTAttribute.Issuer)
vct := "EHICCredential"

body["nbf"] = int64(time.Now().Unix())
body["exp"] = time.Now().Add(365 * 24 * time.Hour).Unix()
Expand Down
3 changes: 1 addition & 2 deletions internal/issuer/apiv1/pda1.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package apiv1
import (
"context"
"crypto/sha256"
"fmt"
"time"
"vc/internal/gen/issuer/apiv1_issuer"
"vc/pkg/logger"
Expand Down Expand Up @@ -40,7 +39,7 @@ func (c *pda1Client) sdjwt(ctx context.Context, doc *pda1.Document, jwk *apiv1_i
return "", err
}

vct := fmt.Sprintf("%s/credential/pda1/1.0", c.client.cfg.Issuer.JWTAttribute.Issuer)
vct := "PDA1Credential"

body["nbf"] = int64(time.Now().Unix())
body["exp"] = time.Now().Add(365 * 24 * time.Hour).Unix()
Expand Down
8 changes: 4 additions & 4 deletions internal/issuer/apiv1/pda1_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ func (c *pda1Client) MetadataClaim(vct string) ([]string, error) {
Rendering: Rendering{
Simple: SimpleRendering{
Logo: Logo{
URI: "https://github.com/dc4eu/vc/blob/9832bb494ecd982c3aa56ed1b504e3a884d46d23/images/pda1.png",
URIIntegrity: "sha256-94445b2ca72e9155260c8b4879112df7677e8b3df3dcee9b970b40534e26d4ab",
URI: "https://raw.githubusercontent.com/dc4eu/vc/9832bb494ecd982c3aa56ed1b504e3a884d46d23/images/pda1.png",
URIIntegrity: "sha256-ecf6af03924f152deb2fad59c8496750a12e376a3b2b575d53b79f22241e3d96",
AltText: "PDA1 Card",
},
BackgroundColor: "#8ebeeb",
TextColor: "#ffffff",
},
SVGTemplates: []SVGTemplates{
{
URI: "https://github.com/dc4eu/vc/blob/9832bb494ecd982c3aa56ed1b504e3a884d46d23/images/pda1Template.svg",
URLIntegrity: "sha256-08b5d75f209d97f231bf5983e3937f83c515565023cd829fc255eeeba86a88cb",
URI: "https://raw.githubusercontent.com/dc4eu/vc/9832bb494ecd982c3aa56ed1b504e3a884d46d23/images/pda1Template.svg",
URLIntegrity: "sha256-35a9eecb4d2d8d92e42a33e7e765afc6b24c8875cf145ea1b29cde9cd2f63f5e",
Properties: SVGTemplateProperties{},
},
},
Expand Down
Loading
Loading