-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/onchain-non-merklized-credential-con…
…verter
- Loading branch information
Showing
40 changed files
with
1,068 additions
and
147 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { CredentialStatus, RevocationStatus } from '../../verifiable'; | ||
import { CredentialStatusResolveOptions, CredentialStatusResolver } from './resolver'; | ||
|
||
export class DidDocumentCredentialStatusResolver implements CredentialStatusResolver { | ||
constructor(private readonly didResolverUrl: string) {} | ||
async resolve( | ||
credentialStatus: CredentialStatus, | ||
opts?: CredentialStatusResolveOptions | undefined | ||
): Promise<RevocationStatus> { | ||
if (!opts?.issuerDID) { | ||
throw new Error('IssuerDID is not set in options'); | ||
} | ||
|
||
const url = `${this.didResolverUrl}/1.0/credential-status/${encodeURIComponent( | ||
opts.issuerDID.string() | ||
)}`; | ||
const resp = await fetch(url, { | ||
method: 'POST', | ||
body: JSON.stringify(credentialStatus) | ||
}); | ||
const data = await resp.json(); | ||
return data; | ||
} | ||
} |
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
Oops, something went wrong.