Skip to content
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
merged 10 commits into from
Dec 9, 2024

Conversation

chris-durbin
Copy link
Contributor

Jira Issue ID

HARMONY-1938

Description

This change allows developers to run harmony without having to set up an EDL application.

Local Test Steps

There are several configurations to test.

  1. Development with USE_EDL_CLIENT_APP=true and OAUTH* variables configured.
  2. Development with USE_EDL_CLIENT_APP=false and OAUTH* variables NOT configured.
  3. Harmony in a box with USE_EDL_CLIENT_APP=true and OAUTH* variables configured.
  4. Harmony in a box with USE_EDL_CLIENT_APP=false and OAUTH* variables NOT configured.

Note any services using the current harmony service library will fail if OAUTH* environment variables are not set. In order to test without an EDL client app you will need to build the service using the harmony-service-library from the harmony-1938 branch.

Test bin/bootstrap and/or bin/create-dotenv with no .env file.

  • Verify that you are prompted to choose whether or not to use a client app and the default is to not use the app.
  • Verify that if you choose to not use an app you are prompted for an EDL token.
  • Verify if you choose to use an app you are prompted for OAUTH* parameters.

Other Tests

  • Verify if USE_EDL_CLIENT_APP=false and EDL_TOKEN is not provided harmony throws an error when starting up
  • Verify if USE_EDL_CLIENT_APP=true and any OAUTH* environment variables are not set harmony throws an error when starting up
  • Verify if the EDL_TOKEN is invalid the endpoints for submitting requests returns a 40x error

Endpoints that should return authorization errors when not using an EDL_CLIENT_APP

  • /service-image-tag
  • /service-deployment
  • /service-deployments-state
  • /admin/jobs
  • /admin/workflow-ui
  • /admin/health
  • /admin/request-metrics
  • /core/configuration/log-level

Also verify that the workflow-ui does not show the logs button.

Verify that all other endpoints and functionality work as expected.

PR Acceptance Checklist

  • Acceptance criteria met
  • Tests added/updated (if needed) and passing
  • Documentation updated (if needed)
  • Harmony in a Box tested? (if changes made to microservices)

…plication. Requires setting an EDL token and disables all access to routes that require group membership for authorization.
…ke it clearer we still use EDL tokens, we just do not use EDL client app.
…e to use an EDL token instead of providing EDL app credentials.
@chris-durbin chris-durbin requested review from vinnyinverso, indiejames and ygliuvt and removed request for vinnyinverso and indiejames December 3, 2024 13:44
} else if (eulaInfo.statusCode !== 200) {
req.context.logger.error(`EULA (${eulaId}) verfification failed. Error: ${eulaInfo.error}`);
throw new ServerError(`EULA (${eulaId}) verfification failed unexpectedly.`);
if (env.useEdlClientApp) {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@ygliuvt
Copy link
Member

ygliuvt commented Dec 4, 2024

nit: Maybe consider adding a check in bin/bootstrap-harmony to halt the bootstrap with a reasonable error message when there is no EDL_TOKEN configured and USE_EDL_CLIENT_APP is false rather than the current behavior where the services are started up and harmony is not working. I have to go to harmony pod log to see the following error:

Error: Earthdata Login configuration error: You must set EDL_TOKEN in the environment when USE_EDL_CLIENT_APP is false

Copy link
Member

@ygliuvt ygliuvt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested successfully with the harmony-service-example service image built with the harmony-1938 branch of harmony-service-lib-py.
Tested with with and without USE_EDL_CLIENT_APP configuration, harmony dev and harmony-in-a-box locally. Verified service example requests work in all conditions and the admin routes are disabled with permission error when USE_EDL_CLIENT_APP is set to false.

@indiejames indiejames self-requested a review December 4, 2024 20:39
Copy link
Contributor

@indiejames indiejames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally using both local development services and Harmony in a box

@chris-durbin chris-durbin merged commit e8bc116 into main Dec 9, 2024
4 of 5 checks passed
@chris-durbin chris-durbin deleted the harmony-1938 branch December 9, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants