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

CORE-101 don't attempt to create shell google project if key exists #1569

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

dvoet
Copy link
Collaborator

@dvoet dvoet commented Oct 18, 2024

Ticket: https://broadworkbench.atlassian.net/browse/CORE-101

<Don't forget to include the ticket number in the PR title!>

What:

<For your reviewers' sake, please describe in a sentence or two what this PR is accomplishing (usually from the users' perspective, but not necessarily).>

Why:

<For your reviewers' sake, please describe in ~1 paragraph what the value of this PR is to our users or to ourselves.>

How:

<For your reviewers' sake, please describe in ~1 paragraph how this PR accomplishes its goal.>

<If the PR is big, please indicate where a reviewer should start reading it (i.e. which file or function).>


PR checklist

  • I've followed the instructions if I've made any changes to the API, especially if they're breaking changes
  • I've filled out the Security Risk Assessment (requires Broad Internal network access) and attached the result to the JIRA ticket

@@ -46,6 +45,10 @@ import scala.jdk.CollectionConverters._
object GoogleExtensions {
val resourceId = ResourceId("google")
val getPetPrivateKeyAction = ResourceAction("get_pet_private_key")

def getShellGoogleProjectName(user: SamUser, googleServicesConfig: GoogleServicesConfig) =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

moved to be in a more accessible spot for tests

@@ -485,9 +488,6 @@ class GoogleExtensions(
}
} yield key

def getArbitraryPetServiceAccountKey(user: SamUser, samRequestContext: SamRequestContext): IO[String] =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this was inlined

@dvoet dvoet changed the title don't attempt to create shell google project if key exists CORE-101 don't attempt to create shell google project if key exists Oct 18, 2024
@dvoet dvoet requested review from a team, calypsomatic and davidangb and removed request for a team October 18, 2024 17:58
Copy link
Contributor

@davidangb davidangb left a comment

Choose a reason for hiding this comment

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

👍, with a question: this is still going to be vulnerable to multiple requests hitting getArbitraryPetServiceAccountKey in short order - if the user has multiple tabs open, or even if a script or the UI shoots off multiple requests that each involve a pet.

Certainly this PR is better than before, so it's worth merging; is it worth protecting against multiple requests?

Copy link

Copy link
Contributor

@davidangb davidangb left a comment

Choose a reason for hiding this comment

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

+1 again, and thank you!

@dvoet dvoet enabled auto-merge (squash) October 18, 2024 19:14
@dvoet dvoet merged commit 64829e4 into develop Oct 18, 2024
17 checks passed
@dvoet dvoet deleted the check_for_project branch October 18, 2024 19:18
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