Skip to content

Commit

Permalink
hotfix UMA denying station sync to everyone
Browse files Browse the repository at this point in the history
  • Loading branch information
clezag committed Mar 19, 2024
1 parent 90b5cf8 commit 8158eeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import java.util.Date;
import java.util.List;

import jakarta.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
Expand All @@ -24,14 +22,16 @@
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;

import com.opendatahub.timeseries.bdp.writer.dal.util.JPAException;
import com.opendatahub.timeseries.bdp.writer.writer.authz.AuthorizeSyncStation;
import com.opendatahub.timeseries.bdp.dto.dto.DataMapDto;
import com.opendatahub.timeseries.bdp.dto.dto.DataTypeDto;
import com.opendatahub.timeseries.bdp.dto.dto.EventDto;
import com.opendatahub.timeseries.bdp.dto.dto.ProvenanceDto;
import com.opendatahub.timeseries.bdp.dto.dto.RecordDtoImpl;
import com.opendatahub.timeseries.bdp.dto.dto.StationDto;
import com.opendatahub.timeseries.bdp.writer.dal.util.JPAException;
import com.opendatahub.timeseries.bdp.writer.writer.authz.AuthorizeSyncStation;

import jakarta.servlet.http.HttpServletRequest;

/**
* Spring controller handling JSON requests to the writer API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public static void authorize(HttpServletRequest req, String stationType, List<St
boolean onlyActivation) {
var authz = (Authorization) req.getAttribute(Authorization.ATTRIBUTE_AUTHORIZATION);
if (authz == null) {
log.warn("No UMA authorization configuration found. Maybe your client credentials are incomplete or incorrect?");
throw new NotAuthorizedException("Not authorized");
// User is already authorized via role
return;
}
log.debug("Start authorizing station sync");

Expand Down

0 comments on commit 8158eeb

Please sign in to comment.