Skip to content

Commit 9bdf124

Browse files
committed
fix(parser): remove IPv6 support from AppSync as per review feedback
- Reverted IPv6 support in appsync-shared.ts (AppSync doesn't support IPv6 yet) - Removed IPv6 test cases from appsync.test.ts - Kept IPv6 support for API Gateway and API Gateway v2 only As mentioned in issue #4348, AppSync does not currently support IPv6
1 parent ef018fc commit 9bdf124

File tree

2 files changed

+1
-35
lines changed

2 files changed

+1
-35
lines changed

packages/parser/src/schemas/appsync-shared.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const AppSyncCognitoIdentity = z.object({
1616
issuer: z.string(),
1717
username: z.string(),
1818
claims: z.record(z.string(), z.unknown()),
19-
sourceIp: z.array(z.union([z.ipv4(), z.ipv6()])),
19+
sourceIp: z.array(z.ipv4()),
2020
defaultAuthStrategy: z.string().nullable(),
2121
groups: z.array(z.string()).nullable(),
2222
});

packages/parser/tests/unit/schema/appsync.test.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -112,40 +112,6 @@ describe('Schema: AppSync Resolver', () => {
112112
},
113113
},
114114
},
115-
{
116-
name: 'cognito identity with IPv6 sourceIp',
117-
event: {
118-
...appSyncResolverEvent,
119-
identity: {
120-
claims: {
121-
sub: '192879fc-a240-4bf1-ab5a-d6a00f3063f9',
122-
},
123-
defaultAuthStrategy: 'ALLOW',
124-
groups: null,
125-
issuer:
126-
'https://cognito-idp.us-west-2.amazonaws.com/us-west-xxxxxxxxxxx',
127-
sourceIp: ['2001:0db8:85a3:0000:0000:8a2e:0370:7334'],
128-
sub: '192879fc-a240-4bf1-ab5a-d6a00f3063f9',
129-
username: 'jdoe',
130-
},
131-
},
132-
},
133-
{
134-
name: 'iam identity with mixed IPv4 and IPv6 sourceIp',
135-
event: {
136-
...appSyncResolverEvent,
137-
identity: {
138-
accountId: '012345678901',
139-
cognitoIdentityAuthProvider: null,
140-
cognitoIdentityAuthType: null,
141-
cognitoIdentityId: null,
142-
cognitoIdentityPoolId: null,
143-
sourceIp: ['1.1.1.1', '::1', '2001:db8::8a2e:370:7334'],
144-
userArn: 'arn:aws:sts::012345678901:assumed-role/role',
145-
username: 'AROAXYKJUOW6FHGUSK5FA:username',
146-
},
147-
},
148-
},
149115
];
150116

151117
it.each(events)('parses an AppSyn resolver event with $name', ({ event }) => {

0 commit comments

Comments
 (0)