Skip to content

Commit

Permalink
chore(dependencies): Autobump fiatVersion (#1858)
Browse files Browse the repository at this point in the history
* chore(dependencies): Autobump fiatVersion

* refactor(retrofit2): refactor the code to align with the retrofit2 upgrade of fiat-api

---------

Co-authored-by: root <root@4f180b5207b5>
Co-authored-by: kirangodishala <[email protected]>
  • Loading branch information
3 people authored Dec 10, 2024
1 parent 56feaa9 commit 94f1156
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.netflix.spinnaker.fiat.shared.FiatPermissionEvaluator;
import com.netflix.spinnaker.fiat.shared.FiatService;
import com.netflix.spinnaker.fiat.shared.FiatStatus;
import com.netflix.spinnaker.kork.retrofit.Retrofit2SyncCall;
import com.netflix.spinnaker.security.AuthenticatedRequest;
import io.micrometer.core.annotation.Counted;
import java.util.Collection;
Expand Down Expand Up @@ -59,7 +60,7 @@ public Collection<? extends GrantedAuthority> login(String userid) {

return AuthenticatedRequest.allowAnonymous(
() -> {
getFiatServiceForLogin().loginUser(userid, "");
Retrofit2SyncCall.execute(getFiatServiceForLogin().loginUser(userid));
return resolveAuthorities(userid);
});
}
Expand All @@ -73,7 +74,7 @@ public Collection<? extends GrantedAuthority> loginWithRoles(

return AuthenticatedRequest.allowAnonymous(
() -> {
getFiatServiceForLogin().loginWithRoles(userid, roles);
Retrofit2SyncCall.execute(getFiatServiceForLogin().loginWithRoles(userid, roles));
return resolveAuthorities(userid);
});
}
Expand All @@ -84,7 +85,7 @@ public void logout(String userid) {
return;
}

getFiatServiceForLogin().logoutUser(userid);
Retrofit2SyncCall.execute(getFiatServiceForLogin().logoutUser(userid));
permissionEvaluator.invalidatePermission(userid);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.netflix.spinnaker.kork.core.RetrySupport;
import com.netflix.spinnaker.kork.exceptions.SpinnakerException;
import com.netflix.spinnaker.kork.exceptions.SystemException;
import com.netflix.spinnaker.kork.retrofit.Retrofit2SyncCall;
import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerHttpException;
import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerServerException;
import com.netflix.spinnaker.security.AuthenticatedRequest;
Expand Down Expand Up @@ -78,9 +79,7 @@ public void login(final String userId) {
try {
AuthenticatedRequest.allowAnonymous(
() -> {
// TODO(jvz): FiatService::loginUser should have only one parameter as Retrofit no
// longer requires this body parameter
getFiatServiceForLogin().loginUser(userId, "");
Retrofit2SyncCall.execute(getFiatServiceForLogin().loginUser(userId));
permissionEvaluator.invalidatePermission(userId);
return null;
});
Expand All @@ -95,7 +94,7 @@ public void loginWithRoles(final String userId, final Collection<String> roles)
try {
AuthenticatedRequest.allowAnonymous(
() -> {
getFiatServiceForLogin().loginWithRoles(userId, roles);
Retrofit2SyncCall.execute(getFiatServiceForLogin().loginWithRoles(userId, roles));
permissionEvaluator.invalidatePermission(userId);
return null;
});
Expand All @@ -108,7 +107,7 @@ public void loginWithRoles(final String userId, final Collection<String> roles)
public void logout(String userId) {
if (fiatStatus.isEnabled()) {
try {
getFiatServiceForLogin().logoutUser(userId);
Retrofit2SyncCall.execute(getFiatServiceForLogin().logoutUser(userId));
permissionEvaluator.invalidatePermission(userId);
} catch (SpinnakerServerException e) {
throw UpstreamBadRequest.classifyError(e);
Expand All @@ -119,7 +118,7 @@ public void logout(String userId) {
public void sync() {
if (fiatStatus.isEnabled()) {
try {
getFiatServiceForLogin().sync(List.of());
Retrofit2SyncCall.execute(getFiatServiceForLogin().sync(List.of()));
} catch (SpinnakerServerException e) {
throw UpstreamBadRequest.classifyError(e);
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
enablePublishing=false
fiatVersion=1.52.0
fiatVersion=1.53.0
includeProviders=basic,iap,ldap,oauth2,saml,x509
korkVersion=7.247.0
kotlinVersion=1.6.21
Expand Down

0 comments on commit 94f1156

Please sign in to comment.