@crvouga/mockingbird-service-cognito 3.14.0 → 3.16.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/CHANGELOG.md +12 -0
- package/README.md +20 -3
- package/dist/{chunk-ZL5JEUFF.js → chunk-2XZ4XTNR.js} +3 -3
- package/dist/{chunk-7JVYABWD.js → chunk-3JRKJUQ2.js} +779 -132
- package/dist/{chunk-7JVYABWD.js.map → chunk-3JRKJUQ2.js.map} +4 -4
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +102 -4
- package/dist/index.js +1 -1
- package/dist/server.js +2 -2
- package/openapi.yaml +15 -0
- package/package.json +1 -1
- /package/dist/{chunk-ZL5JEUFF.js.map → chunk-2XZ4XTNR.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-cognito
|
|
2
2
|
|
|
3
|
+
## 3.16.0 (2026-11-14)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- add transcript storage, signature and meetings; tags, teams, messages, macros and calls ([ee21e12](https://github.com/crvouga/mockingbird/commit/ee21e12024768bd52c6902b1722fb35a94d2444b))
|
|
8
|
+
|
|
9
|
+
## 3.15.0 (2026-11-13)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- user-pool validation, SRP sign-in, groups and missing operations ([1f50324](https://github.com/crvouga/mockingbird/commit/1f50324b11eb38bfa9bcd4826d706e5f32c882e4))
|
|
14
|
+
|
|
3
15
|
## 3.14.0 (2026-11-12)
|
|
4
16
|
|
|
5
17
|
### Features
|
package/README.md
CHANGED
|
@@ -59,15 +59,32 @@ await emulator.close() // after the test
|
|
|
59
59
|
|
|
60
60
|
### AWS JSON operations
|
|
61
61
|
|
|
62
|
-
`POST /` dispatches by `X-Amz-Target` and supports SignUp, ConfirmSignUp, ResendConfirmationCode, InitiateAuth (`USER_PASSWORD_AUTH`, `REFRESH_TOKEN_AUTH`), ForgotPassword, ConfirmForgotPassword, ChangePassword, GetUser, DeleteUser, AdminCreateUser, AdminSetUserPassword, AdminConfirmSignUp, AdminGetUser, AdminUpdateUserAttributes, AdminDeleteUser, ListUsers, AdminLinkProviderForUser, AdminAddUserToGroup, AdminRemoveUserFromGroup, and AdminUserGlobalSignOut.
|
|
62
|
+
`POST /` dispatches by `X-Amz-Target` and supports SignUp, ConfirmSignUp, ResendConfirmationCode, InitiateAuth and AdminInitiateAuth (`USER_PASSWORD_AUTH` / `ADMIN_USER_PASSWORD_AUTH`, `USER_SRP_AUTH`, `REFRESH_TOKEN_AUTH`), RespondToAuthChallenge and AdminRespondToAuthChallenge (`PASSWORD_VERIFIER`, `NEW_PASSWORD_REQUIRED`), GetTokensFromRefreshToken, ForgotPassword, ConfirmForgotPassword, ChangePassword, GetUser, UpdateUserAttributes, VerifyUserAttribute, DeleteUser, GlobalSignOut, RevokeToken, AdminCreateUser, AdminSetUserPassword, AdminResetUserPassword, AdminConfirmSignUp, AdminGetUser, AdminUpdateUserAttributes, AdminDeleteUserAttributes, AdminDisableUser, AdminEnableUser, AdminDeleteUser, ListUsers, AdminLinkProviderForUser, CreateGroup, GetGroup, ListGroups, DeleteGroup, AdminAddUserToGroup, AdminRemoveUserFromGroup, AdminListGroupsForUser, ListUsersInGroup, DescribeUserPool, DescribeUserPoolClient, and AdminUserGlobalSignOut. Any other target answers `UnknownOperationException`.
|
|
63
63
|
|
|
64
64
|
Responses contain SDK-consumed Cognito fields and AWS-shaped exceptions (`__type`, `message`, HTTP status, `x-amzn-requestid`). Tokens are RS256 JWTs with Cognito issuer, subject, `token_use`, timestamps and groups. The ID token adds `aud`, `cognito:username`, email and linked identities; the access token adds `client_id`, `username` and `scope`, and no user attributes, as Cognito does. Discovery and JWKS are at `/<poolId>/.well-known/openid-configuration` and `/<poolId>/.well-known/jwks.json`.
|
|
65
65
|
|
|
66
|
+
### Users, sign-in and validation (best guess, not oracle-verified)
|
|
67
|
+
|
|
68
|
+
No live user pool backs the parity harness, so these rules come from the [API reference](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/Welcome.html) (each operation's request, response and Errors sections), the [user-pool attributes guide](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html), the [user existence errors guide](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-managing-errors.html) and `amazon-cognito-identity-js`'s SRP client. They are a **best guess, not oracle-verified**.
|
|
69
|
+
|
|
70
|
+
- **Pool and client.** A `UserPoolId` other than the configured `poolId` answers `ResourceNotFoundException` (`User pool <id> does not exist.`), and a `ClientId` that is neither the default `clientId` nor a registered `appClients` entry answers `ResourceNotFoundException` (`User pool client <id> does not exist.`). Register every client id your application sends. A request that omits either falls back to the configured pool and default client. ListUsers, ListUsersInGroup, the group operations, DescribeUserPool and DescribeUserPoolClient need IAM credentials, like the `Admin*` operations.
|
|
71
|
+
- **Usernames.** Any `Username` parameter accepts the username, the user's `sub`, or a sign-in alias (`email`, plus `phone_number` when it is a username attribute). Usernames and aliases match case-insensitively (`usernameCaseSensitive: false`, the console default); pass `usernameCaseSensitive: true` for a case-sensitive pool. With `usernameAttributes: ["email"]` (and/or `"phone_number"`), SignUp and AdminCreateUser take an email (or E.164 phone) as `Username`, store it as that attribute, and generate the username, which is the `sub`; `Username` in responses and `cognito:username` / `username` in tokens are then the sub. A `Username` that is not an email in such a pool answers `InvalidParameterException` `Username should be an email.`
|
|
72
|
+
- **Attributes.** A malformed `email` (or `phone_number`) attribute answers `InvalidParameterException` `Invalid email address format.`. Emails are unique in the pool: creating a user whose username or email another user holds answers `UsernameExistsException`, and AdminUpdateUserAttributes or UpdateUserAttributes setting one answers `AliasExistsException`. UpdateUserAttributes that changes the caller's own `email` or `phone_number` marks it unverified and sends a verification code (`123456`, trigger `UpdateUserAttributes`), which VerifyUserAttribute accepts. Every change moves `UserLastModifiedDate`.
|
|
73
|
+
- **ListUsers.** `Filter` takes `attribute = "value"` or `attribute ^= "value"` on `username`, `email`, `phone_number`, `name`, `given_name`, `family_name`, `preferred_username`, `cognito:user_status`, `status` (`Enabled`/`Disabled`) or `sub`; values match exactly (usernames under the pool's case rule). Another attribute or a malformed filter answers `InvalidParameterException`. `AttributesToGet` limits the returned attributes (`[]` returns none). `Limit` must be 0–60 (0 means 60), and a `PaginationToken` the emulator did not issue answers `InvalidParameterException`.
|
|
74
|
+
- **AdminGetUser** returns `UserAttributes`; ListUsers, ListUsersInGroup and AdminCreateUser return `Attributes`, as in Cognito.
|
|
75
|
+
- **Sign-in.** `USER_SRP_AUTH` (the default flow of `amazon-cognito-identity-js`'s `authenticateUser`) answers the `PASSWORD_VERIFIER` challenge and RespondToAuthChallenge checks the SRP-6a password claim. After the password checks out, a disabled user gets `NotAuthorizedException` `User is disabled.`, a `RESET_REQUIRED` user `PasswordResetRequiredException`, a `FORCE_CHANGE_PASSWORD` user the `NEW_PASSWORD_REQUIRED` challenge (with `userAttributes`), and an unconfirmed user `UserNotConfirmedException`. AdminInitiateAuth takes `ADMIN_USER_PASSWORD_AUTH` (or `ADMIN_NO_SRP_AUTH`), `USER_SRP_AUTH` and `REFRESH_TOKEN_AUTH`; the other operation's password flow answers `Initiate Auth method not supported.`. `CUSTOM_AUTH` and `USER_AUTH` are **not modelled** and answer `InvalidParameterException` `AuthFlow <flow> is not supported by the Mockingbird Cognito emulator.` (an emulator limitation, not a Cognito error). GetTokensFromRefreshToken returns new access and ID tokens without a new refresh token (refresh-token rotation is not modelled).
|
|
76
|
+
- **Confirmation.** ConfirmSignUp and AdminConfirmSignUp for a user that is not `UNCONFIRMED` answer `NotAuthorizedException` `User cannot be confirmed. Current status is <status>`; ResendConfirmationCode answers `InvalidParameterException` `User is already confirmed.`
|
|
77
|
+
- **PreventUserExistenceErrors.** Set `preventUserExistenceErrors: true` on an app client (`appClients` or `POST /__admin/app-clients`) for Cognito's `ENABLED` setting: ForgotPassword and ResendConfirmationCode for an unknown user answer a simulated `CodeDeliveryDetails` (masked email destination, nothing delivered), and ConfirmSignUp / ConfirmForgotPassword answer `CodeMismatchException`. Without it (Cognito's `LEGACY`) they answer `UserNotFoundException`.
|
|
78
|
+
- **Sign-out and revocation.** GlobalSignOut and AdminUserGlobalSignOut revoke all of the user's tokens. RevokeToken revokes a refresh token and every access token issued with it (or refreshed from it); an access token answers `UnsupportedTokenTypeException`, a refresh token of another client `UnauthorizedException`, and an unknown token succeeds. AdminDisableUser revokes the user's tokens.
|
|
79
|
+
- **Groups.** CreateGroup creates a group (`GroupExistsException` if it exists); AdminAddUserToGroup, AdminRemoveUserFromGroup, GetGroup, DeleteGroup and ListUsersInGroup answer `ResourceNotFoundException` `Group not found.` for one that does not. Groups named in seeded users' `groups` exist from the start.
|
|
80
|
+
- **AdminResetUserPassword** sets `RESET_REQUIRED` and sends a reset code (`654321`, trigger `ForgotPassword`); ConfirmForgotPassword with it sets the new password and `CONFIRMED`.
|
|
81
|
+
- **DescribeUserPool / DescribeUserPoolClient** describe the emulator's pool (username attributes, case sensitivity, the fixed password policy) and a registered client (callback URLs, providers, scopes, `PreventUserExistenceErrors`, and its secret if it has one).
|
|
82
|
+
|
|
66
83
|
### Hosted UI: `/oauth2/authorize` and `/oauth2/token` (best guess, not oracle-verified)
|
|
67
84
|
|
|
68
85
|
The hosted-UI domain is the emulator's own origin (plus the `/__admin/ns/<name>` prefix for a non-default namespace), and discovery advertises it as `authorization_endpoint` / `token_endpoint`. Behaviour follows the Cognito developer guide ([authorization endpoint](https://docs.aws.amazon.com/cognito/latest/developerguide/authorization-endpoint.html), [token endpoint](https://docs.aws.amazon.com/cognito/latest/developerguide/token-endpoint.html), [ID token claims](https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-the-id-token.html)). No live user pool backs the parity harness, so everything here is a **best guess, not oracle-verified**.
|
|
69
86
|
|
|
70
|
-
- **App clients.** `appClients: [{ clientId, callbackUrls, clientSecret?, identityProviders?, scopes? }]` (runtime option, or `fixtures.appClients` in a fleet entry), or `POST /__admin/app-clients` at runtime (`GET` lists them; secrets are never returned). The default `clientId` exists with no callback URLs, so register the app's `redirect_uri` before using the hosted UI. `identityProviders` omitted allows every provider name; `scopes` omitted allows the five system scopes. Requested scopes the client does not allow are ignored, and no `scope` grants all allowed ones.
|
|
87
|
+
- **App clients.** `appClients: [{ clientId, callbackUrls, clientSecret?, identityProviders?, scopes?, preventUserExistenceErrors? }]` (runtime option, or `fixtures.appClients` in a fleet entry), or `POST /__admin/app-clients` at runtime (`GET` lists them; secrets are never returned). The default `clientId` exists with no callback URLs, so register the app's `redirect_uri` before using the hosted UI. `identityProviders` omitted allows every provider name; `scopes` omitted allows the five system scopes. Requested scopes the client does not allow are ignored, and no `scope` grants all allowed ones.
|
|
71
88
|
- **`GET /oauth2/authorize`** with `response_type=code`, `client_id`, `redirect_uri`, `state`, `scope`, `nonce`, `identity_provider` (`Google`, `SignInWithApple`, `Facebook`, `LoginWithAmazon`, an OIDC/SAML name, or `COGNITO`/absent), and optional PKCE (`code_challenge_method=S256` only). It renders an account picker of the pool's own users in place of the provider's sign-in page; choosing one posts to `/oauth2/idpresponse` and redirects to `redirect_uri?code=…&state=…`. Codes are single use and expire after five minutes.
|
|
72
89
|
- **Federation.** The picked user stands in for the provider account; its provider subject is the subject it is already linked under for that provider, otherwise its `sub`. A native user linked to that subject with `AdminLinkProviderForUser` signs in as itself. Otherwise the first sign-in creates the user `<Provider>_<subject>` (status `EXTERNAL_PROVIDER`, the picked user's attributes copied, an `identities` claim `{userId, providerName, providerType, issuer: null, primary: "true", dateCreated}`); later sign-ins reuse it. Federated users cannot use `USER_PASSWORD_AUTH`. With `identity_provider=COGNITO` (or absent) the picked native user signs in directly, standing in for the username/password page.
|
|
73
90
|
- **`POST /oauth2/token`** (form body; `client_secret_basic` or `client_secret_post` when the client has a secret): `authorization_code` returns `access_token`, `id_token` (when `openid` was granted), `refresh_token`, `token_type: "Bearer"`, `expires_in: 3600`; `refresh_token` returns new ID and access tokens without a refresh token. Tokens are signed by the pool's keys with the pool's `iss`; the access token's `scope` is the granted scope and the ID token carries the `nonce`. The refresh token is an ordinary pool refresh token: `InitiateAuth` `REFRESH_TOKEN_AUTH` accepts it (keeping its scopes), and the token endpoint accepts refresh tokens from API sign-ins. Every answer carries `Access-Control-Allow-Origin: *` and `OPTIONS` answers the CORS preflight, as the docs describe.
|
|
@@ -107,7 +124,7 @@ Current and retained synthetic signing keys live in namespace storage, so namesp
|
|
|
107
124
|
|
|
108
125
|
### Deliberately not modelled
|
|
109
126
|
|
|
110
|
-
Operations outside the documented subset, production quotas, real email/SMS delivery (messages are recorded in `/__admin/outbox` instead), custom message templates, MFA, Lambda triggers, device tracking, Cognito Identity Pools, AWS billing, dashboards, and outbound vendor calls are not implemented. The hosted UI renders an emulator account picker instead of Cognito's managed login pages or the real Google/Apple pages (see Hosted UI above for the unmodelled parameters and grants).
|
|
127
|
+
Operations outside the documented subset, custom and choice-based auth flows (`CUSTOM_AUTH`, `USER_AUTH`), refresh-token rotation, custom attributes in ListUsers filters, production quotas, real email/SMS delivery (messages are recorded in `/__admin/outbox` instead), custom message templates, MFA, Lambda triggers, device tracking, Cognito Identity Pools, AWS billing, dashboards, and outbound vendor calls are not implemented. The hosted UI renders an emulator account picker instead of Cognito's managed login pages or the real Google/Apple pages (see Hosted UI above for the unmodelled parameters and grants).
|
|
111
128
|
|
|
112
129
|
## API
|
|
113
130
|
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
parseFaultHeader,
|
|
10
10
|
resolveAdminPrefix,
|
|
11
11
|
restoreClock
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3JRKJUQ2.js";
|
|
13
13
|
|
|
14
14
|
// ../../adapters/node/dist/cli.js
|
|
15
15
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
@@ -3079,7 +3079,7 @@ async function preflightFleet(config, options) {
|
|
|
3079
3079
|
break;
|
|
3080
3080
|
}
|
|
3081
3081
|
}
|
|
3082
|
-
targets.set(name, { ...target, packageVersion: packageVersion ?? "3.
|
|
3082
|
+
targets.set(name, { ...target, packageVersion: packageVersion ?? "3.16.0" });
|
|
3083
3083
|
} catch (error) {
|
|
3084
3084
|
throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
3085
3085
|
}
|
|
@@ -5142,4 +5142,4 @@ export {
|
|
|
5142
5142
|
createServer2 as createServer,
|
|
5143
5143
|
serveTarget
|
|
5144
5144
|
};
|
|
5145
|
-
//# sourceMappingURL=chunk-
|
|
5145
|
+
//# sourceMappingURL=chunk-2XZ4XTNR.js.map
|