@mochabug/adaptkit 0.11.2 → 0.11.4

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.
@@ -255,71 +255,86 @@ export interface Manifest {
255
255
  * @generated from protobuf field: optional string assets = 13;
256
256
  */
257
257
  assets?: string;
258
+ /**
259
+ * 'cdn' is the URL of the plugin's CDN (content delivery network).
260
+ * The CDN is used to serve static assets, such as images, CSS, and JavaScript
261
+ * files. The files will be located on https://cdn.mochabug.com/adapt/plugins/<owner>/<plugin>/<version>/
262
+ *
263
+ * Restrictions:
264
+ * - Must be valid folder starting from the manifest.json file
265
+ * Security implications:
266
+ * - Should not contain sensitive information.
267
+ *
268
+ * @generated from protobuf field: optional string cdn = 14;
269
+ */
270
+ cdn?: string;
258
271
  /**
259
272
  * 'vertices' is a list of vertices that constitute the plugin.
260
273
  *
261
274
  * Restrictions:
262
275
  * - The count must be greater than 0 and less than or equal to 100.
263
276
  *
264
- * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.Vertex vertices = 14;
277
+ * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.Vertex vertices = 15;
265
278
  */
266
279
  vertices: Vertex[];
267
280
  /**
268
- * 'oauth2' represents the OAuth2 services required for the plugin.
281
+ * The plugin oauth2 services specifies oauth2 services that is required for the plugin.
282
+ * i.e. no user consent is needed
283
+ *
269
284
  * OAuth2 parameters are specified in the platform, and the service name is
270
285
  * used as an identifier to fetch the access token from the API.
271
286
  * - Must have between 0 and 20 oauth2 services, inclusive.
272
287
  *
273
- * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.OAuth2Service oauth2 = 15;
288
+ * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.Oauth2Service plugin_oauth2 = 16;
274
289
  */
275
- oauth2: OAuth2Service[];
290
+ pluginOauth2: Oauth2Service[];
276
291
  /**
277
- * 'variables' represents the variables required by the plugin.
292
+ * 'plugin_variables' represents the variables required by the plugin.
278
293
  * The platform ensures secure storage and transmission of variables.
294
+ * i.e. a plugin owner sets these variables and the plugin can use them
279
295
  *
280
296
  * Restrictions:
281
297
  * - Must have between 0 and 20 variables, inclusive.
282
298
  *
283
- * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.EnvironmentalVariable variables = 16;
299
+ * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.VariableService plugin_variables = 17;
284
300
  */
285
- variables: EnvironmentalVariable[];
301
+ pluginVariables: VariableService[];
286
302
  /**
287
- * 'mtls' represents the mTLS (mutual TLS) certificates required by
303
+ * 'plugin_mtls' represents the mTLS (mutual TLS) certificates required by
288
304
  * the plugin. The platform ensures secure storage and transmission of
289
305
  * certificates.
306
+ * i.e. a plugin owner sets these certificates and the plugin can use them
290
307
  *
291
308
  * Restrictions:
292
309
  * - Must have between 0 and 20 mtls services, inclusive.
293
310
  *
294
- * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.MTLSService mtls = 17;
311
+ * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.MTLSService plugin_mtls = 18;
295
312
  */
296
- mtls: MTLSService[];
297
- /**
298
- * 'cdn' is the URL of the plugin's CDN (content delivery network).
299
- * The CDN is used to serve static assets, such as images, CSS, and JavaScript
300
- * files. The files will be located on https://cdn.mochabug.com/adapt/plugins/<owner>/<plugin>/<version>/
301
- *
302
- * Restrictions:
303
- * - Must be valid folder starting from the manifest.json file
304
- * Security implications:
305
- * - Should not contain sensitive information.
306
- *
307
- * @generated from protobuf field: optional string cdn = 18;
308
- */
309
- cdn?: string;
313
+ pluginMtls: MTLSService[];
310
314
  }
311
315
  /**
312
- * MTLSService represents a mutual Transport Layer Security (mTLS) service
313
- * configuration required by the plugin. mTLS provides secure communication
314
- * between client and server by authenticating both parties and encrypting the
315
- * communication.
316
+ * Vertex represents a graph vertex that defines a plugin.
317
+ * The ES module names and entry points follow a convention for the executor and
318
+ * configurators files:
319
+ * - export {<vertex-name>InternalConfigurator} for the internal endpoint of the
320
+ * vertex configurator
321
+ * - export {<vertex-name>ExternalConfigurator} for the external endpoint of the
322
+ * vertex configurator
323
+ * - export {<vertex-name>InternalExecutor} for the internal endpoint of the
324
+ * vertex executor
325
+ * - export {<vertex-name>ExternalExecutor} for the external endpoint of the
326
+ * vertex executor
316
327
  *
317
- * @generated from protobuf message mochabugapis.adapt.plugins.v1.MTLSService
328
+ *
329
+ * Note: Be aware of potential security implications when dealing with
330
+ * user-provided data, such as file paths, and ensure proper input validation
331
+ * and sanitization.
332
+ *
333
+ * @generated from protobuf message mochabugapis.adapt.plugins.v1.Vertex
318
334
  */
