@pulse-compute/jwt 0.0.0 → 1.0.0-beta.1
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 +58 -3
- package/as/index.as.ts +388 -0
- package/conformance/native-contract.json +53 -0
- package/dist/bearer.d.ts +4 -0
- package/dist/bearer.d.ts.map +1 -0
- package/dist/bearer.js +33 -0
- package/dist/bearer.js.map +1 -0
- package/dist/crypto-verifier.d.ts +19 -0
- package/dist/crypto-verifier.d.ts.map +1 -0
- package/dist/crypto-verifier.js +225 -0
- package/dist/crypto-verifier.js.map +1 -0
- package/dist/errors.d.ts +14 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +65 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/clock.d.ts +7 -0
- package/dist/internal/clock.d.ts.map +1 -0
- package/dist/internal/clock.js +34 -0
- package/dist/internal/clock.js.map +1 -0
- package/dist/internal/data.d.ts +12 -0
- package/dist/internal/data.d.ts.map +1 -0
- package/dist/internal/data.js +86 -0
- package/dist/internal/data.js.map +1 -0
- package/dist/internal/package-runtime.d.ts +9 -0
- package/dist/internal/package-runtime.d.ts.map +1 -0
- package/dist/internal/package-runtime.js +14 -0
- package/dist/internal/package-runtime.js.map +1 -0
- package/dist/internal/registered-claims.d.ts +3 -0
- package/dist/internal/registered-claims.d.ts.map +1 -0
- package/dist/internal/registered-claims.js +84 -0
- package/dist/internal/registered-claims.js.map +1 -0
- package/dist/internal/verifier-authority.d.ts +24 -0
- package/dist/internal/verifier-authority.d.ts.map +1 -0
- package/dist/internal/verifier-authority.js +101 -0
- package/dist/internal/verifier-authority.js.map +1 -0
- package/dist/options.d.ts +113 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +382 -0
- package/dist/options.js.map +1 -0
- package/dist/provider.d.ts +7 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +7 -0
- package/dist/provider.js.map +1 -0
- package/dist/result.d.ts +17 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +96 -0
- package/dist/result.js.map +1 -0
- package/dist/token.d.ts +20 -0
- package/dist/token.d.ts.map +1 -0
- package/dist/token.js +323 -0
- package/dist/token.js.map +1 -0
- package/package.json +64 -6
- package/pulse.package.json +75 -0
- package/pulsewasm.compiler.cjs +1258 -0
- package/pulsewasm.manifest.cjs +117 -0
- package/pulsewasm.native.cjs +60 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const pulseWasmManifest = Object.freeze({
|
|
4
|
+
version: 'pulsewasm.lowerable-library-manifest.v2',
|
|
5
|
+
kind: 'pulsewasm.lowerable-library-manifest',
|
|
6
|
+
contractId: 'pulse.jwt',
|
|
7
|
+
npmPackage: '@pulse-compute/jwt',
|
|
8
|
+
lowerableSubpath: '@pulse-compute/jwt',
|
|
9
|
+
facade: Object.freeze({
|
|
10
|
+
namespace: 'jwt',
|
|
11
|
+
import: '@pulse-compute/jwt',
|
|
12
|
+
symbols: Object.freeze(['bearer', 'verify'])
|
|
13
|
+
}),
|
|
14
|
+
publicApi: Object.freeze({
|
|
15
|
+
package: '@pulse-compute/jwt',
|
|
16
|
+
symbols: Object.freeze([
|
|
17
|
+
'JWT_ERROR_CODES',
|
|
18
|
+
'JwtError',
|
|
19
|
+
'bearer',
|
|
20
|
+
'jwt',
|
|
21
|
+
'verify'
|
|
22
|
+
]),
|
|
23
|
+
compatibilitySubpaths: Object.freeze([]),
|
|
24
|
+
loweringIntentionallyNarrow: true
|
|
25
|
+
}),
|
|
26
|
+
description: 'Package-owned Native lowering contract for bounded, provider-neutral JWT verification.',
|
|
27
|
+
compiler: Object.freeze({
|
|
28
|
+
version: 'pulsewasm.lowerable-compiler-builder.v1',
|
|
29
|
+
entry: './pulsewasm.compiler.cjs',
|
|
30
|
+
export: 'buildJwtLoweringPlan',
|
|
31
|
+
artifact: 'jwt-lowering-plan.json',
|
|
32
|
+
builderOwner: '@pulse-compute/jwt',
|
|
33
|
+
trust: 'first-party',
|
|
34
|
+
inputs: Object.freeze([
|
|
35
|
+
'typescript.SourceFile',
|
|
36
|
+
'pulsewasm.lowerable-library-manifest',
|
|
37
|
+
'pulse.jwt contracts',
|
|
38
|
+
'canonical schema bundle'
|
|
39
|
+
])
|
|
40
|
+
}),
|
|
41
|
+
modes: Object.freeze({
|
|
42
|
+
typescript: Object.freeze({ entry: './dist/index.js' }),
|
|
43
|
+
jsEngine: Object.freeze({
|
|
44
|
+
entry: './dist/index.js',
|
|
45
|
+
behavior: 'javascript-package-runtime'
|
|
46
|
+
}),
|
|
47
|
+
wasm: Object.freeze({
|
|
48
|
+
mode: 'wasm-sidecar',
|
|
49
|
+
sidecar: './as/index.as.ts',
|
|
50
|
+
sourceContribution: Object.freeze({
|
|
51
|
+
entry: './pulsewasm.native.cjs',
|
|
52
|
+
export: 'pulseJwtAssemblyScriptSource',
|
|
53
|
+
id: 'pulse-jwt-as',
|
|
54
|
+
language: 'assemblyscript',
|
|
55
|
+
semanticOwner: '@pulse-compute/jwt',
|
|
56
|
+
providerAuthority: Object.freeze([
|
|
57
|
+
'request',
|
|
58
|
+
'secret',
|
|
59
|
+
'wall-clock',
|
|
60
|
+
'schema',
|
|
61
|
+
'redaction',
|
|
62
|
+
'error-transport'
|
|
63
|
+
])
|
|
64
|
+
}),
|
|
65
|
+
lowerings: Object.freeze([
|
|
66
|
+
Object.freeze({
|
|
67
|
+
tsSymbol: 'jwt.verify',
|
|
68
|
+
asSymbol: 'pulse_jwt_verify',
|
|
69
|
+
callShape: 'request-bearer-static-policy',
|
|
70
|
+
hostCapabilities: Object.freeze([
|
|
71
|
+
'clock',
|
|
72
|
+
'headers',
|
|
73
|
+
'result'
|
|
74
|
+
])
|
|
75
|
+
})
|
|
76
|
+
]),
|
|
77
|
+
hostCapabilities: Object.freeze([
|
|
78
|
+
'clock',
|
|
79
|
+
'headers',
|
|
80
|
+
'result'
|
|
81
|
+
]),
|
|
82
|
+
realization: Object.freeze({
|
|
83
|
+
kind: 'crypto-composed',
|
|
84
|
+
semanticOwner: '@pulse-compute/crypto',
|
|
85
|
+
realization: 'guest-source:pulse-hmac-as',
|
|
86
|
+
implementation: 'pulse-hmac-as.v1',
|
|
87
|
+
packageSource: 'pulse-jwt-as',
|
|
88
|
+
algorithms: Object.freeze(['HS256', 'ES256']),
|
|
89
|
+
keyTypes: Object.freeze(['secret', 'jwk', 'jwks']),
|
|
90
|
+
guestUnitRequired: false,
|
|
91
|
+
guestUnits: Object.freeze({
|
|
92
|
+
ES256: 'pulse.crypto.es256.rustcrypto-p256.v1'
|
|
93
|
+
}),
|
|
94
|
+
portable: true,
|
|
95
|
+
automaticFallback: false
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
}),
|
|
99
|
+
protocol: Object.freeze({
|
|
100
|
+
contractId: 'pulse.jwt',
|
|
101
|
+
payloadRulesOwner: '@pulse-compute/wasm-contracts/jwt/contracts'
|
|
102
|
+
}),
|
|
103
|
+
policy: Object.freeze({
|
|
104
|
+
effectRuntimeRequired: true,
|
|
105
|
+
providerRuntimeImplemented: true,
|
|
106
|
+
loweringIntentionallyNarrow: true,
|
|
107
|
+
packageOwnsFacadeMapping: true,
|
|
108
|
+
canonicalRootLowering: true,
|
|
109
|
+
tokenSourceStatic: true,
|
|
110
|
+
policyStatic: true,
|
|
111
|
+
targetBindingRequired: true,
|
|
112
|
+
nativeRealizationImplemented: true,
|
|
113
|
+
automaticFallback: false
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
module.exports = pulseWasmManifest;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const crypto = require('node:crypto');
|
|
4
|
+
const fs = require('node:fs');
|
|
5
|
+
const path = require('node:path');
|
|
6
|
+
const packageManifest = require('./package.json');
|
|
7
|
+
|
|
8
|
+
const JWT_NATIVE_SOURCE_CONTRACT_VERSION = 'pulse.jwt-native-source.v1';
|
|
9
|
+
const sourceRelativeFile = 'as/index.as.ts';
|
|
10
|
+
const sourceFile = path.join(__dirname, sourceRelativeFile);
|
|
11
|
+
|
|
12
|
+
function sha256(value) {
|
|
13
|
+
return crypto.createHash('sha256').update(value).digest('hex');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function pulseJwtAssemblyScriptSource() {
|
|
17
|
+
const source = fs.readFileSync(sourceFile, 'utf8');
|
|
18
|
+
return Object.freeze({
|
|
19
|
+
version: JWT_NATIVE_SOURCE_CONTRACT_VERSION,
|
|
20
|
+
id: 'pulse-jwt-as',
|
|
21
|
+
owner: '@pulse-compute/jwt',
|
|
22
|
+
packageVersion: packageManifest.version,
|
|
23
|
+
kind: 'package-source',
|
|
24
|
+
language: 'assemblyscript',
|
|
25
|
+
license: 'Apache-2.0',
|
|
26
|
+
origin: 'package-source',
|
|
27
|
+
sourceIncluded: true,
|
|
28
|
+
sourceFile: sourceRelativeFile,
|
|
29
|
+
source,
|
|
30
|
+
sourceBytes: Buffer.byteLength(source),
|
|
31
|
+
sourceSha256: sha256(source),
|
|
32
|
+
imports: Object.freeze([]),
|
|
33
|
+
exports: Object.freeze([
|
|
34
|
+
'pulse_jwt_verify',
|
|
35
|
+
'pulse_jwt_fastly_verify'
|
|
36
|
+
]),
|
|
37
|
+
semanticOwnership: Object.freeze([
|
|
38
|
+
'compact-jws-parsing',
|
|
39
|
+
'protected-header-policy',
|
|
40
|
+
'exact-signing-input',
|
|
41
|
+
'registered-claims',
|
|
42
|
+
'result-shaping'
|
|
43
|
+
]),
|
|
44
|
+
providerAuthorities: Object.freeze([
|
|
45
|
+
'request',
|
|
46
|
+
'secret',
|
|
47
|
+
'wall-clock',
|
|
48
|
+
'schema',
|
|
49
|
+
'redaction',
|
|
50
|
+
'error-transport'
|
|
51
|
+
]),
|
|
52
|
+
cryptoRealization: 'guest-source:pulse-hmac-as',
|
|
53
|
+
automaticFallback: false
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
module.exports = Object.freeze({
|
|
58
|
+
JWT_NATIVE_SOURCE_CONTRACT_VERSION,
|
|
59
|
+
pulseJwtAssemblyScriptSource
|
|
60
|
+
});
|