-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HARMONY-1938: Support running harmony without using an EDL app #668
Merged
+233
−125
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ccb868a
HARMONY-1938: Allow harmony to run without requiring an EDL client ap…
chris-durbin 384982a
HARMONY-1938: Change SKIP_EARTHDATA_LOGIN to USE_EDL_CLIENT_APP to ma…
chris-durbin 5804876
HARMONY-1938: Updated harmony in a box .env creation script to be abl…
chris-durbin 2a7e76c
HARMONY-1938: Update documentation.
chris-durbin 31f0a27
HARMONY-1938: Document updates to EDL client app environment variables.
chris-durbin aa1c8de
Merge branch 'main' into harmony-1938
chris-durbin 4371127
Merge branch 'main' into harmony-1938
chris-durbin 3b8853d
HARMONY-1938: Syntax fix to changelog.
chris-durbin 17ae3da
HARMONY-1938: Fail early when running bin/bootstrap-harmony if not us…
chris-durbin c649964
Merge branch 'main' into harmony-1938
chris-durbin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
26 changes: 26 additions & 0 deletions
26
services/harmony/app/middleware/earthdata-login-skipped.ts
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import HarmonyRequest from '../models/harmony-request'; | ||
import env from '../util/env'; | ||
|
||
if (process.env.USE_EDL_CLIENT_APP === 'false' && !process.env.EDL_TOKEN) { | ||
throw new Error( | ||
'Earthdata Login configuration error: You must set EDL_TOKEN in the environment ' + | ||
'when USE_EDL_CLIENT_APP is false', | ||
); | ||
} | ||
|
||
/** | ||
* Builds Express.js middleware for bypassing EDL client authentication. This should only | ||
* be used for local testing and will limit harmony functionality to endpoints that do | ||
* not require an EDL client to perform checks. EDL token verification will not be | ||
* performed directly by the harmony app, but the EDL_TOKEN environment variable will | ||
* be passed to CMR and to download sites when trying to retrieve data at which point | ||
* those applications will validate the token. | ||
* | ||
* @returns Express.js middleware for doing EDL token authentication | ||
*/ | ||
export default async function edlSkipped(req: HarmonyRequest, res, next): Promise<void> { | ||
req.user = 'anonymous'; | ||
req.accessToken = env.edlToken; | ||
req.authorized = true; | ||
return next(); | ||
} |
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.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what whether or not you are a EDL client app has to do with whether or not a user has accepted eulas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It requires making a call to EDL that requires a client app so we can't do the check.