Skip to content

Commit

Permalink
fix: amplify configure with auth userGroups
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashwin Kumar committed Dec 2, 2024
1 parent 05e84a1 commit a9a1624
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
35 changes: 20 additions & 15 deletions packages/core/__mocks__/configMocks/amplify_outputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@
"user_pool_client_id": "mock-cup-client-id",
"identity_pool_id": "mock-idp-id",
"oauth": {
"identity_providers": ["FACEBOOK", "SIGN_IN_WITH_APPLE", "GOOGLE", "Auth0"],
"identity_providers": [
"FACEBOOK",
"SIGN_IN_WITH_APPLE",
"GOOGLE",
"Auth0"
],
"domain": "mock-oauth-domain",
"scopes": ["phone"],
"redirect_sign_in_uri": ["mock-sign-in-uri"],
"redirect_sign_out_uri": ["mock-sign-out-uri"],
"response_type": "token"
},
"standard_required_attributes": [
"address",
"locale",
"email"
],
"standard_required_attributes": ["address", "locale", "email"],
"username_attributes": ["phone_number", "email"],
"user_verification_types": ["email"],
"unauthenticated_identities_enabled": true,
Expand All @@ -30,7 +31,17 @@
"require_uppercase": true,
"require_symbols": true,
"min_length": 6
}
},
"groups": [
{
"ADMIN": {
"precedence": 0
},
"USER": {
"precedence": 0
}
}
]
},
"data": {
"aws_region": "us-west-2",
Expand All @@ -42,17 +53,11 @@
"geo": {
"aws_region": "us-west-2",
"search_indices": {
"items": [
"mock-geo-search-item",
"mock-geo-search-item-alt"
],
"items": ["mock-geo-search-item", "mock-geo-search-item-alt"],
"default": "mock-geo-search-item"
},
"geofence_collections": {
"items": [
"mock-geo-fence-item",
"mock-geo-fence-item-alt"
],
"items": ["mock-geo-fence-item", "mock-geo-fence-item-alt"],
"default": "mock-geo-fence-item"
}
},
Expand Down
6 changes: 6 additions & 0 deletions packages/core/__tests__/parseAmplifyOutputs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ describe('parseAmplifyOutputs tests', () => {
Auth: {
Cognito: {
allowGuestAccess: true,
groups: [
{
ADMIN: { precedence: 0 },
USER: { precedence: 0 },
},
],
identityPoolId: 'mock-idp-id',
loginWith: {
email: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/singleton/AmplifyOutputs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface AmplifyOutputsAuthProperties {
unauthenticated_identities_enabled?: boolean;
mfa_configuration?: string;
mfa_methods?: string[];
groups?: Record<UserGroupName, UserGroupPrecedence>[];
groups?: Partial<Record<UserGroupName, UserGroupPrecedence>[]>;
}

export interface AmplifyOutputsStorageBucketProperties {
Expand Down

0 comments on commit a9a1624

Please sign in to comment.