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

ID-1301 talk to ecm for nih username (Round 2) #1407

Merged
merged 31 commits into from
Aug 8, 2024

Conversation

tlangs
Copy link
Contributor

@tlangs tlangs commented Aug 5, 2024

https://broadworkbench.atlassian.net/browse/ID-1301

First PR caused Dev to be unable to load NIH Account status, so it was reverted. Trying again.

Getting ready for ECM to replace Thurloe for NIH Account linking. For now, we'll need to talk to both, since links last for 30 days. Once everything is deployed to prod and has been out for a while, we should be able to safely delete the Thurloe code.
Have you read CONTRIBUTING.md lately? If not, do that first.

I, the developer opening this PR, do solemnly pinky swear that:

  • I've followed the instructions if I've made any changes to the API, especially if they're breaking changes
  • I've updated the RC_XXX release ticket with any manual steps required to release this change
  • I've updated the FISMA documentation if I've made any security-related changes, including auth, encryption, or auditing

In all cases:

  • Get two thumbsworth of review and PO signoff if necessary
  • Verify all tests go green
  • Squash and merge; you can delete your branch after this unless it's for a hotfix. In that case, don't delete it!
  • Test this change deployed correctly and works on dev environment after deployment

@@ -112,7 +112,7 @@ start_server () {
--network=fc-orch \
-e JAVA_OPTS="$DOCKER_JAVA_OPTS" \
sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.10_7_1.10.1_2.13.14 \
sbt \~reStart
bash -c "git config --global --add safe.directory /app && sbt \~reStart"
Copy link
Contributor Author

@tlangs tlangs Aug 7, 2024

Choose a reason for hiding this comment

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

This fixes a

[info] loading settings for project root from build.sbt ...
fatal: detected dubious ownership in repository at '/app'
To add an exception for this directory, call:

        git config --global --add safe.directory /app

error

Comment on lines +17 to +19
val excludeSpring = ExclusionRule(organization = "org.springframework")
val excludeSpringBoot = ExclusionRule(organization = "org.springframework.boot")
val excludeSpringJcl = ExclusionRule(organization = "org.springframework", name = "spring-jcl")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exclusions to resolve assembly merge clashes, and also to reduce the jar size

@@ -50,9 +54,11 @@ object Dependencies {
excludeGuava("org.broadinstitute.dsde.workbench" %% "workbench-util" % s"0.10-$workbenchLibsHash"),
"org.broadinstitute.dsde.workbench" %% "workbench-google2" % s"0.36-$workbenchLibsHash",
"org.broadinstitute.dsde.workbench" %% "workbench-oauth2" % s"0.7-$workbenchLibsHash",
"org.broadinstitute.dsde.workbench" %% "sam-client" % "0.1-ef83073",
"org.broadinstitute.dsde.workbench" %% "sam-client" % "v0.0.263",
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 was ancient!


import scala.concurrent.Future

class DisabledExternalCredsDAO extends ExternalCredsDAO with LazyLogging {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is needed so that Orch can run in BEEs. In the future, we'll need to get ECM to run in BEEs so that swat tests can pass without Thurloe.

@@ -50,6 +50,14 @@ class HttpSamDAO( implicit val system: ActorSystem, val materializer: Materializ
authedRequestToObject[UserIdInfo](Get(samGetUserIdsUrl.format(URLEncoder.encode(email.value, UTF_8.name))))
}

// Sam's API only allows for 1000 user to be fetched at one time
override def getUsersForIds(samUserIds: Seq[WorkbenchUserId])(implicit userInfo: WithAccessToken): Future[Seq[WorkbenchUserInfo]] = Future.sequence {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New Sam API to resolve a list of users from user ids.

@@ -2,6 +2,7 @@ package org.broadinstitute.dsde.firecloud.model

import akka.http.scaladsl.model.headers.OAuth2BearerToken

import java.time.OffsetDateTime
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need this import?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope!

Copy link
Contributor

@samanehsan samanehsan left a comment

Choose a reason for hiding this comment

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

Lgtm! :octocat:

@tlangs tlangs merged commit abd3618 into develop Aug 8, 2024
12 checks passed
@tlangs tlangs deleted the tl_ID-1301_talk_to_ecm_for_nih_username branch August 8, 2024 17:25
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