29
29
import com .netflix .spinnaker .kork .core .RetrySupport ;
30
30
import com .netflix .spinnaker .kork .exceptions .SpinnakerException ;
31
31
import com .netflix .spinnaker .kork .exceptions .SystemException ;
32
+ import com .netflix .spinnaker .kork .retrofit .Retrofit2SyncCall ;
32
33
import com .netflix .spinnaker .kork .retrofit .exceptions .SpinnakerHttpException ;
33
34
import com .netflix .spinnaker .kork .retrofit .exceptions .SpinnakerServerException ;
34
35
import com .netflix .spinnaker .security .AuthenticatedRequest ;
@@ -78,9 +79,7 @@ public void login(final String userId) {
78
79
try {
79
80
AuthenticatedRequest .allowAnonymous (
80
81
() -> {
81
- // TODO(jvz): FiatService::loginUser should have only one parameter as Retrofit no
82
- // longer requires this body parameter
83
- getFiatServiceForLogin ().loginUser (userId , "" );
82
+ Retrofit2SyncCall .execute (getFiatServiceForLogin ().loginUser (userId ));
84
83
permissionEvaluator .invalidatePermission (userId );
85
84
return null ;
86
85
});
@@ -95,7 +94,7 @@ public void loginWithRoles(final String userId, final Collection<String> roles)
95
94
try {
96
95
AuthenticatedRequest .allowAnonymous (
97
96
() -> {
98
- getFiatServiceForLogin ().loginWithRoles (userId , roles );
97
+ Retrofit2SyncCall . execute ( getFiatServiceForLogin ().loginWithRoles (userId , roles ) );
99
98
permissionEvaluator .invalidatePermission (userId );
100
99
return null ;
101
100
});
@@ -108,7 +107,7 @@ public void loginWithRoles(final String userId, final Collection<String> roles)
108
107
public void logout (String userId ) {
109
108
if (fiatStatus .isEnabled ()) {
110
109
try {
111
- getFiatServiceForLogin ().logoutUser (userId );
110
+ Retrofit2SyncCall . execute ( getFiatServiceForLogin ().logoutUser (userId ) );
112
111
permissionEvaluator .invalidatePermission (userId );
113
112
} catch (SpinnakerServerException e ) {
114
113
throw UpstreamBadRequest .classifyError (e );
@@ -119,7 +118,7 @@ public void logout(String userId) {
119
118
public void sync () {
120
119
if (fiatStatus .isEnabled ()) {
121
120
try {
122
- getFiatServiceForLogin ().sync (List .of ());
121
+ Retrofit2SyncCall . execute ( getFiatServiceForLogin ().sync (List .of () ));
123
122
} catch (SpinnakerServerException e ) {
124
123
throw UpstreamBadRequest .classifyError (e );
125
124
}
0 commit comments