forked from openwallet-foundation/sd-jwt-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/type metadata (openwallet-foundation#247)
feat: add type metadata fetching and validation via vct URL Signed-off-by: Mirko Mollik <mirkomollik@gmail.com>
- Loading branch information
Showing
22 changed files
with
699 additions
and
36 deletions.
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
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
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
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,11 +1,19 @@ | ||
import type { SDJWTConfig } from '@sd-jwt/types'; | ||
import type { VcTFetcher } from './sd-jwt-vc-vct'; | ||
|
||
export type StatusListFetcher = (uri: string) => Promise<string>; | ||
export type StatusValidator = (status: number) => Promise<void>; | ||
|
||
/** | ||
* Configuration for SD-JWT-VC | ||
*/ | ||
export type SDJWTVCConfig = SDJWTConfig & { | ||
// A function that fetches the status list from the uri. If not provided, the library will assume that the response is a compact JWT. | ||
statusListFetcher?: (uri: string) => Promise<string>; | ||
statusListFetcher?: StatusListFetcher; | ||
// validte the status and decide if the status is valid or not. If not provided, the code will continue if it is 0, otherwise it will throw an error. | ||
statusValidator?: (status: number) => Promise<void>; | ||
statusValidator?: StatusValidator; | ||
// a function that fetches the type metadata format from the uri. If not provided, the library will assume that the response is a TypeMetadataFormat. Caching has to be implemented in this function. If the integrity value is passed, it to be validated according to https://www.w3.org/TR/SRI/ | ||
vctFetcher?: VcTFetcher; | ||
// if set to true, it will load the metadata format based on the vct value. If not provided, it will default to false. | ||
loadTypeMetadataFormat?: boolean; | ||
}; |
Oops, something went wrong.