@naylence/runtime 0.3.19 → 0.3.21

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.
@@ -515,12 +515,12 @@ async function ensureRuntimeFactoriesRegistered(registry = factory.Registry) {
515
515
  }
516
516
 
517
517
  // This file is auto-generated during build - do not edit manually
518
- // Generated from package.json version: 0.3.19
518
+ // Generated from package.json version: 0.3.21
519
519
  /**
520
520
  * The package version, injected at build time.
521
521
  * @internal
522
522
  */
523
- const VERSION = '0.3.19';
523
+ const VERSION = '0.3.21';
524
524
 
525
525
  let initialized = false;
526
526
  const runtimePlugin = {
@@ -13684,6 +13684,11 @@ class TransportListenerFactory extends factory.AbstractResourceFactory {
13684
13684
  static async createTransportListeners(configs, eventListeners, options = {}) {
13685
13685
  const listeners = [];
13686
13686
  for (const config of configs) {
13687
+ // Skip disabled listeners (enabled defaults to true if not specified)
13688
+ const configRecord = config;
13689
+ if (configRecord && configRecord.enabled === false) {
13690
+ continue;
13691
+ }
13687
13692
  const listener = await this.createTransportListener(config ?? undefined, eventListeners, options);
13688
13693
  if (listener) {
13689
13694
  listeners.push(listener);
@@ -40285,6 +40290,51 @@ class OAuth2ClientCredentialsTokenProvider {
40285
40290
  }
40286
40291
  return DEFAULT_EXPIRY_SECONDS;
40287
40292
  }
40293
+ async getIdentity() {
40294
+ const token = await this.getToken();
40295
+ const tokenValue = token.value;
40296
+ const parts = tokenValue.split('.');
40297
+ if (parts.length !== 3) {
40298
+ return undefined;
40299
+ }
40300
+ try {
40301
+ const payloadSegment = parts[1];
40302
+ // Fix padding for base64url
40303
+ const padding = '='.repeat((4 - (payloadSegment.length % 4)) % 4);
40304
+ const base64 = (payloadSegment + padding)
40305
+ .replace(/-/g, '+')
40306
+ .replace(/_/g, '/');
40307
+ let jsonString;
40308
+ if (typeof Buffer !== 'undefined') {
40309
+ jsonString = Buffer.from(base64, 'base64').toString('utf-8');
40310
+ }
40311
+ else if (typeof atob === 'function') {
40312
+ jsonString = atob(base64);
40313
+ try {
40314
+ jsonString = decodeURIComponent(jsonString
40315
+ .split('')
40316
+ .map(function (c) {
40317
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
40318
+ })
40319
+ .join(''));
40320
+ }
40321
+ catch {
40322
+ // ignore
40323
+ }
40324
+ }
40325
+ else {
40326
+ return undefined;
40327
+ }
40328
+ const payload = JSON.parse(jsonString);
40329
+ if (payload && typeof payload.sub === 'string') {
40330
+ return { subject: payload.sub, claims: payload };
40331
+ }
40332
+ }
40333
+ catch {
40334
+ // ignore decoding errors
40335
+ }
40336
+ return undefined;
40337
+ }
40288
40338
  }
40289
40339
 
40290
40340
  var oauth2ClientCredentialsTokenProvider = /*#__PURE__*/Object.freeze({
@@ -513,12 +513,12 @@ async function ensureRuntimeFactoriesRegistered(registry = Registry) {
513
513
  }
514
514
 
515
515
  // This file is auto-generated during build - do not edit manually
516
- // Generated from package.json version: 0.3.19
516
+ // Generated from package.json version: 0.3.21
517
517
  /**
518
518
  * The package version, injected at build time.
519
519
  * @internal
520
520
  */
521
- const VERSION = '0.3.19';
521
+ const VERSION = '0.3.21';
522
522
 
523
523
  let initialized = false;
524
524
  const runtimePlugin = {
@@ -13682,6 +13682,11 @@ class TransportListenerFactory extends AbstractResourceFactory {
13682
13682
  static async createTransportListeners(configs, eventListeners, options = {}) {
13683
13683
  const listeners = [];
13684
13684
  for (const config of configs) {
13685
+ // Skip disabled listeners (enabled defaults to true if not specified)
13686
+ const configRecord = config;
13687
+ if (configRecord && configRecord.enabled === false) {
13688
+ continue;
13689
+ }
13685
13690
  const listener = await this.createTransportListener(config ?? undefined, eventListeners, options);
13686
13691
  if (listener) {
13687
13692
  listeners.push(listener);
@@ -40283,6 +40288,51 @@ class OAuth2ClientCredentialsTokenProvider {
40283
40288
  }
40284
40289
  return DEFAULT_EXPIRY_SECONDS;
40285
40290
  }
40291
+ async getIdentity() {
40292
+ const token = await this.getToken();
40293
+ const tokenValue = token.value;
40294
+ const parts = tokenValue.split('.');
40295
+ if (parts.length !== 3) {
40296
+ return undefined;
40297
+ }
40298
+ try {
40299
+ const payloadSegment = parts[1];
40300
+ // Fix padding for base64url
40301
+ const padding = '='.repeat((4 - (payloadSegment.length % 4)) % 4);
40302
+ const base64 = (payloadSegment + padding)
40303
+ .replace(/-/g, '+')
40304
+ .replace(/_/g, '/');
40305
+ let jsonString;
40306
+ if (typeof Buffer !== 'undefined') {
40307
+ jsonString = Buffer.from(base64, 'base64').toString('utf-8');
40308
+ }
40309
+ else if (typeof atob === 'function') {
40310
+ jsonString = atob(base64);
40311
+ try {
40312
+ jsonString = decodeURIComponent(jsonString
40313
+ .split('')
40314
+ .map(function (c) {
40315
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
40316
+ })
40317
+ .join(''));
40318
+ }
40319
+ catch {
40320
+ // ignore
40321
+ }
40322
+ }
40323
+ else {
40324
+ return undefined;
40325
+ }
40326
+ const payload = JSON.parse(jsonString);
40327
+ if (payload && typeof payload.sub === 'string') {
40328
+ return { subject: payload.sub, claims: payload };
40329
+ }
40330
+ }
40331
+ catch {
40332
+ // ignore decoding errors
40333
+ }
40334
+ return undefined;
40335
+ }
40286
40336
  }
40287
40337
 
40288
40338
  var oauth2ClientCredentialsTokenProvider = /*#__PURE__*/Object.freeze({
@@ -25,6 +25,11 @@ class TransportListenerFactory extends factory_1.AbstractResourceFactory {
25
25
  static async createTransportListeners(configs, eventListeners, options = {}) {
26
26
  const listeners = [];
27
27
  for (const config of configs) {
28
+ // Skip disabled listeners (enabled defaults to true if not specified)
29
+ const configRecord = config;
30
+ if (configRecord && configRecord.enabled === false) {
31
+ continue;
32
+ }
28
33
  const listener = await this.createTransportListener(config ?? undefined, eventListeners, options);
29
34
  if (listener) {
30
35
  listeners.push(listener);
@@ -152,5 +152,50 @@ class OAuth2ClientCredentialsTokenProvider {
152
152
  }
153
153
  return DEFAULT_EXPIRY_SECONDS;
154
154
  }
155
+ async getIdentity() {
156
+ const token = await this.getToken();
157
+ const tokenValue = token.value;
158
+ const parts = tokenValue.split('.');
159
+ if (parts.length !== 3) {
160
+ return undefined;
161
+ }
162
+ try {
163
+ const payloadSegment = parts[1];
164
+ // Fix padding for base64url
165
+ const padding = '='.repeat((4 - (payloadSegment.length % 4)) % 4);
166
+ const base64 = (payloadSegment + padding)
167
+ .replace(/-/g, '+')
168
+ .replace(/_/g, '/');
169
+ let jsonString;
170
+ if (typeof Buffer !== 'undefined') {
171
+ jsonString = Buffer.from(base64, 'base64').toString('utf-8');
172
+ }
173
+ else if (typeof atob === 'function') {
174
+ jsonString = atob(base64);
175
+ try {
176
+ jsonString = decodeURIComponent(jsonString
177
+ .split('')
178
+ .map(function (c) {
179
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
180
+ })
181
+ .join(''));
182
+ }
183
+ catch {
184
+ // ignore
185
+ }
186
+ }
187
+ else {
188
+ return undefined;
189
+ }
190
+ const payload = JSON.parse(jsonString);
191
+ if (payload && typeof payload.sub === 'string') {
192
+ return { subject: payload.sub, claims: payload };
193
+ }
194
+ }
195
+ catch {
196
+ // ignore decoding errors
197
+ }
198
+ return undefined;
199
+ }
155
200
  }
156
201
  exports.OAuth2ClientCredentialsTokenProvider = OAuth2ClientCredentialsTokenProvider;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  // This file is auto-generated during build - do not edit manually
3
- // Generated from package.json version: 0.3.19
3
+ // Generated from package.json version: 0.3.21
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.VERSION = void 0;
6
6
  /**
7
7
  * The package version, injected at build time.
8
8
  * @internal
9
9
  */
10
- exports.VERSION = '0.3.19';
10
+ exports.VERSION = '0.3.21';
@@ -22,6 +22,11 @@ export class TransportListenerFactory extends AbstractResourceFactory {
22
22
  static async createTransportListeners(configs, eventListeners, options = {}) {
23
23
  const listeners = [];
24
24
  for (const config of configs) {
25
+ // Skip disabled listeners (enabled defaults to true if not specified)
26
+ const configRecord = config;
27
+ if (configRecord && configRecord.enabled === false) {
28
+ continue;
29
+ }
25
30
  const listener = await this.createTransportListener(config ?? undefined, eventListeners, options);
26
31
  if (listener) {
27
32
  listeners.push(listener);
@@ -149,4 +149,49 @@ export class OAuth2ClientCredentialsTokenProvider {
149
149
  }
150
150
  return DEFAULT_EXPIRY_SECONDS;
151
151
  }
152
+ async getIdentity() {
153
+ const token = await this.getToken();
154
+ const tokenValue = token.value;
155
+ const parts = tokenValue.split('.');
156
+ if (parts.length !== 3) {
157
+ return undefined;
158
+ }
159
+ try {
160
+ const payloadSegment = parts[1];
161
+ // Fix padding for base64url
162
+ const padding = '='.repeat((4 - (payloadSegment.length % 4)) % 4);
163
+ const base64 = (payloadSegment + padding)
164
+ .replace(/-/g, '+')
165
+ .replace(/_/g, '/');
166
+ let jsonString;
167
+ if (typeof Buffer !== 'undefined') {
168
+ jsonString = Buffer.from(base64, 'base64').toString('utf-8');
169
+ }
170
+ else if (typeof atob === 'function') {
171
+ jsonString = atob(base64);
172
+ try {
173
+ jsonString = decodeURIComponent(jsonString
174
+ .split('')
175
+ .map(function (c) {
176
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
177
+ })
178
+ .join(''));
179
+ }
180
+ catch {
181
+ // ignore
182
+ }
183
+ }
184
+ else {
185
+ return undefined;
186
+ }
187
+ const payload = JSON.parse(jsonString);
188
+ if (payload && typeof payload.sub === 'string') {
189
+ return { subject: payload.sub, claims: payload };
190
+ }
191
+ }
192
+ catch {
193
+ // ignore decoding errors
194
+ }
195
+ return undefined;
196
+ }
152
197
  }
@@ -1,7 +1,7 @@
1
1
  // This file is auto-generated during build - do not edit manually
2
- // Generated from package.json version: 0.3.19
2
+ // Generated from package.json version: 0.3.21
3
3
  /**
4
4
  * The package version, injected at build time.
5
5
  * @internal
6
6
  */
7
- export const VERSION = '0.3.19';
7
+ export const VERSION = '0.3.21';
@@ -14,12 +14,12 @@ var fastify = require('fastify');
14
14
  var websocketPlugin = require('@fastify/websocket');
15
15
 
16
16
  // This file is auto-generated during build - do not edit manually
17
- // Generated from package.json version: 0.3.19
17
+ // Generated from package.json version: 0.3.21
18
18
  /**
19
19
  * The package version, injected at build time.
20
20
  * @internal
21
21
  */
22
- const VERSION = '0.3.19';
22
+ const VERSION = '0.3.21';
23
23
 
24
24
  /**
25
25
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -13156,6 +13156,11 @@ class TransportListenerFactory extends factory.AbstractResourceFactory {
13156
13156
  static async createTransportListeners(configs, eventListeners, options = {}) {
13157
13157
  const listeners = [];
13158
13158
  for (const config of configs) {
13159
+ // Skip disabled listeners (enabled defaults to true if not specified)
13160
+ const configRecord = config;
13161
+ if (configRecord && configRecord.enabled === false) {
13162
+ continue;
13163
+ }
13159
13164
  const listener = await this.createTransportListener(config ?? undefined, eventListeners, options);
13160
13165
  if (listener) {
13161
13166
  listeners.push(listener);
@@ -40087,6 +40092,51 @@ class OAuth2ClientCredentialsTokenProvider {
40087
40092
  }
40088
40093
  return DEFAULT_EXPIRY_SECONDS;
40089
40094
  }
40095
+ async getIdentity() {
40096
+ const token = await this.getToken();
40097
+ const tokenValue = token.value;
40098
+ const parts = tokenValue.split('.');
40099
+ if (parts.length !== 3) {
40100
+ return undefined;
40101
+ }
40102
+ try {
40103
+ const payloadSegment = parts[1];
40104
+ // Fix padding for base64url
40105
+ const padding = '='.repeat((4 - (payloadSegment.length % 4)) % 4);
40106
+ const base64 = (payloadSegment + padding)
40107
+ .replace(/-/g, '+')
40108
+ .replace(/_/g, '/');
40109
+ let jsonString;
40110
+ if (typeof Buffer !== 'undefined') {
40111
+ jsonString = Buffer.from(base64, 'base64').toString('utf-8');
40112
+ }
40113
+ else if (typeof atob === 'function') {
40114
+ jsonString = atob(base64);
40115
+ try {
40116
+ jsonString = decodeURIComponent(jsonString
40117
+ .split('')
40118
+ .map(function (c) {
40119
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
40120
+ })
40121
+ .join(''));
40122
+ }
40123
+ catch {
40124
+ // ignore
40125
+ }
40126
+ }
40127
+ else {
40128
+ return undefined;
40129
+ }
40130
+ const payload = JSON.parse(jsonString);
40131
+ if (payload && typeof payload.sub === 'string') {
40132
+ return { subject: payload.sub, claims: payload };
40133
+ }
40134
+ }
40135
+ catch {
40136
+ // ignore decoding errors
40137
+ }
40138
+ return undefined;
40139
+ }
40090
40140
  }
40091
40141
 
40092
40142
  var oauth2ClientCredentialsTokenProvider = /*#__PURE__*/Object.freeze({
@@ -13,12 +13,12 @@ import fastify from 'fastify';
13
13
  import websocketPlugin from '@fastify/websocket';
14
14
 
15
15
  // This file is auto-generated during build - do not edit manually
16
- // Generated from package.json version: 0.3.19
16
+ // Generated from package.json version: 0.3.21
17
17
  /**
18
18
  * The package version, injected at build time.
19
19
  * @internal
20
20
  */
21
- const VERSION = '0.3.19';
21
+ const VERSION = '0.3.21';
22
22
 
23
23
  /**
24
24
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -13155,6 +13155,11 @@ class TransportListenerFactory extends AbstractResourceFactory {
13155
13155
  static async createTransportListeners(configs, eventListeners, options = {}) {
13156
13156
  const listeners = [];
13157
13157
  for (const config of configs) {
13158
+ // Skip disabled listeners (enabled defaults to true if not specified)
13159
+ const configRecord = config;
13160
+ if (configRecord && configRecord.enabled === false) {
13161
+ continue;
13162
+ }
13158
13163
  const listener = await this.createTransportListener(config ?? undefined, eventListeners, options);
13159
13164
  if (listener) {
13160
13165
  listeners.push(listener);
@@ -40086,6 +40091,51 @@ class OAuth2ClientCredentialsTokenProvider {
40086
40091
  }
40087
40092
  return DEFAULT_EXPIRY_SECONDS;
40088
40093
  }
40094
+ async getIdentity() {
40095
+ const token = await this.getToken();
40096
+ const tokenValue = token.value;
40097
+ const parts = tokenValue.split('.');
40098
+ if (parts.length !== 3) {
40099
+ return undefined;
40100
+ }
40101
+ try {
40102
+ const payloadSegment = parts[1];
40103
+ // Fix padding for base64url
40104
+ const padding = '='.repeat((4 - (payloadSegment.length % 4)) % 4);
40105
+ const base64 = (payloadSegment + padding)
40106
+ .replace(/-/g, '+')
40107
+ .replace(/_/g, '/');
40108
+ let jsonString;
40109
+ if (typeof Buffer !== 'undefined') {
40110
+ jsonString = Buffer.from(base64, 'base64').toString('utf-8');
40111
+ }
40112
+ else if (typeof atob === 'function') {
40113
+ jsonString = atob(base64);
40114
+ try {
40115
+ jsonString = decodeURIComponent(jsonString
40116
+ .split('')
40117
+ .map(function (c) {
40118
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
40119
+ })
40120
+ .join(''));
40121
+ }
40122
+ catch {
40123
+ // ignore
40124
+ }
40125
+ }
40126
+ else {
40127
+ return undefined;
40128
+ }
40129
+ const payload = JSON.parse(jsonString);
40130
+ if (payload && typeof payload.sub === 'string') {
40131
+ return { subject: payload.sub, claims: payload };
40132
+ }
40133
+ }
40134
+ catch {
40135
+ // ignore decoding errors
40136
+ }
40137
+ return undefined;
40138
+ }
40089
40139
  }
40090
40140
 
40091
40141
  var oauth2ClientCredentialsTokenProvider = /*#__PURE__*/Object.freeze({
@@ -4426,12 +4426,12 @@ async function ensureRuntimeFactoriesRegistered(registry = factory.Registry) {
4426
4426
  }
4427
4427
 
4428
4428
  // This file is auto-generated during build - do not edit manually
4429
- // Generated from package.json version: 0.3.19
4429
+ // Generated from package.json version: 0.3.21
4430
4430
  /**
4431
4431
  * The package version, injected at build time.
4432
4432
  * @internal
4433
4433
  */
4434
- const VERSION = '0.3.19';
4434
+ const VERSION = '0.3.21';
4435
4435
 
4436
4436
  let initialized = false;
4437
4437
  const runtimePlugin = {
@@ -15291,6 +15291,11 @@ class TransportListenerFactory extends factory.AbstractResourceFactory {
15291
15291
  static async createTransportListeners(configs, eventListeners, options = {}) {
15292
15292
  const listeners = [];
15293
15293
  for (const config of configs) {
15294
+ // Skip disabled listeners (enabled defaults to true if not specified)
15295
+ const configRecord = config;
15296
+ if (configRecord && configRecord.enabled === false) {
15297
+ continue;
15298
+ }
15294
15299
  const listener = await this.createTransportListener(config ?? undefined, eventListeners, options);
15295
15300
  if (listener) {
15296
15301
  listeners.push(listener);
@@ -42421,6 +42426,51 @@ class OAuth2ClientCredentialsTokenProvider {
42421
42426
  }
42422
42427
  return DEFAULT_EXPIRY_SECONDS;
42423
42428
  }
42429
+ async getIdentity() {
42430
+ const token = await this.getToken();
42431
+ const tokenValue = token.value;
42432
+ const parts = tokenValue.split('.');
42433
+ if (parts.length !== 3) {
42434
+ return undefined;
42435
+ }
42436
+ try {
42437
+ const payloadSegment = parts[1];
42438
+ // Fix padding for base64url
42439
+ const padding = '='.repeat((4 - (payloadSegment.length % 4)) % 4);
42440
+ const base64 = (payloadSegment + padding)
42441
+ .replace(/-/g, '+')
42442
+ .replace(/_/g, '/');
42443
+ let jsonString;
42444
+ if (typeof Buffer !== 'undefined') {
42445
+ jsonString = Buffer.from(base64, 'base64').toString('utf-8');
42446
+ }
42447
+ else if (typeof atob === 'function') {
42448
+ jsonString = atob(base64);
42449
+ try {
42450
+ jsonString = decodeURIComponent(jsonString
42451
+ .split('')
42452
+ .map(function (c) {
42453
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
42454
+ })
42455
+ .join(''));
42456
+ }
42457
+ catch {
42458
+ // ignore
42459
+ }
42460
+ }
42461
+ else {
42462
+ return undefined;
42463
+ }
42464
+ const payload = JSON.parse(jsonString);
42465
+ if (payload && typeof payload.sub === 'string') {
42466
+ return { subject: payload.sub, claims: payload };
42467
+ }
42468
+ }
42469
+ catch {
42470
+ // ignore decoding errors
42471
+ }
42472
+ return undefined;
42473
+ }
42424
42474
  }
42425
42475
 
42426
42476
  var oauth2ClientCredentialsTokenProvider = /*#__PURE__*/Object.freeze({
@@ -4425,12 +4425,12 @@ async function ensureRuntimeFactoriesRegistered(registry = Registry) {
4425
4425
  }
4426
4426
 
4427
4427
  // This file is auto-generated during build - do not edit manually
4428
- // Generated from package.json version: 0.3.19
4428
+ // Generated from package.json version: 0.3.21
4429
4429
  /**
4430
4430
  * The package version, injected at build time.
4431
4431
  * @internal
4432
4432
  */
4433
- const VERSION = '0.3.19';
4433
+ const VERSION = '0.3.21';
4434
4434
 
4435
4435
  let initialized = false;
4436
4436
  const runtimePlugin = {
@@ -15290,6 +15290,11 @@ class TransportListenerFactory extends AbstractResourceFactory {
15290
15290
  static async createTransportListeners(configs, eventListeners, options = {}) {
15291
15291
  const listeners = [];
15292
15292
  for (const config of configs) {
15293
+ // Skip disabled listeners (enabled defaults to true if not specified)
15294
+ const configRecord = config;
15295
+ if (configRecord && configRecord.enabled === false) {
15296
+ continue;
15297
+ }
15293
15298
  const listener = await this.createTransportListener(config ?? undefined, eventListeners, options);
15294
15299
  if (listener) {
15295
15300
  listeners.push(listener);
@@ -42420,6 +42425,51 @@ class OAuth2ClientCredentialsTokenProvider {
42420
42425
  }
42421
42426
  return DEFAULT_EXPIRY_SECONDS;
42422
42427
  }
42428
+ async getIdentity() {
42429
+ const token = await this.getToken();
42430
+ const tokenValue = token.value;
42431
+ const parts = tokenValue.split('.');
42432
+ if (parts.length !== 3) {
42433
+ return undefined;
42434
+ }
42435
+ try {
42436
+ const payloadSegment = parts[1];
42437
+ // Fix padding for base64url
42438
+ const padding = '='.repeat((4 - (payloadSegment.length % 4)) % 4);
42439
+ const base64 = (payloadSegment + padding)
42440
+ .replace(/-/g, '+')
42441
+ .replace(/_/g, '/');
42442
+ let jsonString;
42443
+ if (typeof Buffer !== 'undefined') {
42444
+ jsonString = Buffer.from(base64, 'base64').toString('utf-8');
42445
+ }
42446
+ else if (typeof atob === 'function') {
42447
+ jsonString = atob(base64);
42448
+ try {
42449
+ jsonString = decodeURIComponent(jsonString
42450
+ .split('')
42451
+ .map(function (c) {
42452
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
42453
+ })
42454
+ .join(''));
42455
+ }
42456
+ catch {
42457
+ // ignore
42458
+ }
42459
+ }
42460
+ else {
42461
+ return undefined;
42462
+ }
42463
+ const payload = JSON.parse(jsonString);
42464
+ if (payload && typeof payload.sub === 'string') {
42465
+ return { subject: payload.sub, claims: payload };
42466
+ }
42467
+ }
42468
+ catch {
42469
+ // ignore decoding errors
42470
+ }
42471
+ return undefined;
42472
+ }
42423
42473
  }
42424
42474
 
42425
42475
  var oauth2ClientCredentialsTokenProvider = /*#__PURE__*/Object.freeze({
@@ -4,5 +4,10 @@ export interface TransportListenerConfig extends ResourceConfig {
4
4
  host?: string;
5
5
  port?: number;
6
6
  authorizer?: Record<string, unknown> | null;
7
+ /**
8
+ * Whether this listener is enabled. Defaults to true.
9
+ * Disabled listeners are skipped during node initialization.
10
+ */
11
+ enabled?: boolean;
7
12
  [key: string]: unknown;
8
13
  }
@@ -1,6 +1,7 @@
1
1
  import { type CredentialProvider } from '../credential/credential-provider.js';
2
2
  import type { Token } from './token.js';
3
- import type { TokenProvider } from './token-provider.js';
3
+ import type { IdentityExposingTokenProvider } from './token-provider.js';
4
+ import type { AuthIdentity } from './auth-identity.js';
4
5
  interface FetchLike {
5
6
  (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
6
7
  }
@@ -13,7 +14,7 @@ export interface OAuth2ClientCredentialsTokenProviderOptions {
13
14
  fetchImpl?: FetchLike;
14
15
  clockSkewSeconds?: number;
15
16
  }
16
- export declare class OAuth2ClientCredentialsTokenProvider implements TokenProvider {
17
+ export declare class OAuth2ClientCredentialsTokenProvider implements IdentityExposingTokenProvider {
17
18
  private cachedToken;
18
19
  private readonly options;
19
20
  constructor(rawOptions: OAuth2ClientCredentialsTokenProviderOptions | Record<string, unknown>);
@@ -22,5 +23,6 @@ export declare class OAuth2ClientCredentialsTokenProvider implements TokenProvid
22
23
  private fetchNewToken;
23
24
  private resolveFetch;
24
25
  private resolveExpiresIn;
26
+ getIdentity(): Promise<AuthIdentity | undefined>;
25
27
  }
26
28
  export {};
@@ -2,4 +2,4 @@
2
2
  * The package version, injected at build time.
3
3
  * @internal
4
4
  */
5
- export declare const VERSION = "0.3.19";
5
+ export declare const VERSION = "0.3.21";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naylence/runtime",
3
- "version": "0.3.19",
3
+ "version": "0.3.21",
4
4
  "type": "module",
5
5
  "description": "Naylence Runtime - Complete TypeScript runtime",
6
6
  "author": "Naylence Dev <naylencedev@gmail.com>",