319
- export interface MTLSService {
335
+ export interface Vertex {
320
336
  /**
321
- * 'name' is the identifier of the mTLS service.
322
- * It's used for referencing the specific mTLS configuration.
337
+ * 'name' represents the vertex name.
323
338
  *
324
339
  * Restrictions:
325
340
  * - Must match the ECMA regex: ^[_$a-z][_$a-z0-9]*$
@@ -331,23 +346,22 @@ export interface MTLSService {
331
346
  */
332
347
  name: string;
333
348
  /**
334
- * 'label' is an optional short label describing the purpose of the mTLS
335
- * service.
349
+ * 'label' is a human-friendly label shown in the UI.
336
350
  *
337
351
  * Restrictions:
338
352
  * - Length must be greater than 0 and less than 25 characters.
339
353
  * Security implications:
340
354
  * - Should not contain sensitive information.
341
355
  *
342
- * @generated from protobuf field: optional string label = 2;
356
+ * @generated from protobuf field: string label = 2;
343
357
  */
344
- label?: string;
358
+ label: string;
345
359
  /**
346
- * 'description' is an optional detailed description of the mTLS service and
347
- * its usage within the plugin.
360
+ * 'description' is a human-friendly short description of the vertex displayed
361
+ * in UI.
348
362
  *
349
363
  * Restrictions:
350
- * - Length must be less than 250 characters.
364
+ * - Length must be greater than 0 and less than 250 characters.
351
365
  * Security implications:
352
366
  * - Should not contain sensitive information.
353
367
  *
@@ -355,142 +369,195 @@ export interface MTLSService {
355
369
  */
356
370
  description?: string;
357
371
  /**
358
- * Unset or false means the variable is required
359
- * true means the mtls service is optional
372
+ * 'logo' is the file path to the vertex logo, which will be resized to a
373
+ * maximum of 40x40 pixels. Ensure that the logo files are from trusted
374
+ * sources to avoid security risks.
360
375
  *
361
- * @generated from protobuf field: optional bool optional = 4;
376
+ * Restrictions:
377
+ * - Must be a valid Unix file path.
378
+ * - Must match the ECMA regex: ^/[^/\0]*(/[^/\0]+)*[^/]$
379
+ * - Length must be less than 4096 characters.
380
+ * - Supported formats: GIF (.gif), JPEG (.jpg, .jpeg, .jfif, .pjpeg, .pjp),
381
+ * PNG (.png),
382
+ * SVG (.svg), WEBP (.webp), and AVIF (.avif).
383
+ *
384
+ * @generated from protobuf field: optional string logo = 4;
362
385
  */
363
- optional?: boolean;
364
- }
365
- /**
366
- * OAuth2Service defines the OAuth2 configuration required for a plugin.
367
- *
368
- * @generated from protobuf message mochabugapis.adapt.plugins.v1.OAuth2Service
369
- */
370
- export interface OAuth2Service {
386
+ logo?: string;
371
387
  /**
372
- * 'name' is the identifier for the OAuth2 service.
388
+ * 'type' specifies the type of the vertex.
373
389
  *
374
390
  * Restrictions:
375
- * - Must match the ECMA regex: ^[_$a-z][_$a-z0-9]*$
376
- * - Length must be greater than 0 and less than 50 characters.
377
- * Security implications:
378
- * - Should not contain sensitive information.
391
+ * - Must not be VERTEX_TYPE_UNSPECIFIED.
379
392
  *
380
- * @generated from protobuf field: string name = 1;
393
+ * @generated from protobuf field: mochabugapis.adapt.plugins.v1.Vertex.VertexType type = 5;
381
394
  */
382
- name: string;
395
+ type: Vertex_VertexType;
383
396
  /**
384
- * 'grant_type' specifies the OAuth2 grant type to be used.
397
+ * 'config' is an field that contains
398
+ * a Unix file path.
399
+ *
400
+ * Security implications:
401
+ * - Ensure that the file path points to a trusted location.
402
+ * - Validate and sanitize the JSON string before using it in your
403
+ * application.
385
404
  *
386
- * @generated from protobuf field: mochabugapis.adapt.plugins.v1.OAuth2Service.GrantType grant_type = 2;
405
+ * Restrictions:
406
+ * 1. a Unix file path:
407
+ * - Must match the ECMA regex: ^/[^/\0]*(/[^/\0]+)*[^/]$
408
+ * - Length must be less than 4096 characters.
409
+ * - Allowed format: .json
410
+ * 2. We always require a default config
411
+ * 3. plugin.cue#VertexConfig must validate the config
412
+ *
413
+ *
414
+ * @generated from protobuf field: string config = 6;
387
415
  */
388
- grantType: OAuth2Service_GrantType;
416
+ config: string;
389
417
  /**
390
- * 'auth_type' specifies the authentication type to be used.
418
+ * 'configurator' is a field to indicate whether or not
419
+ * the vertex has a configurator
391
420
  *
392
- * @generated from protobuf field: mochabugapis.adapt.plugins.v1.OAuth2Service.AuthType auth_type = 3;
421
+ * @generated from protobuf field: bool configurator = 7;
393
422
  */
394
- authType: OAuth2Service_AuthType;
423
+ configurator: boolean;
395
424
  /**
396
- * 'label' is an optional short label describing the purpose of the OAuth2
397
- * service.
425
+ * The variables field represents a list of EnvironemntalVariable instances for user-defined environmental variables.
398
426
  *
399
- * Restrictions:
400
- * - Length must be greater than 0 and less than 25 characters.
401
- * Security implications:
402
- * - Should not contain sensitive information.
427
+ * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.VariableService variables = 8;
428
+ */
429
+ variables: VariableService[];
430
+ /**
431
+ * The mtls field contains a list of MTLSService instances for user-defined mTLS services.
403
432
  *
404
- * @generated from protobuf field: optional string label = 4;
433
+ * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.MTLSService mtls = 9;
405
434
  */
406
- label?: string;
435
+ mtls: MTLSService[];
407
436
  /**
408
- * 'description' is a full description about the oauth2 and what it's used for
437
+ * The code_oauth2 field stores a list of bindings to the actual code flow definitions.
409
438
  *
410
- * Restrictions:
411
- * - Length must be greater than 0 and less than 250 characters.
412
- * Security implications:
413
- * - Should not contain sensitive information.
439
+ * If any of the OAuth2 services referred to in these bindings are not configured and are not marked as 'optional'
440
+ * in their respective ServiceBinding, the plugin might not be able to properly authenticate and authorize its operations.
414
441
  *
415
- * @generated from protobuf field: optional string description = 5;
442
+ * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.Oauth2CodeBinding code_oauth2 = 10;
416
443
  */
417
- description?: string;
444
+ codeOauth2: Oauth2CodeBinding[];
445
+ /**
446
+ * It's required that the client credentials grant type is set on this service
447
+ *
448
+ * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.Oauth2Service client_credentials_oauth2 = 11;
449
+ */
450
+ clientCredentialsOauth2: Oauth2Service[];
418
451
  }
419
452
  /**
420
- * GrantType represents the supported OAuth2 grant types.
453
+ * VertexType represents the type of a vertex.
421
454
  *
422
- * @generated from protobuf enum mochabugapis.adapt.plugins.v1.OAuth2Service.GrantType
455
+ * @generated from protobuf enum mochabugapis.adapt.plugins.v1.Vertex.VertexType
423
456
  */
424
- export declare enum OAuth2Service_GrantType {
457
+ export declare enum Vertex_VertexType {
425
458
  /**
426
- * GRANT_TYPE_UNSPECIFIED indicates an unspecified or invalid grant type.
459
+ * Unspecified type (default value, should not be used).
427
460
  *
428
- * @generated from protobuf enum value: GRANT_TYPE_UNSPECIFIED = 0;
461
+ * @generated from protobuf enum value: VERTEX_TYPE_UNSPECIFIED = 0;
429
462
  */
430
463
  UNSPECIFIED = 0,
431
464
  /**
432
- * GRANT_TYPE_CODE represents the authorization code grant type.
433
- * Access tokens are issued on a per-user basis.
465
+ * Action type, available in all contexts and not exposed to the outside
466
+ * world. This type has a lower security risk.
467
+ *
468
+ * @generated from protobuf enum value: VERTEX_TYPE_ACTION = 1;
469
+ */
470
+ ACTION = 1,
471
+ /**
472
+ * Browser type, available only in a browser context.
473
+ * The configuration always runs inside a browser context.
474
+ * Security implications: be cautious about potentially sensitive data
475
+ * exposure.
476
+ *
477
+ * @generated from protobuf enum value: VERTEX_TYPE_BROWSER = 2;
478
+ */
479
+ BROWSER = 2,
480
+ /**
481
+ * CronTrigger type, available only in a trigger context.
482
+ * Triggered at specific intervals.
434
483
  *
435
- * @generated from protobuf enum value: GRANT_TYPE_CODE = 1;
484
+ * @generated from protobuf enum value: VERTEX_TYPE_CRON_TRIGGER = 3;
436
485
  */
437
- CODE = 1,
486
+ CRON_TRIGGER = 3,
438
487
  /**
439
- * GRANT_TYPE_CLIENT_CREDENTIALS represents the client credentials grant
440
- * type. Access tokens are issued globally for the plugin.
488
+ * ExternalTrigger type, available only in a trigger context.
489
+ * Accessible via a publicly routable address.
490
+ * Security implications: be cautious about exposing sensitive data or
491
+ * functionality.
441
492
  *
442
- * @generated from protobuf enum value: GRANT_TYPE_CLIENT_CREDENTIALS = 2;
493
+ * @generated from protobuf enum value: VERTEX_TYPE_EXTERNAL_TRIGGER = 4;
443
494
  */
444
- CLIENT_CREDENTIALS = 2
495
+ EXTERNAL_TRIGGER = 4
445
496
  }
446
497
  /**
447
- * The oauth2 auth type. It has to be specified in the manifest
448
- * since user defined client credentials will not support changing the auth type on the fly
498
+ * MTLSService represents a mutual Transport Layer Security (mTLS) service
499
+ * configuration required by the plugin. mTLS provides secure communication
500
+ * between client and server by authenticating both parties and encrypting the
501
+ * communication.
449
502
  *
450
- * @generated from protobuf enum mochabugapis.adapt.plugins.v1.OAuth2Service.AuthType
503
+ * @generated from protobuf message mochabugapis.adapt.plugins.v1.MTLSService
451
504
  */
452
- export declare enum OAuth2Service_AuthType {
505
+ export interface MTLSService {
453
506
  /**
454
- * Not specified
507
+ * 'name' is the identifier of the mTLS service.
508
+ * It's used for referencing the specific mTLS configuration.
455
509
  *
456
- * @generated from protobuf enum value: AUTH_TYPE_UNSPECIFIED = 0;
457
- */
458
- UNSPECIFIED = 0,
459
- /**
460
- * Use basic authentication
510
+ * Restrictions:
511
+ * - Must match the ECMA regex: ^[_$a-z][_$a-z0-9]*$
512
+ * - Length must be greater than 0 and less than 50 characters.
513
+ * Security implications:
514
+ * - Should not contain sensitive information.
461
515
  *
462
- * @generated from protobuf enum value: AUTH_TYPE_BASIC = 1;
516
+ * @generated from protobuf field: string name = 1;
463
517
  */
464
- BASIC = 1,
518
+ name: string;
465
519
  /**
466
- * Use form authentication
520
+ * 'label' is an optional short label describing the purpose of the mTLS
521
+ * service.
467
522
  *
468
- * @generated from protobuf enum value: AUTH_TYPE_FORM = 2;
523
+ * Restrictions:
524
+ * - Length must be greater than 0 and less than 25 characters.
525
+ * Security implications:
526
+ * - Should not contain sensitive information.
527
+ *
528
+ * @generated from protobuf field: optional string label = 2;
469
529
  */
470
- FORM = 2,
530
+ label?: string;
471
531
  /**
472
- * The private key
532
+ * 'description' is an optional detailed description of the mTLS service and
533
+ * its usage within the plugin.
473
534
  *
474
- * @generated from protobuf enum value: AUTH_TYPE_PRIVATE_KEY = 3;
535
+ * Restrictions:
536
+ * - Length must be less than 250 characters.
537
+ * Security implications:
538
+ * - Should not contain sensitive information.
539
+ *
540
+ * @generated from protobuf field: optional string description = 3;
475
541
  */
476
- PRIVATE_KEY = 3,
542
+ description?: string;
477
543
  /**
478
- * The mtls auth
544
+ * Unset or false means the variable is required
545
+ * true means the mtls service is optional
479
546
  *
480
- * @generated from protobuf enum value: AUTH_TYPE_MTLS = 4;
547
+ * @generated from protobuf field: optional bool optional = 4;
481
548
  */
482
- MTLS = 4
549
+ optional?: boolean;
483
550
  }
484
551
  /**
485
- * A representation of an environmental variable.
552
+ * A representation of a variable.
486
553
  *
487
- * This message represents an environmental variable used within the hosting platform.
554
+ * This message represents a variable used within the hosting platform.
488
555
  * Environmental variables are essential for configuring applications and services hosted on the platform.
489
556
  * They store values that can be accessed by the application or service during runtime.
490
557
  *
491
- * @generated from protobuf message mochabugapis.adapt.plugins.v1.EnvironmentalVariable
558
+ * @generated from protobuf message mochabugapis.adapt.plugins.v1.VariableService
492
559
  */
493
- export interface EnvironmentalVariable {
560
+ export interface VariableService {
494
561
  /**
495
562
  * 'name' is the identifier of the variable, which is referenced where needed.
496
563
  *
@@ -535,9 +602,9 @@ export interface EnvironmentalVariable {
535
602
  * - TYPE_STRING: Indicates that the variable will hold a string value. Strings are commonly used for configuration settings.
536
603
  * - TYPE_SWITCH: Indicates that the variable is a boolean value. It can have either true or false as its value.
537
604
  *
538
- * @generated from protobuf field: mochabugapis.adapt.plugins.v1.EnvironmentalVariable.Type type = 4;
605
+ * @generated from protobuf field: mochabugapis.adapt.plugins.v1.VariableService.Type type = 4;
539
606
  */
540
- type: EnvironmentalVariable_Type;
607
+ type: VariableService_Type;
541
608
  /**
542
609
  * Unset or false means the variable is required
543
610
  * true means the variable is optional
@@ -549,9 +616,9 @@ export interface EnvironmentalVariable {
549
616
  /**
550
617
  * The type of variable
551
618
  *
552
- * @generated from protobuf enum mochabugapis.adapt.plugins.v1.EnvironmentalVariable.Type
619
+ * @generated from protobuf enum mochabugapis.adapt.plugins.v1.VariableService.Type
553
620
  */
554
- export declare enum EnvironmentalVariable_Type {
621
+ export declare enum VariableService_Type {
555
622
  /**
556
623
  * The type is not specified. Invalid value
557
624
  *
@@ -578,53 +645,13 @@ export declare enum EnvironmentalVariable_Type {
578
645
  SWITCH = 3
579
646
  }
580
647
  /**
581
- * The ServiceBinding message represents a binding to a OAuth2Service.
582
- *
583
- * Each ServiceBinding instance denotes a requirement of a OAuth2Service.
584
- * The binding points to the required service by its 'name' and indicates whether the service is 'optional' or required.
585
- *
586
- * @generated from protobuf message mochabugapis.adapt.plugins.v1.ServiceBinding
587
- */
588
- export interface ServiceBinding {
589
- /**
590
- * The 'name' field specifies the name of the service to bind to. The name should match the 'name' field of
591
- * the corresponding OAuth2Service.
592
- *
593
- * @generated from protobuf field: string name = 1;
594
- */
595
- name: string;
596
- /**
597
- * The 'optional' field indicates whether the service binding is optional or required. If 'optional' is
598
- * set to true, the service is not strictly required and the plugin can function without it. If 'optional'
599
- * is set to false, the service is required and the plugin might fail if it is not properly configured.
600
- *
601
- * @generated from protobuf field: optional bool optional = 2;
602
- */
603
- optional?: boolean;
604
- }
605
- /**
606
- * Vertex represents a graph vertex that defines a plugin.
607
- * The ES module names and entry points follow a convention for the executor and
608
- * configurators files:
609
- * - export {<vertex-name>InternalConfigurator} for the internal endpoint of the
610
- * vertex configurator
611
- * - export {<vertex-name>ExternalConfigurator} for the external endpoint of the
612
- * vertex configurator
613
- * - export {<vertex-name>InternalExecutor} for the internal endpoint of the
614
- * vertex executor
615
- * - export {<vertex-name>ExternalExecutor} for the external endpoint of the
616
- * vertex executor
617
- *
618
- *
619
- * Note: Be aware of potential security implications when dealing with
620
- * user-provided data, such as file paths, and ensure proper input validation
621
- * and sanitization.
648
+ * Oauth2 related to user tokens
622
649
  *
623
- * @generated from protobuf message mochabugapis.adapt.plugins.v1.Vertex
650
+ * @generated from protobuf message mochabugapis.adapt.plugins.v1.Oauth2Service
624
651
  */
625
- export interface Vertex {
652
+ export interface Oauth2Service {
626
653
  /**
627
- * 'name' represents the vertex name.
654
+ * 'name' is the identifier for the OAuth2 service.
628
655
  *
629
656
  * Restrictions:
630
657
  * - Must match the ECMA regex: ^[_$a-z][_$a-z0-9]*$
@@ -636,19 +663,19 @@ export interface Vertex {
636
663
  */
637
664
  name: string;
638
665
  /**
639
- * 'label' is a human-friendly label shown in the UI.
666
+ * 'label' is an optional short label describing the purpose of the OAuth2
667
+ * service.
640
668
  *
641
669
  * Restrictions:
642
670
  * - Length must be greater than 0 and less than 25 characters.
643
671
  * Security implications:
644
672
  * - Should not contain sensitive information.
645
673
  *
646
- * @generated from protobuf field: string label = 2;
674
+ * @generated from protobuf field: optional string label = 2;
647
675
  */
648
- label: string;
676
+ label?: string;
649
677
  /**
650
- * 'description' is a human-friendly short description of the vertex displayed
651
- * in UI.
678
+ * 'description' is a full description about the oauth2 and what it's used for
652
679
  *
653
680
  * Restrictions:
654
681
  * - Length must be greater than 0 and less than 250 characters.
@@ -659,129 +686,169 @@ export interface Vertex {
659
686
  */
660
687
  description?: string;
661
688
  /**
662
- * 'logo' is the file path to the vertex logo, which will be resized to a
663
- * maximum of 40x40 pixels. Ensure that the logo files are from trusted
664
- * sources to avoid security risks.
689
+ * Set if the grant type is a code flow
665
690
  *
666
- * Restrictions:
667
- * - Must be a valid Unix file path.
668
- * - Must match the ECMA regex: ^/[^/\0]*(/[^/\0]+)*[^/]$
669
- * - Length must be less than 4096 characters.
670
- * - Supported formats: GIF (.gif), JPEG (.jpg, .jpeg, .jfif, .pjpeg, .pjp),
671
- * PNG (.png),
672
- * SVG (.svg), WEBP (.webp), and AVIF (.avif).
691
+ * @generated from protobuf field: optional mochabugapis.adapt.plugins.v1.Oauth2Code code = 4;
692
+ */
693
+ code?: Oauth2Code;
694
+ /**
695
+ * Unset or false means the variable is required
696
+ * true means the variable is optional
697
+ * Ignored for code flows since they are always required
673
698
  *
674
- * @generated from protobuf field: optional string logo = 4;
699
+ * @generated from protobuf field: optional bool optional = 5;
675
700
  */
676
- logo?: string;
701
+ optional?: boolean;
677
702
  /**
678
- * 'type' specifies the type of the vertex.
703
+ * The required scopes
679
704
  *
680
- * Restrictions:
681
- * - Must not be VERTEX_TYPE_UNSPECIFIED.
705
+ * @generated from protobuf field: repeated string scopes = 6;
706
+ */
707
+ scopes: string[];
708
+ /**
709
+ * The required auth method
682
710
  *
683
- * @generated from protobuf field: mochabugapis.adapt.plugins.v1.Vertex.VertexType type = 5;
711
+ * @generated from protobuf field: mochabugapis.adapt.plugins.v1.Oauth2AuthType auth_method = 7;
684
712
  */
685
- type: Vertex_VertexType;
713
+ authMethod: Oauth2AuthType;
686
714
  /**
687
- * 'config' is an field that contains
688
- * a Unix file path.
715
+ * Optional algorithm that is required if using private JWT auth
689
716
  *
690
- * Security implications:
691
- * - Ensure that the file path points to a trusted location.
692
- * - Validate and sanitize the JSON string before using it in your
693
- * application.
717
+ * @generated from protobuf field: optional mochabugapis.adapt.plugins.v1.PrivateJWTAlg alg = 8;
718
+ */
719
+ alg?: PrivateJWTAlg;
720
+ /**
721
+ * Not required for user accounts
694
722
  *
695
- * Restrictions:
696
- * 1. a Unix file path:
697
- * - Must match the ECMA regex: ^/[^/\0]*(/[^/\0]+)*[^/]$
698
- * - Length must be less than 4096 characters.
699
- * - Allowed format: .json
700
- * 2. We always require a default config
701
- * 3. plugin.cue#VertexConfig must validate the config
723
+ * @generated from protobuf field: optional string client_id = 9;
724
+ */
725
+ clientId?: string;
726
+ /**
727
+ * The required token endpoint
702
728
  *
729
+ * @generated from protobuf field: string token_endpoint = 10;
730
+ */
731
+ tokenEndpoint: string;
732
+ }
733
+ /**
734
+ * Represents a binding to a code service
735
+ *
736
+ * The binding points to the required service by its 'name' and indicates whether the service is 'optional' or required.
737
+ *
738
+ * @generated from protobuf message mochabugapis.adapt.plugins.v1.Oauth2CodeBinding
739
+ */
740
+ export interface Oauth2CodeBinding {
741
+ /**
742
+ * The 'name' field specifies the name of the service to bind to. The name should match the 'name' field of
743
+ * the corresponding OAuth2Service.
703
744
  *
704
- * @generated from protobuf field: string config = 6;
745
+ * @generated from protobuf field: string name = 1;
705
746
  */
706
- config: string;
747
+ name: string;
707
748
  /**
708
- * 'configurator' is a field to indicate whether or not
709
- * the vertex has a configurator. That is: if it exports in the configurator:
710
- * - export {<vertex-name>InternalConfigurator} for the internal endpoint of the
711
- * vertex configurator
712
- * - export {<vertex-name>ExternalConfigurator} for the external endpoint of the
713
- * vertex configurator
749
+ * The 'optional' field indicates whether the service binding is optional or required. If 'optional' is
750
+ * set to true, the service is not strictly required and the plugin can function without it. If 'optional'
751
+ * is set to false, the service is required and the plugin might fail if it is not properly configured.
714
752
  *
715
- * @generated from protobuf field: bool configurator = 7;
753
+ * @generated from protobuf field: optional bool optional = 2;
716
754
  */
717
- configurator: boolean;
755
+ optional?: boolean;
756
+ }
757
+ /**
758
+ * The code grant type
759
+ * IMPORTANT: it has to be configured with refresh token in order to work correctly
760
+ * this is not needed for client credentials of course since we are owning the client
761
+ *
762
+ * @generated from protobuf message mochabugapis.adapt.plugins.v1.Oauth2Code
763
+ */
764
+ export interface Oauth2Code {
718
765
  /**
719
- * The variables field represents a list of EnvironemntalVariable instances for user-defined environmental variables.
766
+ * The auth endpoint (i.e. where it gets redirected for login)
720
767
  *
721
- * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.EnvironmentalVariable variables = 8;
768
+ * @generated from protobuf field: string auth_endpoint = 1;
722
769
  */
723
- variables: EnvironmentalVariable[];
770
+ authEndpoint: string;
724
771
  /**
725
- * The mtls field contains a list of MTLSService instances for user-defined mTLS services.
772
+ * Use OIDC flow
773
+ * True if we're using the OpenID connect protocol
774
+ * False if we're using the standard OAuth2 protocolƒ
726
775
  *
727
- * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.MTLSService mtls = 9;
776
+ * @generated from protobuf field: bool use_oidc = 2;
728
777
  */
729
- mtls: MTLSService[];
778
+ useOidc: boolean;
730
779
  /**
731
- * The oauth2 field stores a list of ServiceBinding instances for OAuth2 services.
780
+ * Additional parameters used for the oauth2 login endpoint
781
+ * Do not include state or nonce here since we're generating them
782
+ * in the backend
732
783
  *
733
- * Each ServiceBinding in this list refers to an OAuth2 service required by the plugin for its functioning.
734
- * If any of the OAuth2 services referred to in these bindings are not configured and are not marked as 'optional'
735
- * in their respective ServiceBinding, the plugin might not be able to properly authenticate and authorize its operations.
784
+ * @generated from protobuf field: map<string, string> additional_params = 3;
785
+ */
786
+ additionalParams: {
787
+ [key: string]: string;
788
+ };
789
+ /**
790
+ * Whether or not to use the PKCE extension
736
791
  *
737
- * @generated from protobuf field: repeated mochabugapis.adapt.plugins.v1.ServiceBinding oauth2 = 10;
792
+ * @generated from protobuf field: bool use_pkce = 4;
738
793
  */
739
- oauth2: ServiceBinding[];
794
+ usePkce: boolean;
740
795
  }
741
796
  /**
742
- * VertexType represents the type of a vertex.
797
+ * The algorithm used for the signing
743
798
  *
744
- * @generated from protobuf enum mochabugapis.adapt.plugins.v1.Vertex.VertexType
799
+ * @generated from protobuf enum mochabugapis.adapt.plugins.v1.PrivateJWTAlg
745
800
  */
746
- export declare enum Vertex_VertexType {
801
+ export declare enum PrivateJWTAlg {
747
802
  /**
748
- * Unspecified type (default value, should not be used).
803
+ * Unkown algorithm
749
804
  *
750
- * @generated from protobuf enum value: VERTEX_TYPE_UNSPECIFIED = 0;
805
+ * @generated from protobuf enum value: PRIVATE_JWT_ALG_UNSPECIFIED = 0;
806
+ */
807
+ PRIVATE_JWT_ALG_UNSPECIFIED = 0,
808
+ /**
809
+ * RS256 algorithm
810
+ *
811
+ * @generated from protobuf enum value: PRIVATE_JWT_ALG_RS256 = 1;
812
+ */
813
+ PRIVATE_JWT_ALG_RS256 = 1
814
+ }
815
+ /**
816
+ * The oauth2 auth type. It has to be specified in the manifest
817
+ * since user defined client credentials will not support changing the auth type on the fly
818
+ *
819
+ * @generated from protobuf enum mochabugapis.adapt.plugins.v1.Oauth2AuthType
820
+ */
821
+ export declare enum Oauth2AuthType {
822
+ /**
823
+ * Not specified
824
+ *
825
+ * @generated from protobuf enum value: OAUTH2_AUTH_TYPE_UNSPECIFIED = 0;
751
826
  */
752
827
  UNSPECIFIED = 0,
753
828
  /**
754
- * Action type, available in all contexts and not exposed to the outside
755
- * world. This type has a lower security risk.
829
+ * Use basic authentication
756
830
  *
757
- * @generated from protobuf enum value: VERTEX_TYPE_ACTION = 1;
831
+ * @generated from protobuf enum value: OAUTH2_AUTH_TYPE_BASIC = 1;
758
832
  */
759
- ACTION = 1,
833
+ BASIC = 1,
760
834
  /**
761
- * Browser type, available only in a browser context.
762
- * The configuration always runs inside a browser context.
763
- * Security implications: be cautious about potentially sensitive data
764
- * exposure.
835
+ * Use form authentication
765
836
  *
766
- * @generated from protobuf enum value: VERTEX_TYPE_BROWSER = 2;
837
+ * @generated from protobuf enum value: OAUTH2_AUTH_TYPE_FORM = 2;
767
838
  */
768
- BROWSER = 2,
839
+ FORM = 2,
769
840
  /**
770
- * CronTrigger type, available only in a trigger context.
771
- * Triggered at specific intervals.
841
+ * The private key
772
842
  *
773
- * @generated from protobuf enum value: VERTEX_TYPE_CRON_TRIGGER = 3;
843
+ * @generated from protobuf enum value: OAUTH2_AUTH_TYPE_PRIVATE_KEY = 3;
774
844
  */
775
- CRON_TRIGGER = 3,
845
+ PRIVATE_KEY = 3,
776
846
  /**
777
- * ExternalTrigger type, available only in a trigger context.
778
- * Accessible via a publicly routable address.
779
- * Security implications: be cautious about exposing sensitive data or
780
- * functionality.
847
+ * The mtls auth
781
848
  *
782
- * @generated from protobuf enum value: VERTEX_TYPE_EXTERNAL_TRIGGER = 4;
849
+ * @generated from protobuf enum value: OAUTH2_AUTH_TYPE_MTLS = 4;
783
850
  */
784
- EXTERNAL_TRIGGER = 4
851
+ MTLS = 4
785
852
  }
786
853
  declare class UploadPluginRequest$Type extends MessageType<UploadPluginRequest> {
787
854
  constructor();
@@ -823,6 +890,16 @@ declare class Manifest$Type extends MessageType<Manifest> {
823
890
  * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.Manifest
824
891
  */
825
892
  export declare const Manifest: Manifest$Type;
893
+ declare class Vertex$Type extends MessageType<Vertex> {
894
+ constructor();
895
+ create(value?: PartialMessage<Vertex>): Vertex;
896
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Vertex): Vertex;
897
+ internalBinaryWrite(message: Vertex, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
898
+ }
899
+ /**
900
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.Vertex
901
+ */
902
+ export declare const Vertex: Vertex$Type;
826
903
  declare class MTLSService$Type extends MessageType<MTLSService> {
827
904
  constructor();
828
905
  create(value?: PartialMessage<MTLSService>): MTLSService;
@@ -833,46 +910,47 @@ declare class MTLSService$Type extends MessageType<MTLSService> {
833
910
  * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.MTLSService
834
911
  */
835
912
  export declare const MTLSService: MTLSService$Type;
836
- declare class OAuth2Service$Type extends MessageType<OAuth2Service> {
913
+ declare class VariableService$Type extends MessageType<VariableService> {
837
914
  constructor();
838
- create(value?: PartialMessage<OAuth2Service>): OAuth2Service;
839
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OAuth2Service): OAuth2Service;
840
- internalBinaryWrite(message: OAuth2Service, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
915
+ create(value?: PartialMessage<VariableService>): VariableService;
916
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VariableService): VariableService;
917
+ internalBinaryWrite(message: VariableService, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
841
918
  }
842
919
  /**
843
- * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.OAuth2Service
920
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.VariableService
844
921
  */
845
- export declare const OAuth2Service: OAuth2Service$Type;
846
- declare class EnvironmentalVariable$Type extends MessageType<EnvironmentalVariable> {
922
+ export declare const VariableService: VariableService$Type;
923
+ declare class Oauth2Service$Type extends MessageType<Oauth2Service> {
847
924
  constructor();
848
- create(value?: PartialMessage<EnvironmentalVariable>): EnvironmentalVariable;
849
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnvironmentalVariable): EnvironmentalVariable;
850
- internalBinaryWrite(message: EnvironmentalVariable, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
925
+ create(value?: PartialMessage<Oauth2Service>): Oauth2Service;
926
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Oauth2Service): Oauth2Service;
927
+ internalBinaryWrite(message: Oauth2Service, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
851
928
  }
852
929
  /**
853
- * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.EnvironmentalVariable
930
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.Oauth2Service
854
931
  */
855
- export declare const EnvironmentalVariable: EnvironmentalVariable$Type;
856
- declare class ServiceBinding$Type extends MessageType<ServiceBinding> {
932
+ export declare const Oauth2Service: Oauth2Service$Type;
933
+ declare class Oauth2CodeBinding$Type extends MessageType<Oauth2CodeBinding> {
857
934
  constructor();
858
- create(value?: PartialMessage<ServiceBinding>): ServiceBinding;
859
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ServiceBinding): ServiceBinding;
860
- internalBinaryWrite(message: ServiceBinding, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
935
+ create(value?: PartialMessage<Oauth2CodeBinding>): Oauth2CodeBinding;
936
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Oauth2CodeBinding): Oauth2CodeBinding;
937
+ internalBinaryWrite(message: Oauth2CodeBinding, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
861
938
  }
862
939
  /**
863
- * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.ServiceBinding
940
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.Oauth2CodeBinding
864
941
  */
865
- export declare const ServiceBinding: ServiceBinding$Type;
866
- declare class Vertex$Type extends MessageType<Vertex> {
942
+ export declare const Oauth2CodeBinding: Oauth2CodeBinding$Type;
943
+ declare class Oauth2Code$Type extends MessageType<Oauth2Code> {
867
944
  constructor();
868
- create(value?: PartialMessage<Vertex>): Vertex;
869
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Vertex): Vertex;
870
- internalBinaryWrite(message: Vertex, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
945
+ create(value?: PartialMessage<Oauth2Code>): Oauth2Code;
946
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Oauth2Code): Oauth2Code;
947
+ private binaryReadMap3;
948
+ internalBinaryWrite(message: Oauth2Code, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
871
949
  }
872
950
  /**
873
- * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.Vertex
951
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.Oauth2Code
874
952
  */
875
- export declare const Vertex: Vertex$Type;
953
+ export declare const Oauth2Code: Oauth2Code$Type;
876
954
  /**
877
955
  * @generated ServiceType for protobuf service mochabugapis.adapt.plugins.v1.PluginService
878
956
  */