-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added better support (and distinction) for types v1.0.09 and v1…
….0.11
- Loading branch information
Showing
5 changed files
with
318 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
export * from './Authorization.types'; | ||
export * from './CredentialIssuance.types'; | ||
export * from './Generic.types'; | ||
export * from './v1_0_09.types'; | ||
export * from './v1_0_11.types'; | ||
export * from './OAuth2ASMetadata'; | ||
export * from './OpenID4VCIErrors'; | ||
export * from './OpenID4VCIServerMetadata'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { AbstractAuthorizationDetails, AbstractAuthorizationRequest, CredentialOfferCredential, IssuerCredentialSubject } from './Generic.types'; | ||
|
||
// https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-09.html#name-issuance-initiation-request | ||
export interface CredentialOfferV1_0_09 { | ||
issuer: string; | ||
credentials: (CredentialOfferCredential | string)[]; | ||
'pre-authorized_code'?: string; | ||
user_pin_required?: boolean; | ||
op_state?: string; | ||
} | ||
|
||
export interface AuthorizationRequestV1_0_09 extends AbstractAuthorizationRequest { | ||
op_state?: string; | ||
} | ||
|
||
export interface IssuanceInitiationRequestJwtVcJsonV1_0_09 extends CredentialOfferV1_0_09 { | ||
credentials: CredentialOfferCredential[]; | ||
} | ||
|
||
export interface AuthorizationDetailsJwtVcJsonV1_0_09 extends AbstractAuthorizationDetails { | ||
types: string[]; | ||
CredentialSubject?: IssuerCredentialSubject; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { AbstractAuthorizationRequest, CredentialFormatEnum, CredentialOfferCredential, Grant, IssuerCredentialDefinition } from './Generic.types'; | ||
|
||
export interface CredentialOfferV1_0_11 { | ||
credential_offer?: InnerCredentialOfferV1_0_11; | ||
credential_offer_uri?: string; | ||
} | ||
|
||
export interface InnerCredentialOfferV1_0_11 { | ||
credential_issuer: string; | ||
//fixme: @nklomp, I've made this optional because in the annex E's example, we don't see the credentials property, but we see credential_definition property which I guess does the same thing. I've already asked about this in https://bitbucket.org/openid/connect/issues/1875/differences-between-spec-and-examples-in | ||
credentials?: (CredentialOfferCredential | string)[]; | ||
grants?: Grant; | ||
} | ||
|
||
export interface AuthorizationRequestV1_0_11 extends AbstractAuthorizationRequest { | ||
issuer_state?: string; | ||
} | ||
|
||
export interface CredentialOfferJwtVcJsonLdAndLdpVcV1_0_11 extends InnerCredentialOfferV1_0_11 { | ||
credential_definition: IssuerCredentialDefinition; | ||
} | ||
|
||
export interface CredentialOfferJwtVcJsonV1_0_11 extends InnerCredentialOfferV1_0_11 { | ||
credentials: ( | ||
| { | ||
format: CredentialFormatEnum.jwt_vc_json; | ||
types: string[]; | ||
} | ||
| string | ||
)[]; | ||
} |