feat(api): add external archive downloads and retire datasink ingress#1818
Open
benjaminpaige wants to merge 27 commits intomainfrom
Open
feat(api): add external archive downloads and retire datasink ingress#1818benjaminpaige wants to merge 27 commits intomainfrom
benjaminpaige wants to merge 27 commits intomainfrom
Conversation
- Add dataSink Lambda function to handle incoming events from SMART. - Implement idempotency checks using DynamoDB to prevent duplicate processing. - Publish validated events to Kafka for further processing. - Introduce environment variables for configuration, including idempotency table name and Kafka topic. - Create associated tests for dataSink functionality. - Update package dependencies to include AWS SDK for DynamoDB operations. - Add necessary infrastructure in CDK for DynamoDB table and Lambda permissions.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
Coverage Report
File Coverage |
…cy and event storage - Replace DynamoDB idempotency checks with OpenSearch document management. - Update dataSink Lambda to handle event storage and status updates in OpenSearch. - Remove Kafka publishing logic and related dependencies. - Introduce new OpenSearch document schema and update associated tests. - Adjust infrastructure to support OpenSearch integration, including IAM permissions and index setup. - Delete obsolete files related to previous DynamoDB implementation.
…h integration - Add support for processing outbound events from OneMac to MuleSoft. - Introduce new data structures and functions for creating and storing outbound envelopes. - Update OpenSearch document schema to include outbound event fields. - Implement error handling and logging for outbound event processing. - Create unit tests for new data exchange functionality. - Adjust infrastructure to support outbound event configuration via environment variables.
Update setupIndex and deleteIndex tests to include the datasink index in expected indices arrays. The datasink index was added as part of the outbound DataExchange integration feature.
- Add Lambda function to check if an identifier is in use, returning its status and origin. - Create associated tests for the new functionality. - Update package.json to reflect changes in dependencies. - Introduce new API endpoint for public access without authentication. - Ensure CORS headers are included in responses for cross-origin requests.
- Update bun.lockb to reflect changes in package dependencies. - Modify deploy command description to clarify AWS credentials requirements. - Refactor dataSink and checkIdentifierUsage modules for improved structure and readability. - Enhance data exchange functionality with better error handling and configuration management. - Add tests for new data exchange features and ensure existing tests are updated accordingly.
# Conflicts: # .gitignore # bun.lockb # lib/lambda/getAttachmentUrl.ts # lib/stacks/api.ts # lib/stacks/data.ts # lib/stacks/parent.ts
- extend external/getAttachmentUrl with package and section archive downloads - share archive resolution and content-disposition handling across download paths - protect checkIdentifierUsage with IAM and remove datasink/data-exchange resources Refs: OY2-37464
- mark literal field-name strings that trip detect-secrets during push - keep the allowlists scoped to the exact reported lines
- move the allowlist pragma to the exact clientSecret guard the hook reports - leave the token error message unchanged
- rename the local token request secret field to clientCredential - keep the contract-facing client_secret message allowlisted on the exact literal
- stop setup/delete index flows from managing a datasink OpenSearch index\n- remove the datasink base index type and restore the deploy CLI credential description
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch started as a broader datasink spike, but what it now brings back to
mainis a much tighter set of changes. The headline items are external archive downloads through the existing attachment URL endpoint, a locked-downcheckIdentifierUsageroute, removal of datasink-specific ingress/data-exchange pieces we are not promoting, and the CI/tooling updates needed to keep the current branch healthy under today’s Bun/Vite/Storybook stack.Summary
POST /external/getAttachmentUrlto serve existing object downloads plus full-package and section archive ZIPs from the archive buckets.GET /checkIdentifierUsage, but change it from anonymous access toAWS_IAM.What Changed
External download API
lib/lambda/external-auth/*,lib/lambda/externalToken.ts, andlib/lambda/externalAttachmentAuthorizer.ts.lib/lambda/getExternalAttachmentUrl.tsso external consumers can request existing object downloads, full package archive downloads bypackageId, and package section archive downloads bypackageIdplussectionId.lib/lambda/attachmentArchive-lib.tsandlib/lambda/presignedAttachmentUrl.tsso internal and external attachment flows share archive resolution, filenames, and content-disposition handling.Auth, routing, and infrastructure
lib/config/deployment-config.ts.lib/stacks/api.tsto wire the external token endpoint, external attachment authorizer, dedicated IAM for archive downloads, and the archive bucket/rebuild settings.checkIdentifierUsageLambda/API support inlib/lambda/checkIdentifierUsage.tsandlib/libs/api/package/checkIdentifierUsage.ts.checkIdentifierUsageon API Gateway toAWS_IAMinstead of anonymous access.Datasink cleanup
Tooling and repo hygiene
bun.lockband aligned the branch with the current Bun dependency graph.mocksworkspace package directly from.storybook/main.ts.vite-plugin-checkerfrom interfering with Vitest test mode.cdk.jsonnow usesbunx tsx, the deploy CLI help text references the current AWS credential naming, detect-secrets ignores test files to reduce false positives, and local-onlydocs/localandtest/localpaths remain ignored.Related Context
Risks / Reviewer Notes
external/getAttachmentUrlis an additive contract change. Existing object-mode callers still work, but responses now includestatusandtarget, and archive callers may receivePENDINGbefore a ZIP is ready.checkIdentifierUsageis still exposed through the EDGE API, but it is no longer anonymously callable./dataSinkor outbound data-exchange wiring should be treated as out of scope for this promotion.mainthat current Actions could no longer execute Storybook and coverage successfully without compatibility updates.Deployment / Operations