@dxos/credentials 0.5.1-main.4e99b85 → 0.5.1-main.4fc508c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +15 -0
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +16 -0
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/credentials/credential-generator.d.ts +6 -0
- package/dist/types/src/credentials/credential-generator.d.ts.map +1 -1
- package/dist/types/src/credentials/signing.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/credentials/credential-generator.ts +20 -0
- package/src/credentials/signing.ts +1 -0
|
@@ -249,3 +249,23 @@ export const createDelegatedSpaceInvitationCredential = async (
|
|
|
249
249
|
});
|
|
250
250
|
return { credential: { credential } };
|
|
251
251
|
};
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* @param signer - credential issuer.
|
|
255
|
+
* @param subject - key of the space the invitation was for.
|
|
256
|
+
* @param invitationCredentialId id of a dxos.halo.invitations.DelegateSpaceInvitation credential.
|
|
257
|
+
*/
|
|
258
|
+
export const createCancelDelegatedSpaceInvitationCredential = async (
|
|
259
|
+
signer: CredentialSigner,
|
|
260
|
+
subject: PublicKey,
|
|
261
|
+
invitationCredentialId: PublicKey,
|
|
262
|
+
): Promise<FeedMessage.Payload> => {
|
|
263
|
+
const credential = await signer.createCredential({
|
|
264
|
+
subject,
|
|
265
|
+
assertion: {
|
|
266
|
+
'@type': 'dxos.halo.invitations.CancelDelegatedInvitation',
|
|
267
|
+
credentialId: invitationCredentialId,
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
return { credential: { credential } };
|
|
271
|
+
};
|
|
@@ -12,6 +12,7 @@ import { arrayToBuffer } from '@dxos/util';
|
|
|
12
12
|
/**
|
|
13
13
|
* @returns The input message to be signed for a given credential.
|
|
14
14
|
*/
|
|
15
|
+
// TODO(nf): rename, this returns not the proof itself, but the payload for verifying against the proof.
|
|
15
16
|
export const getCredentialProofPayload = (credential: Credential): Uint8Array => {
|
|
16
17
|
const copy = {
|
|
17
18
|
...credential,
|