@sphereon/ssi-sdk-ext.jwt-service 0.24.1-next.106 → 0.24.1-next.110
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/README.md +73 -374
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.js +7 -1
- package/dist/functions/index.js.map +1 -1
- package/dist/types/IJwtService.d.ts +3 -0
- package/dist/types/IJwtService.d.ts.map +1 -1
- package/dist/types/IJwtService.js.map +1 -1
- package/package.json +10 -10
- package/plugin.schema.json +653 -7
- package/src/functions/index.ts +7 -1
- package/src/types/IJwtService.ts +3 -0
package/src/functions/index.ts
CHANGED
|
@@ -46,7 +46,7 @@ const payloadToBytes = (payload: string | JwtPayload | Uint8Array): Uint8Array =
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export const prepareJwsObject = async (args: CreateJwsJsonArgs, context: IRequiredContext): Promise<PreparedJwsObject> => {
|
|
49
|
-
const { existingSignatures, protectedHeader, unprotectedHeader, issuer, payload, mode = 'auto' } = args
|
|
49
|
+
const { existingSignatures, protectedHeader, unprotectedHeader, issuer, payload, mode = 'auto', clientId, clientIdScheme } = args
|
|
50
50
|
|
|
51
51
|
const { noIdentifierInHeader = false } = issuer
|
|
52
52
|
const identifier = await ensureManagedIdentifierResult(issuer, context)
|
|
@@ -57,6 +57,12 @@ export const prepareJwsObject = async (args: CreateJwsJsonArgs, context: IRequir
|
|
|
57
57
|
if (issuer.noIssPayloadUpdate !== true && !payload.iss && identifier.issuer) {
|
|
58
58
|
payload.iss = identifier.issuer
|
|
59
59
|
}
|
|
60
|
+
if (clientIdScheme && !payload.client_id_scheme) {
|
|
61
|
+
payload.client_id_scheme = clientIdScheme
|
|
62
|
+
}
|
|
63
|
+
if (clientId && !payload.client_id) {
|
|
64
|
+
payload.client_id = clientId
|
|
65
|
+
}
|
|
60
66
|
}
|
|
61
67
|
const payloadBytes = payloadToBytes(payload)
|
|
62
68
|
const base64urlHeader = encodeJoseBlob(protectedHeader)
|
package/src/types/IJwtService.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
ManagedIdentifierOptsOrResult,
|
|
7
7
|
ManagedIdentifierResult,
|
|
8
8
|
} from '@sphereon/ssi-sdk-ext.identifier-resolution'
|
|
9
|
+
import { ClientIdScheme } from '@sphereon/ssi-sdk-ext.x509-utils'
|
|
9
10
|
import { IValidationResult, JoseSignatureAlgorithm, JoseSignatureAlgorithmString, JWK } from '@sphereon/ssi-types'
|
|
10
11
|
import { IAgentContext, IKeyManager, IPluginMethodMap } from '@veramo/core'
|
|
11
12
|
|
|
@@ -120,6 +121,8 @@ export type CreateJwsArgs = {
|
|
|
120
121
|
noIssPayloadUpdate?: boolean
|
|
121
122
|
noIdentifierInHeader?: boolean
|
|
122
123
|
}
|
|
124
|
+
clientId?: string
|
|
125
|
+
clientIdScheme?: ClientIdScheme | 'did' | string
|
|
123
126
|
protectedHeader: JwtHeader
|
|
124
127
|
payload: JwtPayload | Uint8Array | string
|
|
125
128
|
}
|