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

Closed
wants to merge 25 commits into 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

All modified and coverable lines are covered by tests ✅

Project coverage is 48.49%. Comparing base (11632c3) to head (124522c).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #164      +/-   ##
===========================================
- Coverage    48.50%   48.49%   -0.02%     
===========================================
  Files           75       75              
  Lines         5115     5114       -1     
  Branches      1735     1735              
===========================================
- Hits          2481     2480       -1     
  Misses        2631     2631              
  Partials         3        3              
Flag Coverage Δ
unittest 48.49% <100.00%> (-0.02%) ⬇️

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.


🚨 Try these New Features:

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.

@sanderPostma
Copy link
Contributor Author

Closing as the code has nothing to do with this PR anymore

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