@fiado/api-invoker 4.7.0 → 4.8.0
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/bin/cognitoBackofficeConnector/api/CognitoBackofficeConnectorApi.d.ts +3 -2
- package/bin/cognitoBackofficeConnector/api/CognitoBackofficeConnectorApi.js +5 -1
- package/bin/cognitoBackofficeConnector/api/interfaces/ICognitoBackofficeConnectorApi.d.ts +7 -1
- package/package.json +2 -2
- package/src/cognitoBackofficeConnector/api/CognitoBackofficeConnectorApi.ts +11 -2
- package/src/cognitoBackofficeConnector/api/interfaces/ICognitoBackofficeConnectorApi.ts +12 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
|
-
import { CreateUserRequest, CreateUserResponse, UpdateUserAttributesRequest, UserActionRequest, ResendInvitationRequest, UserDetailResponse, AuthEventsRequest, AuthEventResponse, InitiateAuthRequest, InitiateAuthResponse, RespondToChallengeRequest, RespondToChallengeResponse, RefreshTokensRequest, RefreshTokensResponse, ForgotPasswordRequest, ConfirmForgotPasswordRequest, ResendConfirmationRequest, ChangePasswordRequest, TotpBeginRequest, TotpBeginResponse, TotpVerifyRequest, MfaVerifyResponse, SetMfaPreferenceRequest, MfaResetRequest, UpdateEmailRequest, VerifyEmailRequest, UpdateProfileRequest, CreatePoolRequest, CreatePoolResponse, HealthcheckResponse } from "@fiado/type-kit/bin/cognitoBackofficeConnector";
|
|
3
|
+
import { CreateUserRequest, CreateUserResponse, UpdateUserAttributesRequest, UserActionRequest, ResendInvitationRequest, UserDetailResponse, AuthEventsRequest, AuthEventResponse, InitiateAuthRequest, InitiateAuthResponse, RespondToChallengeRequest, RespondToChallengeResponse, RefreshTokensRequest, RefreshTokensResponse, ForgotPasswordRequest, ConfirmForgotPasswordRequest, ResendConfirmationRequest, ChangePasswordRequest, TotpBeginRequest, TotpBeginResponse, TotpVerifyRequest, MfaVerifyResponse, SetMfaPreferenceRequest, MfaResetRequest, UpdateEmailRequest, VerifyEmailRequest, UpdateProfileRequest, CreatePoolRequest, CreatePoolResponse, HealthcheckResponse, VerifyPasswordRequest, VerifyPasswordResponse } from "@fiado/type-kit/bin/cognitoBackofficeConnector";
|
|
4
4
|
import { ICognitoBackofficeConnectorApi } from "./interfaces/ICognitoBackofficeConnectorApi";
|
|
5
5
|
/**
|
|
6
6
|
* Publisher HTTP del lambda `cognito-backoffice-connector` (componente 05 SureKeep Fase 0).
|
|
@@ -36,6 +36,7 @@ export default class CognitoBackofficeConnectorApi implements ICognitoBackoffice
|
|
|
36
36
|
setMfaPreference(input: SetMfaPreferenceRequest): Promise<ApiGatewayResponse<void>>;
|
|
37
37
|
resetUserMfa(cognitoSub: string, input: MfaResetRequest): Promise<ApiGatewayResponse<void>>;
|
|
38
38
|
authInitiate(input: InitiateAuthRequest): Promise<ApiGatewayResponse<InitiateAuthResponse>>;
|
|
39
|
+
authVerifyPassword(input: VerifyPasswordRequest): Promise<ApiGatewayResponse<VerifyPasswordResponse>>;
|
|
39
40
|
authRespondChallenge(input: RespondToChallengeRequest): Promise<ApiGatewayResponse<RespondToChallengeResponse>>;
|
|
40
41
|
authRefreshTokens(input: RefreshTokensRequest): Promise<ApiGatewayResponse<RefreshTokensResponse>>;
|
|
41
42
|
authForgotPassword(input: ForgotPasswordRequest): Promise<ApiGatewayResponse<void>>;
|
|
@@ -86,11 +86,15 @@ let CognitoBackofficeConnectorApi = class CognitoBackofficeConnectorApi {
|
|
|
86
86
|
const url = `${this.baseUrl}/users/${encodeURIComponent(cognitoSub)}/mfa/reset`;
|
|
87
87
|
return await this.httpRequest.post(url, input);
|
|
88
88
|
}
|
|
89
|
-
// ============= Auth flow no-admin BFF M18 (
|
|
89
|
+
// ============= Auth flow no-admin BFF M18 (8) =============
|
|
90
90
|
async authInitiate(input) {
|
|
91
91
|
const url = `${this.baseUrl}/auth/initiate`;
|
|
92
92
|
return await this.httpRequest.post(url, input);
|
|
93
93
|
}
|
|
94
|
+
async authVerifyPassword(input) {
|
|
95
|
+
const url = `${this.baseUrl}/auth/verify-password`;
|
|
96
|
+
return await this.httpRequest.post(url, input);
|
|
97
|
+
}
|
|
94
98
|
async authRespondChallenge(input) {
|
|
95
99
|
const url = `${this.baseUrl}/auth/respond-challenge`;
|
|
96
100
|
return await this.httpRequest.post(url, input);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
-
import { CreateUserRequest, CreateUserResponse, UpdateUserAttributesRequest, UserActionRequest, ResendInvitationRequest, UserDetailResponse, AuthEventsRequest, AuthEventResponse, InitiateAuthRequest, InitiateAuthResponse, RespondToChallengeRequest, RespondToChallengeResponse, RefreshTokensRequest, RefreshTokensResponse, ForgotPasswordRequest, ConfirmForgotPasswordRequest, ResendConfirmationRequest, ChangePasswordRequest, TotpBeginRequest, TotpBeginResponse, TotpVerifyRequest, MfaVerifyResponse, SetMfaPreferenceRequest, MfaResetRequest, UpdateEmailRequest, VerifyEmailRequest, UpdateProfileRequest, CreatePoolRequest, CreatePoolResponse, HealthcheckResponse } from "@fiado/type-kit/bin/cognitoBackofficeConnector";
|
|
2
|
+
import { CreateUserRequest, CreateUserResponse, UpdateUserAttributesRequest, UserActionRequest, ResendInvitationRequest, UserDetailResponse, AuthEventsRequest, AuthEventResponse, InitiateAuthRequest, InitiateAuthResponse, RespondToChallengeRequest, RespondToChallengeResponse, RefreshTokensRequest, RefreshTokensResponse, ForgotPasswordRequest, ConfirmForgotPasswordRequest, ResendConfirmationRequest, ChangePasswordRequest, TotpBeginRequest, TotpBeginResponse, TotpVerifyRequest, MfaVerifyResponse, SetMfaPreferenceRequest, MfaResetRequest, UpdateEmailRequest, VerifyEmailRequest, UpdateProfileRequest, CreatePoolRequest, CreatePoolResponse, HealthcheckResponse, VerifyPasswordRequest, VerifyPasswordResponse } from "@fiado/type-kit/bin/cognitoBackofficeConnector";
|
|
3
3
|
/**
|
|
4
4
|
* Contrato del publisher HTTP del lambda `cognito-backoffice-connector` (componente 05 SureKeep Fase 0).
|
|
5
5
|
*
|
|
@@ -44,6 +44,12 @@ export interface ICognitoBackofficeConnectorApi {
|
|
|
44
44
|
resetUserMfa(cognitoSub: string, input: MfaResetRequest): Promise<ApiGatewayResponse<void>>;
|
|
45
45
|
/** POST /auth/initiate — inicia auth flow no-admin (devuelve tokens o challenge). */
|
|
46
46
|
authInitiate(input: InitiateAuthRequest): Promise<ApiGatewayResponse<InitiateAuthResponse>>;
|
|
47
|
+
/**
|
|
48
|
+
* POST /auth/verify-password — valida un password contra Cognito (DEC-AUTH-012).
|
|
49
|
+
* El connector encapsula el mecanismo (hoy ADMIN_USER_PASSWORD_AUTH) y devuelve
|
|
50
|
+
* solo un veredicto `{ valid }`. El caller (rbac) NO conoce el mecanismo.
|
|
51
|
+
*/
|
|
52
|
+
authVerifyPassword(input: VerifyPasswordRequest): Promise<ApiGatewayResponse<VerifyPasswordResponse>>;
|
|
47
53
|
/** POST /auth/respond-challenge — responde a challenge pendiente (devuelve tokens o nuevo challenge). */
|
|
48
54
|
authRespondChallenge(input: RespondToChallengeRequest): Promise<ApiGatewayResponse<RespondToChallengeResponse>>;
|
|
49
55
|
/** POST /auth/refresh-tokens — refresca accessToken+idToken usando refreshToken. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0",
|
|
4
4
|
"description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través de invocaciones http",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@fiado/gateway-adapter": "^2.0.0",
|
|
18
18
|
"@fiado/http-client": "^2.0.0",
|
|
19
19
|
"@fiado/logger": "^1.0.3",
|
|
20
|
-
"@fiado/type-kit": "^3.
|
|
20
|
+
"@fiado/type-kit": "^3.46.0",
|
|
21
21
|
"dotenv": "^16.4.7"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inject, injectable } from "inversify";
|
|
2
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
3
3
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
4
4
|
import {
|
|
5
5
|
CreateUserRequest,
|
|
@@ -33,6 +33,8 @@ import {
|
|
|
33
33
|
CreatePoolResponse,
|
|
34
34
|
DeletePoolRequest,
|
|
35
35
|
HealthcheckResponse,
|
|
36
|
+
VerifyPasswordRequest,
|
|
37
|
+
VerifyPasswordResponse,
|
|
36
38
|
} from "@fiado/type-kit/bin/cognitoBackofficeConnector";
|
|
37
39
|
import { ICognitoBackofficeConnectorApi } from "./interfaces/ICognitoBackofficeConnectorApi";
|
|
38
40
|
|
|
@@ -159,7 +161,7 @@ export default class CognitoBackofficeConnectorApi implements ICognitoBackoffice
|
|
|
159
161
|
return await this.httpRequest.post(url, input);
|
|
160
162
|
}
|
|
161
163
|
|
|
162
|
-
// ============= Auth flow no-admin BFF M18 (
|
|
164
|
+
// ============= Auth flow no-admin BFF M18 (8) =============
|
|
163
165
|
|
|
164
166
|
async authInitiate(
|
|
165
167
|
input: InitiateAuthRequest,
|
|
@@ -168,6 +170,13 @@ export default class CognitoBackofficeConnectorApi implements ICognitoBackoffice
|
|
|
168
170
|
return await this.httpRequest.post(url, input);
|
|
169
171
|
}
|
|
170
172
|
|
|
173
|
+
async authVerifyPassword(
|
|
174
|
+
input: VerifyPasswordRequest,
|
|
175
|
+
): Promise<ApiGatewayResponse<VerifyPasswordResponse>> {
|
|
176
|
+
const url = `${this.baseUrl}/auth/verify-password`;
|
|
177
|
+
return await this.httpRequest.post(url, input);
|
|
178
|
+
}
|
|
179
|
+
|
|
171
180
|
async authRespondChallenge(
|
|
172
181
|
input: RespondToChallengeRequest,
|
|
173
182
|
): Promise<ApiGatewayResponse<RespondToChallengeResponse>> {
|
|
@@ -31,6 +31,8 @@ import {
|
|
|
31
31
|
CreatePoolResponse,
|
|
32
32
|
DeletePoolRequest,
|
|
33
33
|
HealthcheckResponse,
|
|
34
|
+
VerifyPasswordRequest,
|
|
35
|
+
VerifyPasswordResponse,
|
|
34
36
|
} from "@fiado/type-kit/bin/cognitoBackofficeConnector";
|
|
35
37
|
|
|
36
38
|
/**
|
|
@@ -110,11 +112,20 @@ export interface ICognitoBackofficeConnectorApi {
|
|
|
110
112
|
input: MfaResetRequest,
|
|
111
113
|
): Promise<ApiGatewayResponse<void>>;
|
|
112
114
|
|
|
113
|
-
// ============= Auth flow no-admin BFF M18 (
|
|
115
|
+
// ============= Auth flow no-admin BFF M18 (8) =============
|
|
114
116
|
|
|
115
117
|
/** POST /auth/initiate — inicia auth flow no-admin (devuelve tokens o challenge). */
|
|
116
118
|
authInitiate(input: InitiateAuthRequest): Promise<ApiGatewayResponse<InitiateAuthResponse>>;
|
|
117
119
|
|
|
120
|
+
/**
|
|
121
|
+
* POST /auth/verify-password — valida un password contra Cognito (DEC-AUTH-012).
|
|
122
|
+
* El connector encapsula el mecanismo (hoy ADMIN_USER_PASSWORD_AUTH) y devuelve
|
|
123
|
+
* solo un veredicto `{ valid }`. El caller (rbac) NO conoce el mecanismo.
|
|
124
|
+
*/
|
|
125
|
+
authVerifyPassword(
|
|
126
|
+
input: VerifyPasswordRequest,
|
|
127
|
+
): Promise<ApiGatewayResponse<VerifyPasswordResponse>>;
|
|
128
|
+
|
|
118
129
|
/** POST /auth/respond-challenge — responde a challenge pendiente (devuelve tokens o nuevo challenge). */
|
|
119
130
|
authRespondChallenge(
|
|
120
131
|
input: RespondToChallengeRequest,
|