-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 20-merge-lz-infra
- Loading branch information
Showing
53 changed files
with
3,398 additions
and
1,213 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
beautifulsoup4==4.11.2 | ||
pandas==1.5.1 | ||
requests==2.28.2 | ||
requests==2.32.3 | ||
typer==0.7.0 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,18 @@ import { validateBody, wrapHandler, NotFound, Unauthorized } from './helpers'; | |
import { isGlobalWriteAdmin } from './auth'; | ||
import S3Client from '../tasks/s3-client'; | ||
|
||
// 508 Warning Banner S3 filename | ||
const bannerFileName = '508warningtext.txt'; | ||
|
||
// Default 508 Warning Banner for local dev | ||
const default508Banner = | ||
'CISA is committed to providing access for all individuals with disabilities, \ | ||
including members of the public and all employees. While this website is not \ | ||
yet fully accessible to users with disabilities as required by Section \ | ||
[508](https://cisa.gov/accessibility) federal law, CISA is working diligently \ | ||
to resolve those issues. If you experience accessibility issues, please email \ | ||
[[email protected]](mailto:[email protected]) for assistance.'; | ||
|
||
class NewNotification { | ||
@IsDateString() | ||
startDatetime?: string; | ||
|
@@ -99,8 +111,6 @@ export const list = wrapHandler(async (event) => { | |
} | ||
}); | ||
|
||
console.log('Notification.find result: ', result); | ||
|
||
return { | ||
statusCode: 200, | ||
body: JSON.stringify(result) | ||
|
@@ -161,16 +171,28 @@ export const update = wrapHandler(async (event) => { | |
* - Notifications | ||
*/ | ||
export const get508Banner = wrapHandler(async () => { | ||
const bannerFileName = '508warningtext.txt'; | ||
// Return hardcoded banner for local builds | ||
if (process.env.IS_LOCAL) { | ||
console.log('Using default banner for 508 warning: ', default508Banner); | ||
// API Response | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify(default508Banner) | ||
}; | ||
} | ||
|
||
// Handle normal S3 logic | ||
try { | ||
const client = new S3Client(); | ||
const bannerResult = await client.getEmailAsset(bannerFileName); | ||
// API Response | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify(bannerResult) | ||
}; | ||
} catch (error) { | ||
console.log('S3 Banner Error: ', error); | ||
// API Error Response | ||
return { | ||
statusCode: 500, | ||
body: 'Error retrieving file from S3. See details in logs.' | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.