-
Notifications
You must be signed in to change notification settings - Fork 12
ID-1174 Add combined user state api call to reduce needed ui api calls #1414
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
Conversation
# Conflicts: # docker/run-postgres.sh
Set.empty, | ||
includePublic = false, | ||
samRequestContext | ||
) |
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 matched this with the call that the ui is doing
@@ -27,6 +27,8 @@ class MockSamRoutesBuilder(allUsersGroup: WorkbenchGroup)(implicit system: Actor | |||
private val userServiceBuilder: MockUserServiceBuilder = MockUserServiceBuilder() | |||
private val mockTosServiceBuilder = MockTosServiceBuilder() | |||
|
|||
val mockResourceService = mock[ResourceService] |
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 didnt want to have to add a whole MockResourceServiceBuilder thing just for this so I made this mock available for mocking in the test i wrote
803bc72
to
ae94eb9
Compare
ae94eb9
to
e091b55
Compare
c2b738f
to
a9475cf
Compare
07d63dc
to
5911109
Compare
|
Ticket: https://broadworkbench.atlassian.net/browse/ID-1174
What:
Adds a combined user state api call in order to reduce the amount of api calls needed from the ui to sam in order to load user state.
Why:
Right now, Terra-UI makes 5 calls at once to Sam to get user information. This led to a recent incident where we added a call to Sam from Terra-UI on login, but forgot to tell Sam to ignore the ToS acceptance for that call.
In general, Terra-UI is very chatty with Terra APIs. This leads to an increased risk of call failure. This new endpoint will make the UI less error-prone in its communication with Sam, as well as simplify the login code in the UI.
How:
I added a new api endpoint that returns the user's samUser, allowances, attributes, terms of service details, and enterprise features.
These are all to replace the multiple api calls in the ui here with a single call.
PR checklist