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

feature/SDK-39_well-known-oidf #164

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

sanderPostma
Copy link
Contributor

No description provided.

@sanderPostma sanderPostma marked this pull request as ready for review October 29, 2024 20:35
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 29.48718% with 110 lines in your changes missing coverage. Please review.

Project coverage is 48.46%. Comparing base (86f6d4a) to head (42688c6).
Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
.../lib/builder/AuthorizationServerMetadataBuilder.ts 21.60% 98 Missing ⚠️
packages/issuer/lib/builder/VcIssuerBuilder.ts 61.53% 5 Missing ⚠️
packages/issuer/lib/VcIssuer.ts 33.33% 4 Missing ⚠️
packages/issuer-rest/lib/oid4vci-api-functions.ts 72.72% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #164      +/-   ##
===========================================
- Coverage    49.11%   48.46%   -0.65%     
===========================================
  Files           74       75       +1     
  Lines         4976     5127     +151     
  Branches      1769     1774       +5     
===========================================
+ Hits          2444     2485      +41     
- Misses        2529     2639     +110     
  Partials         3        3              
Flag Coverage Δ
unittest 48.46% <29.48%> (-0.65%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@nklomp nklomp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 Please be more careful with your imports. Mulltiple of them are off
2 OIDF has nothing todo with OID4VC, except for the fact it can be used as a registry for trust establishment. So it for sure does not belong in the VCI REST API or anything

@@ -24,6 +24,9 @@ import { DIDDocument } from 'did-resolver'
import * as jose from 'jose'

import { generateDid, getIssuerCallbackV1_0_11, getIssuerCallbackV1_0_13, verifyCredential } from '../IssuerCallback'
import {
AuthorizationServerMetadataBuilder
} from '@sphereon/oid4vci-issuer/dist/builder/AuthorizationServerMetadataBuilder'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect import

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

} from '@sphereon/oid4vci-common'
import { VcIssuer } from '@sphereon/oid4vci-issuer/dist/VcIssuer'
import { CredentialSupportedBuilderV1_13, VcIssuerBuilder } from '@sphereon/oid4vci-issuer/dist/builder'
import {
AuthorizationServerMetadataBuilder
} from '@sphereon/oid4vci-issuer/dist/builder/AuthorizationServerMetadataBuilder'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -12,6 +12,9 @@ import {
URIState,
} from '@sphereon/oid4vci-common'
import { VcIssuer } from '@sphereon/oid4vci-issuer'
import {
AuthorizationServerMetadataBuilder
} from '@sphereon/oid4vci-issuer/dist/builder/AuthorizationServerMetadataBuilder'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

}
router.get(WellKnownEndpoints.OAUTH_AS, authorizationServerHandler)

const openidFederationHandler = (request: Request, response: Response) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is a REST API implementation of a OID4VC protocol which has little relation to OIDF all of a sudden handling OIDF metadata and wellknowns?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nklomp
The requested task was to host https://agent.wallet.bd.demo.sphereon.com/oid4vci/.well-known/openid-federation. Since the path was /oid4vci/* I assumed it was part of the issuer logic.
Plus it's already hosting /.well-known/openid-credential-issuer and /.well-known/oauth-authorization-server there, so it was the easiest place to do it.
Shall I create a separate oidf-metadata or something module for this in ssi-sdk?

} from '@sphereon/oid4vci-common'
import { CredentialEventNames, CredentialOfferEventNames, EVENTS } from '@sphereon/oid4vci-common'
import { CredentialIssuerMetadataOptsV1_0_13 } from '@sphereon/oid4vci-common'
import { OpenidFederationMetadata } from '@sphereon/oid4vci-common/dist/types/OpenidFederationMetadata'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please be more careful with your imports. There are multiple occasions I have to point out

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, but going to be removed

@@ -45,6 +46,8 @@ import { CredentialDataSupplier, CredentialDataSupplierArgs, CredentialIssuanceI

export class VcIssuer<DIDDoc extends object> {
private readonly _issuerMetadata: CredentialIssuerMetadataOptsV1_0_13
private readonly _authorizationServerMetadata: AuthorizationServerMetadata
private readonly _openidFederationMetadata?: OpenidFederationMetadata
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be here

} from '@sphereon/oid4vci-common'
import { CredentialIssuerMetadataOptsV1_0_13 } from '@sphereon/oid4vci-common'
import { OpenidFederationMetadata } from '@sphereon/oid4vci-common/dist/types/OpenidFederationMetadata'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imports again!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, but going to be removed

@@ -22,6 +24,8 @@ import { IssuerMetadataBuilderV1_13 } from './IssuerMetadataBuilderV1_13'
export class VcIssuerBuilder<DIDDoc extends object> {
issuerMetadataBuilder?: IssuerMetadataBuilderV1_13
issuerMetadata: Partial<CredentialIssuerMetadataOptsV1_0_13> = {}
authorizationServerMetadata: Partial<AuthorizationServerMetadata> = {}
openidFederationMetadata: Partial<OpenidFederationMetadata> = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be here

@sanderPostma
Copy link
Contributor Author

I wasn't done yet and also I did not review myself yet. I created a draft PR in IJ, but apparently it created a regular one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants