@kwirthmagnify/kwirth-common-back 0.5.14 → 0.5.16

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.
@@ -0,0 +1,44 @@
1
+ export declare enum EIdpConnectorKind {
2
+ OIDC = "oidc",
3
+ OAUTH2 = "oauth2"
4
+ }
5
+ export type IdpFieldType = 'text' | 'number' | 'boolean' | 'password';
6
+ export interface IIdpConfigFieldDef {
7
+ name: string;
8
+ label: string;
9
+ type?: IdpFieldType;
10
+ required?: boolean;
11
+ options?: string[];
12
+ }
13
+ export interface IIdpIdentity {
14
+ email: string;
15
+ emailVerified: boolean;
16
+ name?: string;
17
+ sub?: string;
18
+ }
19
+ export interface IIdpAuthContext {
20
+ redirectUri: string;
21
+ state: string;
22
+ codeChallenge: string;
23
+ }
24
+ export interface IIdpCallbackContext {
25
+ code: string;
26
+ codeVerifier: string;
27
+ redirectUri: string;
28
+ }
29
+ export interface IIdpConnector {
30
+ connectorId: string;
31
+ label: string;
32
+ kind: EIdpConnectorKind;
33
+ getConfigSchema(): IIdpConfigFieldDef[];
34
+ buildAuthorizationUrl(config: Record<string, unknown>, ctx: IIdpAuthContext): Promise<string> | string;
35
+ handleCallback(config: Record<string, unknown>, ctx: IIdpCallbackContext): Promise<IIdpIdentity>;
36
+ }
37
+ export interface IIdpInstanceConfig {
38
+ id: string;
39
+ connectorId: string;
40
+ label: string;
41
+ enabled: boolean;
42
+ config: Record<string, unknown>;
43
+ }
44
+ export type TIdpConnectorConstructor = new () => IIdpConnector;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /*
3
+ Interfaz de conector de Identity Provider (IdP) para Kwirth.
4
+
5
+ Un conector es LOGICA PURA (sin rutas propias): construye la URL de autorizacion del IdP
6
+ y procesa el callback devolviendo la identidad verificada. El flujo HTTP pre-login y la
7
+ emision de AccessKey viven en el core de Kwirth, nunca en el conector.
8
+
9
+ Vive en common-back para que los conectores empaquetados por separado (idps/<id>/) puedan
10
+ implementarlo importando '@kwirthmagnify/kwirth-common-back', igual que ISender/IProvider.
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.EIdpConnectorKind = void 0;
14
+ var EIdpConnectorKind;
15
+ (function (EIdpConnectorKind) {
16
+ EIdpConnectorKind["OIDC"] = "oidc";
17
+ EIdpConnectorKind["OAUTH2"] = "oauth2";
18
+ })(EIdpConnectorKind || (exports.EIdpConnectorKind = EIdpConnectorKind = {}));
@@ -16,6 +16,8 @@ export interface IProvider {
16
16
  readonly requiresApiKeyApi: boolean;
17
17
  addSubscriber(c: IProviderSubscriber, data: any): Promise<void>;
18
18
  removeSubscriber(c: IProviderSubscriber): Promise<void>;
19
+ updateSubscription?(c: IProviderSubscriber, data: any): Promise<void>;
20
+ configure?(config: Record<string, unknown>): void;
19
21
  startProvider(): Promise<void>;
20
22
  stopProvider(): Promise<void>;
21
23
  router: any;
package/dist/index.d.ts CHANGED
@@ -2,5 +2,6 @@ export * from './IChannel';
2
2
  export * from './IDaemon';
3
3
  export * from './IProvider';
4
4
  export * from './ISender';
5
+ export * from './IIdpConnector';
5
6
  export * from './KubernetesTools';
6
7
  export * from '@kwirthmagnify/kwirth-common';
package/dist/index.js CHANGED
@@ -18,5 +18,6 @@ __exportStar(require("./IChannel"), exports);
18
18
  __exportStar(require("./IDaemon"), exports);
19
19
  __exportStar(require("./IProvider"), exports);
20
20
  __exportStar(require("./ISender"), exports);
21
+ __exportStar(require("./IIdpConnector"), exports);
21
22
  __exportStar(require("./KubernetesTools"), exports);
22
23
  __exportStar(require("@kwirthmagnify/kwirth-common"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common-back",
3
- "version": "0.5.14",
3
+ "version": "0.5.16",
4
4
  "description": "Backend interfaces for building Kwirth provider and channel plugins",
5
5
  "scripts": {
6
6
  "build": "tsc"